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

Hi,i want to deploy the vortex(GitHub - revoltchat/vortex: Revolt voice server).
But when i cargo build,it show this error:

vortex# cargo build --release
   Compiling proc-macro2 v1.0.36
   Compiling unicode-xid v0.2.2
   Compiling syn v1.0.85
   Compiling cfg-if v1.0.0
   Compiling libc v0.2.112
   Compiling memchr v2.4.1
   Compiling version_check v0.9.4
   Compiling serde_derive v1.0.133
   Compiling pin-project-lite v0.2.8
   Compiling log v0.4.14
   Compiling futures-core v0.3.19
   Compiling serde v1.0.133
   Compiling bytes v1.1.0
   Compiling parking_lot_core v0.8.5
   Compiling scopeguard v1.1.0
   Compiling itoa v1.0.1
   Compiling smallvec v1.7.0
   Compiling once_cell v1.9.0
   Compiling futures-io v0.3.19
   Compiling typenum v1.15.0
   Compiling futures-sink v0.3.19
   Compiling futures-channel v0.3.19
   Compiling slab v0.4.5
   Compiling fnv v1.0.7
   Compiling futures-task v0.3.19
   Compiling futures-util v0.3.19
   Compiling proc-macro-hack v0.5.19
   Compiling httparse v1.5.1
   Compiling matches v0.1.9
   Compiling pin-utils v0.1.0
   Compiling tinyvec_macros v0.1.0
   Compiling ppv-lite86 v0.2.16
   Compiling percent-encoding v2.1.0
   Compiling autocfg v1.0.1
   Compiling lazy_static v1.4.0
   Compiling opaque-debug v0.3.0
   Compiling cpufeatures v0.2.1
   Compiling unicode-bidi v0.3.7
   Compiling cache-padded v1.2.0
   Compiling mime v0.3.16
   Compiling hashbrown v0.11.2
   Compiling base64 v0.13.0
   Compiling ryu v1.0.9
   Compiling serde_json v1.0.74
   Compiling rustversion v1.0.6
   Compiling async-trait v0.1.52
   Compiling parking v2.0.0
   Compiling try-lock v0.2.3
   Compiling event-listener v2.5.1
   Compiling fastrand v1.6.0
   Compiling waker-fn v1.1.0
   Compiling byteorder v1.4.3
   Compiling itoa v0.4.8
   Compiling regex-syntax v0.6.25
   Compiling httpdate v1.0.2
   Compiling utf-8 v0.7.6
   Compiling mediasoup-sys v0.3.2
   Compiling safemem v0.3.3
   Compiling unicode-segmentation v1.8.0
   Compiling remove_dir_all v0.5.3
   Compiling async-task v4.0.3
   Compiling tower-service v0.3.1
   Compiling quick-error v1.2.3
   Compiling bitflags v1.3.2
   Compiling nohash-hasher v0.2.0
   Compiling termcolor v1.1.2
   Compiling lru v0.7.2
   Compiling hash_hasher v2.0.3
   Compiling scoped-tls v1.0.0
   Compiling humantime v2.1.0
   Compiling atomic-take v1.0.0
   Compiling dotenv v0.15.0
   Compiling instant v0.1.12
   Compiling generic-array v0.14.5
   Compiling unicase v2.6.0
   Compiling futures-micro v0.5.0
   Compiling http v0.2.6
   Compiling tinyvec v1.5.1
   Compiling form_urlencoded v1.0.1
   Compiling indexmap v1.8.0
   Compiling tracing-core v0.1.21
   Compiling concurrent-queue v1.2.2
   Compiling async-lock v2.4.0
error: failed to run custom build command for `mediasoup-sys v0.3.2`

