avstack / gst-meet

Connect GStreamer pipelines to Jitsi Meet conferences
Apache License 2.0
70 stars 25 forks source link

Can't compile it by nix #30

Closed zsinba closed 2 years ago

zsinba commented 2 years ago

https://nixos.org/guides/install-nix.html image

I installed a new Nix environment through Docker under a brand new Ubuntu 20.04. I tried to use this combined Nix environment to compile gst-meet. Unfortunately, I did not succeed. It prompted the lack of openssl related. There are some other errors. This shows that the nix-shell mentioned in your readme can be used to solve the dependency problem and compile successfully, which is not correct. Hope to further verify

jbg commented 2 years ago

The shell.nix works for us. If you would like us to help debug it in your environment, please at least provide the error details. "The lack of openssl related" is clearly not enough to even begin to suggest a solution.

Please, before opening any more issues, consider whether you are providing enough information in the issue description for us to help you.

zsinba commented 2 years ago

[nix-shell:/workdir/gst-meet]# cargo build warning: /workdir/gst-meet/Cargo.toml: unused manifest key: workspace.openssl Compiling openssl-sys v0.9.72 error: failed to run custom build command foropenssl-sys v0.9.72`

Caused by: process didn't exit successfully: /workdir/gst-meet/target/debug/build/openssl-sys-9ecd07bc946f5127/build-script-main (exit code: 101) --- stdout cargo:rustc-cfg=const_fn cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset cargo:rerun-if-env-changed=OPENSSL_LIB_DIR OPENSSL_LIB_DIR unset cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR OPENSSL_INCLUDE_DIR unset cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset cargo:rerun-if-env-changed=OPENSSL_DIR OPENSSL_DIR unset cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG cargo:rerun-if-env-changed=OPENSSL_STATIC cargo:rerun-if-env-changed=OPENSSL_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR run pkg_config fail: "\"pkg-config\" \"--libs\" \"--cflags\" \"openssl\" did not exit successfully: exit code: 1\nerror: could not find system library \'openssl\' required by the \'openssl-sys\' crate\n\n--- stderr\nPackage openssl was not found in the pkg-config search path.\nPerhaps you should add the directory containing `openssl.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'openssl\' found\n"

--- stderr thread 'main' panicked at '

Could not find directory of OpenSSL installation, and this -sys crate cannot proceed without this knowledge. If OpenSSL is installed and this crate had trouble finding it, you can set the OPENSSL_DIR environment variable for the compilation process.

Make sure you also have the development packages of openssl installed. For example, libssl-dev on Ubuntu or openssl-devel on Fedora.

If you're in a situation where you think the directory should be found automatically, please open a bug at https://github.com/sfackler/rust-openssl and include information about your system as well as this message.

$HOST = x86_64-unknown-linux-gnu $TARGET = x86_64-unknown-linux-gnu openssl-sys = 0.9.72

', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.72/build/find_normal.rs:180:5 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

[nix-shell:/workdir/gst-meet]# cargo build warning: /workdir/gst-meet/Cargo.toml: unused manifest key: workspace.openssl Compiling openssl-sys v0.9.72 error: failed to run custom build command for openssl-sys v0.9.72

Caused by: process didn't exit successfully: /workdir/gst-meet/target/debug/build/openssl-sys-9ecd07bc946f5127/build-script-main (exit code: 101) --- stdout cargo:rustc-cfg=const_fn cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset cargo:rerun-if-env-changed=OPENSSL_LIB_DIR OPENSSL_LIB_DIR unset cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR OPENSSL_INCLUDE_DIR unset cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset cargo:rerun-if-env-changed=OPENSSL_DIR OPENSSL_DIR unset cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG cargo:rerun-if-env-changed=OPENSSL_STATIC cargo:rerun-if-env-changed=OPENSSL_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR run pkg_config fail: "\"pkg-config\" \"--libs\" \"--cflags\" \"openssl\" did not exit successfully: exit code: 1\nerror: could not find system library \'openssl\' required by the \'openssl-sys\' crate\n\n--- stderr\nPackage openssl was not found in the pkg-config search path.\nPerhaps you should add the directory containing `openssl.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'openssl\' found\n"

--- stderr thread 'main' panicked at '

Could not find directory of OpenSSL installation, and this -sys crate cannot proceed without this knowledge. If OpenSSL is installed and this crate had trouble finding it, you can set the OPENSSL_DIR environment variable for the compilation process.

Make sure you also have the development packages of openssl installed. For example, libssl-dev on Ubuntu or openssl-devel on Fedora.

If you're in a situation where you think the directory should be found automatically, please open a bug at https://github.com/sfackler/rust-openssl and include information about your system as well as this message.

$HOST = x86_64-unknown-linux-gnu $TARGET = x86_64-unknown-linux-gnu openssl-sys = 0.9.72

', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.72/build/find_normal.rs:180:5 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace`

jbg commented 2 years ago

Thank you. In future, please use code tags (``` on a line above and below what you are pasting), so that parts of what you paste don't get lost due to being interpreted as formatting.

You can try adding openssl to the shell's buildInputs. If it helps in your environment, a PR would be welcome.

zsinba commented 2 years ago

image

code scope ,Isn't that it?

jbg commented 2 years ago

Yes, that's the GUI way of doing the same.

jbg commented 2 years ago

Confirmed that openssl needs to be added to buildInputs on Linux. Fixed in abd8bcb142643feb18df65b961ea58438a83f218.

zsinba commented 2 years ago

another error after adding openssl

image

''' Compiling glib v0.14.8 Compiling gstreamer v0.17.4 Compiling gstreamer-rtp v0.17.0 Compiling nice-gst-meet v0.1.1 (/workdir/gst-meet/nice-gst-meet) Compiling lib-gst-meet v0.4.0 (/workdir/gst-meet/lib-gst-meet) error[E0277]: [xmpp_parsers_gst_meet::Element; 2] is not an iterator --> lib-gst-meet/src/conference.rs:186:23 186 presence.extend([ ___^ 187 Element::builder("jitsi_participant_region", ns::DEFAULT_NS) 188 .append(region.as_str()) 189 .build(), ... 192 .build(), 193 ]); ___^ expected an implementor of trait IntoIterator
= note: the trait bound `[xmpp_parsers_gst_meet::Element; 2]: IntoIterator` is not satisfied
= note: required because of the requirements on the impl of `IntoIterator` for `[xmpp_parsers_gst_meet::Element; 2]`

help: consider borrowing here | 186 | presence.extend(&[ 187 | Element::builder("jitsi_participant_region", ns::DEFAULT_NS) 188 | .append(region.as_str()) 189 | .build(), 190 | Element::builder("region", "http://jitsi.org/jitsi-meet") 191 | .attr("id", region) ...

error: aborting due to previous error

For more information about this error, try rustc --explain E0277. error: could not compile lib-gst-meet

To learn more, run the command again with --verbose. warning: build failed, waiting for other jobs to finish... error: build failed

jbg commented 2 years ago

To format code, it's three backticks: ``` not three single quotes: '''

Minimum Rust version to compile gst-meet is 1.53. When I run nix-shell --pure I get 1.56, so I'm not sure how you have an old version, but you do.

zsinba commented 2 years ago

I commented out these lines and compiled. I did not modify rust's version, which I believe is not old.

jbg commented 2 years ago

You don't need to guess, you can just run cargo --version inside the nix environment. The lines in question will compile on any Rust version from 1.53 onward.