I’m trying to get whepsrc available for PI. And unfortunately the plugin package isn’t available and has to be built.
Where is the webrtchttp sources to be able to build and a how to build. I spent 2 hours trying to find it and figure it out. Does it require building the entire project ?
Hello the webrtchttp
is a part of the GStreamer Rust plugins. You can fetch the code from GStreamer / gst-plugins-rs · GitLab
Build instructions here - Building
Thanks. It’s still very vague. It documents how to build just one feature in it, so which feature name is it for whepsrc ? “gst-plugin-cdg”. Can it be built against the default debian packages for the rest ?
There is a meson build that isn’t documented. Is it easier to use meson, I see it has a build system for whepsrc.
I found a better build setup process as it’s missing all the requirements from that rep.
Updfate: this docker method for creating a cross compile deb which is exactly what I need. Almost worked but failed. have to research now.
docker run -v .:/src:z --workdir /src ghcr.io/mopidy/gst-plugins-rs-build:1 /bin/bash entrypoint.sh armhf net/webrtchttp
docker: Error response from daemon: create .: volume name is too short, names should be at least two alphanumeric characters.
See 'docker run --help'.
make: *** [Makefile:17: build-armhf] Error 125
1 Like
there is another undocumented problem with that rs plugin project to continue further. It can’t find openssl headers.
cargo:warning=build/expando.c:2:10: fatal error: openssl/opensslconf.h: No such file or directory
more here
opened 10:17AM - 02 May 22 UTC
closed 12:35PM - 02 May 22 UTC
This happens the same way under `cross` with a custom docker image, or bare `car… go` on an Ubuntu env. To simplify things, I'll just give the local command (for Ubuntu 21.10). This is a GNU host, but what I want is a statically-linked-with-musl-libc binary.
Assume I've done `sudo apt install pkg-config libssl-dev musl-tools`.
```none
⚬ OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu/ OPENSSL_INCLUDE_DIR=/usr/include/ OPENSSL_STATIC=1 cargo build --target x86_64-unknown-linux-musl
Compiling openssl-sys v0.9.72
Compiling socket2 v0.4.4
Compiling signal-hook-registry v1.4.0
Compiling atty v0.2.14
Compiling mio v0.8.2
Compiling idna v0.2.3
Compiling syn v1.0.92
Compiling nix v0.23.1
Compiling regex v1.5.5
The following warnings were emitted during compilation:
warning: build/expando.c:2:10: fatal error: openssl/opensslconf.h: No such file or directory
warning: 2 | #include <openssl/opensslconf.h>
warning: | ^~~~~~~~~~~~~~~~~~~~~~~
warning: compilation terminated.
error: failed to run custom build command for `openssl-sys v0.9.72`
Caused by:
process didn't exit successfully: `/home/jason/Code/[...]/target/debug/build/openssl-sys-51dce0970b29e049/build-script-main` (exit status: 101)
--- stdout
cargo:rustc-cfg=const_fn
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_LIB_DIR
X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
OPENSSL_LIB_DIR = /usr/lib/x86_64-linux-gnu/
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_INCLUDE_DIR
X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
OPENSSL_INCLUDE_DIR = /usr/include/
cargo:rustc-link-search=native=/usr/lib/x86_64-linux-gnu/
cargo:include=/usr/include/
cargo:rerun-if-changed=build/expando.c
OPT_LEVEL = Some("0")
TARGET = Some("x86_64-unknown-linux-musl")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-musl = None
CC_x86_64_unknown_linux_musl = None
TARGET_CC = None
CC = None
CROSS_COMPILE = None
CFLAGS_x86_64-unknown-linux-musl = None
CFLAGS_x86_64_unknown_linux_musl = None
TARGET_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
running: "musl-gcc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "/usr/include/" "-Wall" "-Wextra" "-E" "build/expando.c"
cargo:warning=build/expando.c:2:10: fatal error: openssl/opensslconf.h: No such file or directory
cargo:warning= 2 | #include <openssl/opensslconf.h>
cargo:warning= | ^~~~~~~~~~~~~~~~~~~~~~~
cargo:warning=compilation terminated.
exit status: 1
--- stderr
thread 'main' panicked at '
Header expansion error:
Error { kind: ToolExecError, message: "Command \"musl-gcc\" \"-O0\" \"-ffunction-sections\" \"-fdata-sections\" \"-fPIC\" \"-g\" \"-fno-omit-frame-pointer\" \"-m64\" \"-I\" \"/usr/include/\" \"-Wall\" \"-Wextra\" \"-E\" \"build/expando.c\" with args \"musl-gcc\" did not execute successfully (status code exit status: 1)." }
Failed to find OpenSSL development headers.
You can try fixing this setting the `OPENSSL_DIR` environment variable
pointing to your OpenSSL installation or installing OpenSSL headers package
specific to your distribution:
# On Ubuntu
sudo apt-get install libssl-dev
# On Arch Linux
sudo pacman -S openssl
# On Fedora
sudo dnf install openssl-devel
See rust-openssl README for more information:
https://github.com/sfackler/rust-openssl#linux
', /home/jason/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.72/build/main.rs:162:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
```
Fundamentally the problem seems to be:
- `opensslconf.h` is at `/usr/include/x86_64-linux-gnu/openssl/opensslconf.h`
- other OpenSSL headers are at `/usr/include/openssl`
So there is no way to set `OPENSSL_INCLUDE_DIR` to a value that satisfies this, and `pkg-config` doesn't seem to help.
This seems similar to #603, but (a) I would be happy with a statically linked OpenSSL, and I don't think they're doing that and (b) I can't even do this via `cross` with a custom image containing OpenSSL, I get the same error.
It requires this in the dependencies
openssl = { version = "0.10", features = ["vendored"] }
But then it complains about this
The system library `gstreamer-webrtc-1.0` required by crate `gstreamer-webrtc-sys` was not found.
More info bullseye the version is 1.18.
> PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags gstreamer-webrtc-1.0 gstreamer-webrtc-1.0 >= 1.18
I’ve spent hours and failed to get this building. Its installing the correct packages in the Docker file. I think “libssl-dev:arm64” works around the ssl header issue but not webrtc.
libgstreamer-plugins-base1.0-dev \
libgstreamer-plugins-bad1.0-dev \
# RPi 0 and 1 (armv6)
gcc-arm-linux-gnueabihf \
libgstreamer-plugins-base1.0-dev:armhf \
libgstreamer-plugins-bad1.0-dev:armhf \
# RPi 3, 4 and 5 (64-bit ARM)
gcc-aarch64-linux-gnu \
libgstreamer-plugins-base1.0-dev:arm64 \
libgstreamer-plugins-bad1.0-dev:arm64 \
#openssl needed for whepsrc
openssl \
libssl-dev \
libssl-dev:arm64 \
libnice \
libnice:arm64 \
It seems it cant find either headers I still get these failures. An updated cross compile doc would be good.
cargo:warning=build/expando.c:2:10: fatal error: openssl/opensslconf.h: No such file or directory