Caused by:
  process didn't exit successfully: `/root/vortex/target/release/build/mediasoup-sys-0f402da1f59baa56/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'Failed to start: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.3.2/build.rs:28:14
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
vortex# RUST_BACKTRACE=1 cargo run
   Compiling proc-macro2 v1.0.36
   Compiling unicode-xid v0.2.2
   Compiling syn v1.0.85
   Compiling cfg-if v1.0.0
   Compiling libc v0.2.112
   Compiling memchr v2.4.1
   Compiling version_check v0.9.4
   Compiling pin-project-lite v0.2.8
   Compiling log v0.4.14
   Compiling serde_derive v1.0.133
   Compiling futures-core v0.3.19
   Compiling serde v1.0.133
   Compiling bytes v1.1.0
   Compiling parking_lot_core v0.8.5
   Compiling smallvec v1.7.0
   Compiling scopeguard v1.1.0
   Compiling itoa v1.0.1
   Compiling once_cell v1.9.0
   Compiling futures-io v0.3.19
   Compiling typenum v1.15.0
   Compiling fnv v1.0.7
   Compiling slab v0.4.5
   Compiling futures-sink v0.3.19
   Compiling futures-task v0.3.19
   Compiling futures-channel v0.3.19
   Compiling futures-util v0.3.19
   Compiling pin-utils v0.1.0
   Compiling ppv-lite86 v0.2.16
   Compiling httparse v1.5.1
   Compiling proc-macro-hack v0.5.19
   Compiling matches v0.1.9
   Compiling tinyvec_macros v0.1.0
   Compiling autocfg v1.0.1
   Compiling percent-encoding v2.1.0
   Compiling lazy_static v1.4.0
   Compiling cpufeatures v0.2.1
   Compiling opaque-debug v0.3.0
   Compiling unicode-bidi v0.3.7
   Compiling cache-padded v1.2.0
   Compiling ryu v1.0.9
   Compiling hashbrown v0.11.2
   Compiling mime v0.3.16
   Compiling base64 v0.13.0
   Compiling rustversion v1.0.6
   Compiling serde_json v1.0.74
   Compiling event-listener v2.5.1
   Compiling async-trait v0.1.52
   Compiling try-lock v0.2.3
   Compiling waker-fn v1.1.0
   Compiling httpdate v1.0.2
   Compiling utf-8 v0.7.6
   Compiling regex-syntax v0.6.25
   Compiling fastrand v1.6.0
   Compiling mediasoup-sys v0.3.2
   Compiling itoa v0.4.8
   Compiling remove_dir_all v0.5.3
   Compiling byteorder v1.4.3
   Compiling unicode-segmentation v1.8.0
   Compiling safemem v0.3.3
   Compiling parking v2.0.0
   Compiling nohash-hasher v0.2.0
   Compiling async-task v4.0.3
   Compiling bitflags v1.3.2
   Compiling quick-error v1.2.3
   Compiling tower-service v0.3.1
   Compiling scoped-tls v1.0.0
   Compiling lru v0.7.2
   Compiling humantime v2.1.0
   Compiling hash_hasher v2.0.3
   Compiling termcolor v1.1.2
   Compiling atomic-take v1.0.0
   Compiling dotenv v0.15.0
   Compiling instant v0.1.12
   Compiling generic-array v0.14.5
   Compiling unicase v2.6.0
   Compiling futures-micro v0.5.0
   Compiling http v0.2.6
   Compiling tinyvec v1.5.1
   Compiling indexmap v1.8.0
   Compiling form_urlencoded v1.0.1
   Compiling tracing-core v0.1.21
   Compiling concurrent-queue v1.2.2
   Compiling async-lock v2.4.0
error: failed to run custom build command for `mediasoup-sys v0.3.2`

Caused by:
  process didn't exit successfully: `/root/vortex/target/debug/build/mediasoup-sys-8521fe0d7bb10273/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'Failed to start: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.3.2/build.rs:28:14
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/panicking.rs:498:5
     1: core::panicking::panic_fmt
               at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/panicking.rs:116:14
     2: core::result::unwrap_failed
               at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/result.rs:1690:5
     3: core::result::Result<T,E>::expect
               at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/result.rs:975:23
     4: build_script_build::main
               at ./build.rs:25:20
     5: core::ops::function::FnOnce::call_once
               at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/ops/function.rs:227:5
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

