failed to run custom build command for mediasoup-sys v0.2.5

How to solve the problem?I deleted the target folder and ./cargo/registry/cache, but it didn’t help
ubuntu 21.10

error: failed to run custom build command for `mediasoup-sys v0.2.5`

Caused by:
  process didn't exit successfully: `/home/dmitriy/projects/userapi/target/debug/build/mediasoup-sys-8d16fee0e529e4c7/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-link-search=native=/usr/lib/gcc/x86_64-linux-gnu/11/
  cargo:rustc-link-lib=static=stdc++
  /usr/bin/python2 ./scripts/configure.py -R libmediasoup-worker
  ['-R', 'libmediasoup-worker', '/home/dmitriy/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.2.5/mediasoup-worker.gyp', '-I', '/home/dmitriy/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.2.5/common.gypi', '--depth=.', '-f', 'make', '-Goutput_dir=/home/dmitriy/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.2.5/out', '--generator-output', '/home/dmitriy/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.2.5/out', '-Dgcc_version=112', '-Dclang=0', '-Dhost_arch=x64', '-Dtarget_arch=x64', '-Dopenssl_fips=', '-Dmediasoup_asan=false', '-Dnode_byteorder=little']
  make -j16 BUILDTYPE=Release -C out
  make[1]: Entering directory '/home/dmitriy/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.2.5/out'
    CXX(target) /home/dmitriy/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.2.5/out/Release/obj.target/abseil/deps/libwebrtc/deps/abseil-cpp/abseil-cpp/absl/debugging/failure_signal_handler.o
    CC(target) /home/dmitriy/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.2.5/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/objects/obj_dat.o
    CC(target) /home/dmitriy/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.2.5/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/objects/obj_err.o
    CC(target) /home/dmitriy/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.2.5/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/objects/obj_lib.o
    CC(target) /home/dmitriy/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.2.5/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/objects/obj_xref.o
    CC(target) /home/dmitriy/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.2.5/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/ocsp/ocsp_asn.o
    CC(target) /home/dmitriy/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.2.5/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/ocsp/ocsp_cl.o
    CC(target) /home/dmitriy/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.2.5/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/ocsp/ocsp_err.o
    CC(target) /home/dmitriy/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.2.5/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/ocsp/ocsp_ext.o
    CC(target) /home/dmitriy/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.2.5/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/ocsp/ocsp_ht.o
  make[1]: Leaving directory '/home/dmitriy/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.2.5/out'

  --- stderr
  ../deps/libwebrtc/deps/abseil-cpp/abseil-cpp/absl/debugging/failure_signal_handler.cc: In function ‘bool absl::SetupAlternateStackOnce()’:
  ../deps/libwebrtc/deps/abseil-cpp/abseil-cpp/absl/debugging/failure_signal_handler.cc:127:32: error: no matching function for call to ‘max(long int, int)’
    127 |   size_t stack_size = (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask;
        |                        ~~~~~~~~^~~~~~~~~~~~~~~~~
  In file included from /usr/include/c++/11/algorithm:61,
                   from ../deps/libwebrtc/deps/abseil-cpp/abseil-cpp/absl/debugging/failure_signal_handler.cc:31:
  /usr/include/c++/11/bits/stl_algobase.h:254:5: note: candidate: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’
    254 |     max(const _Tp& __a, const _Tp& __b)
        |     ^~~
  /usr/include/c++/11/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
  ../deps/libwebrtc/deps/abseil-cpp/abseil-cpp/absl/debugging/failure_signal_handler.cc:127:32: note:   deduced conflicting types for parameter ‘const _Tp’ (‘long int’ and ‘int’)
    127 |   size_t stack_size = (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask;
        |                        ~~~~~~~~^~~~~~~~~~~~~~~~~
  In file included from /usr/include/c++/11/algorithm:61,
                   from ../deps/libwebrtc/deps/abseil-cpp/abseil-cpp/absl/debugging/failure_signal_handler.cc:31:
  /usr/include/c++/11/bits/stl_algobase.h:300:5: note: candidate: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
    300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
        |     ^~~
  /usr/include/c++/11/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
  ../deps/libwebrtc/deps/abseil-cpp/abseil-cpp/absl/debugging/failure_signal_handler.cc:127:32: note:   deduced conflicting types for parameter ‘const _Tp’ (‘long int’ and ‘int’)
    127 |   size_t stack_size = (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask;
        |                        ~~~~~~~~^~~~~~~~~~~~~~~~~
  In file included from /usr/include/c++/11/algorithm:62,
                   from ../deps/libwebrtc/deps/abseil-cpp/abseil-cpp/absl/debugging/failure_signal_handler.cc:31:
  /usr/include/c++/11/bits/stl_algo.h:3461:5: note: candidate: ‘template<class _Tp> _Tp std::max(std::initializer_list<_Tp>)’
   3461 |     max(initializer_list<_Tp> __l)
        |     ^~~
  /usr/include/c++/11/bits/stl_algo.h:3461:5: note:   template argument deduction/substitution failed:
  ../deps/libwebrtc/deps/abseil-cpp/abseil-cpp/absl/debugging/failure_signal_handler.cc:127:32: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘long int’
    127 |   size_t stack_size = (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask;
        |                        ~~~~~~~~^~~~~~~~~~~~~~~~~
  In file included from /usr/include/c++/11/algorithm:62,
                   from ../deps/libwebrtc/deps/abseil-cpp/abseil-cpp/absl/debugging/failure_signal_handler.cc:31:
  /usr/include/c++/11/bits/stl_algo.h:3467:5: note: candidate: ‘template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare)’
   3467 |     max(initializer_list<_Tp> __l, _Compare __comp)
        |     ^~~
  /usr/include/c++/11/bits/stl_algo.h:3467:5: note:   template argument deduction/substitution failed:
  ../deps/libwebrtc/deps/abseil-cpp/abseil-cpp/absl/debugging/failure_signal_handler.cc:127:32: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘long int’
    127 |   size_t stack_size = (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask;
        |                        ~~~~~~~~^~~~~~~~~~~~~~~~~
  At global scope:
  cc1plus: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
  make[1]: *** [deps/libwebrtc/deps/abseil-cpp/abseil.target.mk:151: /home/dmitriy/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.2.5/out/Release/obj.target/abseil/deps/libwebrtc/deps/abseil-cpp/abseil-cpp/absl/debugging/failure_signal_handler.o] Error 1
  make[1]: *** Waiting for unfinished jobs....
  make: *** [Makefile:114: libmediasoup-worker] Error 2
  thread 'main' panicked at 'Failed to build libmediasoup-worker', /home/dmitriy/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.2.5/build.rs:129: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

The version you’re using is old and no longer supported. Please try to upgrade to latest version. There are some breaking changes in API, but they are easy to fix. As long as it compiles, it should work.

i updated the version but another error appeared

error: failed to run custom build command for `mediasoup-sys v0.3.2`

Caused by:
  process didn't exit successfully: `/home/dmitriy/projects/messengerapi/target/debug/build/mediasoup-sys-3cb30c3602d50f5f/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-link-search=native=/usr/lib/gcc/x86_64-linux-gnu/11/
  cargo:rustc-link-lib=static=stdc++
  /home/dmitriy/projects/messengerapi/target/debug/build/mediasoup-sys-2c4c7a661e6694e8/out/out/pip/bin/meson setup \
  	--prefix /home/dmitriy/projects/messengerapi/target/debug/build/mediasoup-sys-2c4c7a661e6694e8/out \
  	--bindir '' \
  	--libdir '' \
  	--buildtype debug \
  	-Db_pie=true \
  	-Db_staticpic=true \
  	--reconfigure \
  	"" \
  	/home/dmitriy/projects/messengerapi/target/debug/build/mediasoup-sys-2c4c7a661e6694e8/out/out/Debug/build || \
  	/home/dmitriy/projects/messengerapi/target/debug/build/mediasoup-sys-2c4c7a661e6694e8/out/out/pip/bin/meson setup \
  		--prefix /home/dmitriy/projects/messengerapi/target/debug/build/mediasoup-sys-2c4c7a661e6694e8/out \
  		--bindir '' \
  		--libdir '' \
  		--buildtype debug \
  		-Db_pie=true \
  		-Db_staticpic=true \
  		"" \
  		/home/dmitriy/projects/messengerapi/target/debug/build/mediasoup-sys-2c4c7a661e6694e8/out/out/Debug/build
  The Meson build system
  Version: 0.61.2
  Source dir: /home/dmitriy/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.3.2
  Build dir: /home/dmitriy/projects/messengerapi/target/debug/build/mediasoup-sys-2c4c7a661e6694e8/out/out/Debug/build
  Build type: native build
  Project name: mediasoup-worker
  Project version: undefined
  C compiler for the host machine: cc (gcc 11.2.0 "cc (Ubuntu 11.2.0-7ubuntu2) 11.2.0")
  C linker for the host machine: cc ld.bfd 2.37
  C++ compiler for the host machine: c++ (gcc 11.2.0 "c++ (Ubuntu 11.2.0-7ubuntu2) 11.2.0")
  C++ linker for the host machine: c++ ld.bfd 2.37
  Host machine cpu family: x86_64
  Host machine cpu: x86_64

  meson.build:147:0: ERROR: Subproject exists but has no meson.build file

  A full log can be found at /home/dmitriy/projects/messengerapi/target/debug/build/mediasoup-sys-2c4c7a661e6694e8/out/out/Debug/build/meson-logs/meson-log.txt

  --- stderr
  Directory does not contain a valid build tree:
  /home/dmitriy/projects/messengerapi/target/debug/build/mediasoup-sys-2c4c7a661e6694e8/out/out/Debug/build
  make: *** [Makefile:97: setup] Error 1
  thread 'main' panicked at 'Failed to build libmediasoup-worker', /home/dmitriy/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.3.2/build.rs:96:9
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

You must have had something like networking error the first time before this happened. Try to clean target directory and try again, should be fixed then. It will be resolved once next Meson release is out, it is already in their master branch.