Mediasoup Rust Build Fails

I wanted to try out the rust version of mediasoup but I’m getting some errors when building the project.
Just created the project and added mediasoup as dependency. Nothing going on there but somehow the build fails.

I have also tried to local clean cargo cache and target directory inside the projects directory.

Any help would be awesome.

Build log:

cargo build
   Compiling mediasoup-sys v0.4.3
error: failed to run custom build command for `mediasoup-sys v0.4.3`

Caused by:
  process didn't exit successfully: `/Users/baristikir/tmp/mediasoup-testarea/target/debug/build/mediasoup-sys-343b32df800a7590/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-link-search=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib
  cargo:rustc-link-lib=dylib=c++
  cargo:rustc-link-lib=dylib=c++abi
  /Users/baristikir/tmp/mediasoup-testarea/target/debug/build/mediasoup-sys-6ac05ef6f230f44d/out/out/pip/bin/meson setup \
  		--prefix /Users/baristikir/tmp/mediasoup-testarea/target/debug/build/mediasoup-sys-6ac05ef6f230f44d/out \
  		--bindir '' \
  		--libdir '' \
  		--buildtype debug \
  		-Db_pie=true \
  		-Db_staticpic=true \
  		--reconfigure \
  		"" \
  		/Users/baristikir/tmp/mediasoup-testarea/target/debug/build/mediasoup-sys-6ac05ef6f230f44d/out/out/Debug/build || \
  		/Users/baristikir/tmp/mediasoup-testarea/target/debug/build/mediasoup-sys-6ac05ef6f230f44d/out/out/pip/bin/meson setup \
  			--prefix /Users/baristikir/tmp/mediasoup-testarea/target/debug/build/mediasoup-sys-6ac05ef6f230f44d/out \
  			--bindir '' \
  			--libdir '' \
  			--buildtype debug \
  			-Db_pie=true \
  			-Db_staticpic=true \
  			"" \
  			/Users/baristikir/tmp/mediasoup-testarea/target/debug/build/mediasoup-sys-6ac05ef6f230f44d/out/out/Debug/build
  The Meson build system
  Version: 0.61.5
  Source dir: /Users/baristikir/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.4.3
  Build dir: /Users/baristikir/tmp/mediasoup-testarea/target/debug/build/mediasoup-sys-6ac05ef6f230f44d/out/out/Debug/build
  Build type: native build
  Project name: mediasoup-worker
  Project version: undefined
  C compiler for the host machine: cc (clang 13.0.0 "Apple clang version 13.0.0 (clang-1300.0.29.3)")
  C linker for the host machine: cc ld64 711
  C++ compiler for the host machine: c++ (clang 13.0.0 "Apple clang version 13.0.0 (clang-1300.0.29.3)")
  C++ linker for the host machine: c++ ld64 711
  Host machine cpu family: aarch64
  Host machine cpu: arm64
  Downloading openssl source from https://www.openssl.org/source/openssl-3.0.2.tar.gz
  <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>
  A fallback URL could be specified using source_fallback_url key in the wrap file

  meson.build:162:0: ERROR: could not get https://www.openssl.org/source/openssl-3.0.2.tar.gz is the internet available?

  A full log can be found at /Users/baristikir/tmp/mediasoup-testarea/target/debug/build/mediasoup-sys-6ac05ef6f230f44d/out/out/Debug/build/meson-logs/meson-log.txt

  --- stderr
  Directory does not contain a valid build tree:
  /Users/baristikir/tmp/mediasoup-testarea/target/debug/build/mediasoup-sys-6ac05ef6f230f44d/out/out/Debug/build
  make: *** [setup] Error 1
  thread 'main' panicked at 'Failed to build libmediasoup-worker', /Users/baristikir/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.4.3/build.rs:96:9

My Environment:

  • gcc/clang version: Apple clang version 13.0.0 (clang-1300.0.29.3)
  • clang target: arm64-apple-darwin21.5.0
  • mediasoup version: 0.10.0 (https://crates.io/crates/mediasoup)
  • rustc version: 1.62.1
  • rustup version: 1.25.1

make sure you have python 3 and pip install as well

I only see the following error,
error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate.

Are you setting things up correctly? :slight_smile:

Thanks for the replies!

Yes figured out that it was caused by the python installer and the openssl certificate. Tried this solution here and worked for me since then.

not sure why you needed to do that, but ensuring the right version of python and pip is the key really… but yeah good to hear you sorted it out