I have try delete ./cargo/registry/cache and index,and cleaning target directory,but it not work.

Do you have C and C++ compilers installed? If not, you’ll have to install gcc/g++ or Clang, so that you have working c++ command. You’ll need C and C++ compilers for a lot of things when working with Rust.

Hi.I have C compilers.

~/vortex# gcc --version
gcc (Debian 8.3.0-6) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

My os is debian 10

I asked about C and C++

yes,i have C and C++ compilers.

Doesn’t seem like it is configured properly.

What does c++ --version say?

This is my fault, after reinstalling c++ it doesn’t prompt anymore.But a new problem

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

Caused by:
  process didn't exit successfully: `/root/vortex/target/release/build/mediasoup-sys-0f402da1f59baa56/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-link-search=native=/usr/lib/gcc/x86_64-linux-gnu/8/
  cargo:rustc-link-lib=static=stdc++
  # Updated pip and setuptools are needed for meson
  # `--system` is not present everywhere and is only needed as workaround for
  # Debian-specific issue (copied from
  # https://github.com/gluster/gstatus/pull/33), fallback to command without
  # `--system` if the first one fails.
  /usr/bin/python3 -m pip install --system --target=/root/vortex/target/release/build/mediasoup-sys-69dc36c09ac42e71/out/out/pip pip setuptools || \
        /usr/bin/python3 -m pip install --target=/root/vortex/target/release/build/mediasoup-sys-69dc36c09ac42e71/out/out/pip pip setuptools || \
        echo "Installation failed, likely because PIP is unavailable, if you are on Debian/Ubuntu or derivative please install the python3-pip package"
  Looking in indexes: http://mirrors.tencentyun.com/pypi/simple
  Collecting pip
    Downloading http://mirrors.tencentyun.com/pypi/packages/4d/16/0a14ca596f30316efd412a60bdfac02a7259bf8673d4d917dc60b9a21812/pip-22.0.4-py3-none-any.whl (2.1MB)
  Collecting setuptools
    Downloading http://mirrors.tencentyun.com/pypi/packages/3b/02/8d4d27b1cacaac2d129a27d17a22d92a2a5eedcb7817d4ed8ab0d4daf5c4/setuptools-60.9.3-py3-none-any.whl (1.1MB)
  Installing collected packages: pip, setuptools
  Successfully installed pip-22.0.4 setuptools-60.9.3
  # Install `meson` and `ninja` using `pip` into custom location, so we don't
  # depend on system-wide installation.
  /usr/bin/python3 -m pip install --upgrade --target=/root/vortex/target/release/build/mediasoup-sys-69dc36c09ac42e71/out/out/pip  meson ninja
  Looking in indexes: http://mirrors.tencentyun.com/pypi/simple
  Collecting meson
    Downloading http://mirrors.tencentyun.com/pypi/packages/77/04/8de56b69d805406bf8c1d73934938680cec9d417fa39b4a68833729505a5/meson-0.61.2-py3-none-any.whl (850 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 850.3/850.3 KB 8.7 MB/s eta 0:00:00
  Collecting ninja
    Downloading http://mirrors.tencentyun.com/pypi/packages/52/65/d212822d0f29afecbad20cc3b3f41b8eeb4b47bea728602b8ce0b2d347f5/ninja-1.10.2.3-py2.py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl (108 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 108.1/108.1 KB 838.0 kB/s eta 0:00:00
  Installing collected packages: ninja, meson
  Successfully installed meson-0.61.2 ninja-1.10.2.3
  /root/vortex/target/release/build/mediasoup-sys-69dc36c09ac42e71/out/out/pip/bin/meson setup \
        --prefix /root/vortex/target/release/build/mediasoup-sys-69dc36c09ac42e71/out \
        --bindir '' \
        --libdir '' \
        --buildtype release \
        -Db_ndebug=true \
        -Db_pie=true \
        -Db_staticpic=true \
        --reconfigure \
        "" \
        /root/vortex/target/release/build/mediasoup-sys-69dc36c09ac42e71/out/out/Release/build || \
        /root/vortex/target/release/build/mediasoup-sys-69dc36c09ac42e71/out/out/pip/bin/meson setup \
                --prefix /root/vortex/target/release/build/mediasoup-sys-69dc36c09ac42e71/out \
                --bindir '' \
                --libdir '' \
                --buildtype release \
                -Db_ndebug=true \
                -Db_pie=true \
                -Db_staticpic=true \
                "" \
                /root/vortex/target/release/build/mediasoup-sys-69dc36c09ac42e71/out/out/Release/build
  The Meson build system
  Version: 0.61.2
  Source dir: /root/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/mediasoup-sys-0.3.2
  Build dir: /root/vortex/target/release/build/mediasoup-sys-69dc36c09ac42e71/out/out/Release/build
  Build type: native build
  Project name: mediasoup-worker
  Project version: undefined
  C compiler for the host machine: cc (gcc 8.3.0 "cc (Debian 8.3.0-6) 8.3.0")
  C linker for the host machine: cc ld.bfd 2.31.1
  C++ compiler for the host machine: c++ (gcc 8.3.0 "c++ (Debian 8.3.0-6) 8.3.0")
  C++ linker for the host machine: c++ ld.bfd 2.31.1
  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 /root/vortex/target/release/build/mediasoup-sys-69dc36c09ac42e71/out/out/Release/build/meson-logs/meson-log.txt

  --- stderr
  WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
  Directory does not contain a valid build tree:
  /root/vortex/target/release/build/mediasoup-sys-69dc36c09ac42e71/out/out/Release/build
  make: *** [Makefile:74: setup] Error 1
  thread 'main' panicked at 'Failed to build libmediasoup-worker', /root/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/mediasoup-sys-0.3.2/build.rs:96:9
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

