Unable to build gst-plugins-rs for 1.24.12 on Mac

I’m trying to use gst-plugins-rs to test the new webrtc fixes on my Mac. However, I’m not able to build it.
When I run cargo cbuild -p gst-plugin-webrtc, I’m getting the following error:

dyld[50483]: Library not loaded: @rpath/libssl.3.dylib
  Referenced from: <E233C5AA-3605-3D37-8420-F645B5BD0731> /Users/anon/.cargo/bin/cargo-cbuild
  Reason: tried: '/Users/anon/.rustup/toolchains/stable-aarch64-apple-darwin/lib/libssl.3.dylib' (no such file), '/Library/Frameworks/GStreamer.framework/Libraries/libssl.3.dylib' (no such file)

If it helps, I’m able to build it for 1.25.1

Hello @vr7bd,
It looks like you’re trying to build a single plugin instead of the full package. Please, run the full build. According to error, you’re missing the libssl dependency.

Oh I see. How do I run the full build? I just followed the steps in the README.md where it mentions that I need to run cargo cbuild -p plugin-name

Building a single plugin is fine. Don’t worry about that.

The libssl.3.dylib dependency is missing in your installation it seems. It also looks like you are building against the GStreamer 1.24.12 binaries. If so, the 1.24 binaries only provide OpenSSL 1: recipes/openssl.recipe · 1.24 · GStreamer / cerbero · GitLab

The link command is looking for OpenSSL 3 which is only available in git main: recipes/openssl.recipe · main · GStreamer / cerbero · GitLab and is the reason why it works when targetting 1.25 (which is current git main).

So from what I understood, 1.24.12 uses OpenSSL 1 and 1.25.1 uses OpenSSL 3. Since I’m building gst-plugins-rs from the main branch, it’s using OpenSSL 3 which will work for 1.25.1 and not 1.24.12.
However, I did a git reset --hard in the gst-plugins-rs repo with the commit that points to the 1.24.12 tag. That too is looking for libssl.3.dylib.
Am I missing something?

The GStreamer binaries ship openssl 1.x with 1.24. The 1.25+ binaries ship openssl 3.x. gst-plugins-rs has a different dependency structure that if it decides to automatically vendor openssl, will use openssl 3.x. If you see openssl-src in the output of cargo tree -p gst-plugin-webrtc then you have an incompatible build and would need to start from scratch and try to avoid that.

I also notice that the rust-openssl crate will look for openssl from homebrew (rust-openssl/openssl-sys/build/find_normal.rs at openssl-v0.10.66 · sfackler/rust-openssl · GitHub) which would be incompatible with the GStreamer provided version of openssl.

Thanks for the support and being patient with me!
You’re right!
Running openssl version gave me
OpenSSL 3.4.0 22 Oct 2024 (Library: OpenSSL 3.4.0 22 Oct 2024)
and which openssl gave me
/opt/homebrew/bin/openssl

Just running cargo cbuild gives me the error.
I also don’t see openssl-src in the output for cargo tree -p gst-plugin-webrtc
Any idea on how to proceed?

Right, so cargo is building against homebrew openssl instead of GStreamer provided openssl. You would need to unlink (or uninstall) homebrew’s openssl so that cargo does not use that for building.

1 Like