`

Mustbe caused by earlier network error. This will no be an issue in upcoming Meson 0.62.0, for now removing target and trying again should help.

Thank you so much for help me.I’ll try it.

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

Caused by:
  process didn't exit successfully: `C:\Users\Tyler\vortex\target\release\build\mediasoup-sys-338daf750252a6a1\build-script-build` (exit code: 101)
  --- stdout
  # Updated pip and setuptools are needed for meson
  # `--system` is not present everywhere and is only needed as workaround for
  # Debian-specific issue (copied from
  # https://github.com/gluster/gstatus/pull/33), fallback to command without
  # `--system` if the first one fails.
  /c/Users/Tyler/AppData/Local/Microsoft/WindowsApps/python3 -m pip install --system --target=C:/Users/Tyler/vortex/target/release/build/mediasoup-sys-2ebf88b41e971e7a/out/out/pip pip setuptools || \
        /c/Users/Tyler/AppData/Local/Microsoft/WindowsApps/python3 -m pip install --target=C:/Users/Tyler/vortex/target/release/build/mediasoup-sys-2ebf88b41e971e7a/out/out/pip pip setuptools || \
        echo "Installation failed, likely because PIP is unavailable, if you are on Debian/Ubuntu or derivative please install the python3-pip package"
  Installation failed, likely because PIP is unavailable, if you are on Debian/Ubuntu or derivative please install the python3-pip package
  # Install `meson` and `ninja` using `pip` into custom location, so we don't
  # depend on system-wide installation.
  /c/Users/Tyler/AppData/Local/Microsoft/WindowsApps/python3 -m pip install --upgrade --target=C:/Users/Tyler/vortex/target/release/build/mediasoup-sys-2ebf88b41e971e7a/out/out/pip  meson ninja

  --- stderr
   - Cannot open - Cannot open - Cannot openmake: *** [Makefile:64: meson-ninja] Error 1
  thread 'main' panicked at 'Failed to build libmediasoup-worker', C:\Users\Tyler\.cargo\registry\src\github.com-1ecc6299db9ec823\mediasoup-sys-0.3.1\build.rs:94:9
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
g++ (MinGW.org GCC-6.3.0-1) 6.3.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I am having the same error… deleting target and retrying did not work. Please advise. (I have Python installed with pip, meson and setuptools.)