# Cannot build rust mediasoup

**URL:** <https://mediasoup.discourse.group/t/cannot-build-rust-mediasoup/3682>\
**Category:** Deployment & Scalability\
**Created:** [December 5, 2021, 6:07am UTC](https://mediasoup.discourse.group/t/cannot-build-rust-mediasoup/3682 "2021-12-05T06:07:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChosunOne](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/chosunone/32/562_2.png) [@ChosunOne](https://mediasoup.discourse.group/u/ChosunOne)\
**Post date:** [December 5, 2021, 6:07am UTC](https://mediasoup.discourse.group/t/cannot-build-rust-mediasoup/3682/1 "2021-12-05T06:07:30Z")

</div>

While trying to build a project using rust mediasoup, I get:

```auto
ERROR: Subproject exists but has no meson.build file

```

I cannot seem to get the `cargo build` command to run. I’ve tried deleting the entire target folder and retrying, but it fails 100% of the time.

Here is my meson-log.txt file:

```auto
Build started at 2021-12-05T15:02:54.205044
Main binary: /usr/bin/python3
Build Options: -Db_pie=true -Db_staticpic=true -Dbuildtype=debug
Python system: Linux
The Meson build system
Version: 0.60.2
Source dir: /home/chosunone/.cargo/registry/src/github.com-1ecc6299db9ec823/mediasoup-sys-0.3.0
Build dir: /home/chosunone/source/sfu-rust/target/debug/build/mediasoup-sys-62bad9506a995114/out/Debug
Build type: native build
Project name: mediasoup-worker
Project version: undefined
Sanity testing C compiler: cc
Is cross compiler: False.
Sanity check compiler command line: cc sanitycheckc.c -o sanitycheckc.exe -D_FILE_OFFSET_BITS=64
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: /home/chosunone/source/sfu-rust/target/debug/build/mediasoup-sys-62bad9506a995114/out/Debug/meson-private/sanitycheckc.exe
C compiler for the host machine: cc (gcc 8.4.0 "cc (Ubuntu 8.4.0-3ubuntu2) 8.4.0")
C linker for the host machine: cc ld.bfd 2.34
Sanity testing C++ compiler: c++
Is cross compiler: False.
Sanity check compiler command line: c++ sanitycheckcpp.cc -o sanitycheckcpp.exe -D_FILE_OFFSET_BITS=64
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: /home/chosunone/source/sfu-rust/target/debug/build/mediasoup-sys-62bad9506a995114/out/Debug/meson-private/sanitycheckcpp.exe
C++ compiler for the host machine: c++ (gcc 8.4.0 "c++ (Ubuntu 8.4.0-3ubuntu2) 8.4.0")
C++ linker for the host machine: c++ ld.bfd 2.34
Sanity testing C compiler: cc
Is cross compiler: False.
Sanity check compiler command line: cc sanitycheckc.c -o sanitycheckc.exe -D_FILE_OFFSET_BITS=64
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: /home/chosunone/source/sfu-rust/target/debug/build/mediasoup-sys-62bad9506a995114/out/Debug/meson-private/sanitycheckc.exe
C compiler for the build machine: cc (gcc 8.4.0 "cc (Ubuntu 8.4.0-3ubuntu2) 8.4.0")
C linker for the build machine: cc ld.bfd 2.34
Sanity testing C++ compiler: c++
Is cross compiler: False.
Sanity check compiler command line: c++ sanitycheckcpp.cc -o sanitycheckcpp.exe -D_FILE_OFFSET_BITS=64
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: /home/chosunone/source/sfu-rust/target/debug/build/mediasoup-sys-62bad9506a995114/out/Debug/meson-private/sanitycheckcpp.exe
C++ compiler for the build machine: c++ (gcc 8.4.0 "c++ (Ubuntu 8.4.0-3ubuntu2) 8.4.0")
C++ linker for the build machine: c++ ld.bfd 2.34
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: x86_64
Host machine cpu: x86_64
Target machine cpu family: x86_64
Target machine cpu: x86_64

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

```

Please advise

---

<div class="post-metadata">

**Author:** ![nazar-pc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/nazar-pc/32/369_2.png) [@nazar-pc](https://mediasoup.discourse.group/u/nazar-pc)\
**Post date:** [December 5, 2021, 6:09am UTC](https://mediasoup.discourse.group/t/cannot-build-rust-mediasoup/3682/2 "2021-12-05T06:09:30Z")

</div>

> [@Mediasoup worker default make failed](https://mediasoup.discourse.group/t/mediasoup-worker-default-make-failed/3647/2):
>
> Apparently something went wrong before and now you have inconsistent state. Try to remove everything from worker/subprojects except packagefiles and \*.wrap files. Would be helpful if you can tell a bit more how you got there though. It works fine on my machine and in CI on 3 major platforms.

Please use search on the forum next time.

---

<div class="post-metadata">

**Author:** ![ChosunOne](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/chosunone/32/562_2.png) [@ChosunOne](https://mediasoup.discourse.group/u/ChosunOne)\
**Post date:** [December 5, 2021, 6:09am UTC](https://mediasoup.discourse.group/t/cannot-build-rust-mediasoup/3682/3 "2021-12-05T06:09:44Z")

</div>

I don’t know where to find those directories

---

<div class="post-metadata">

**Author:** ![nazar-pc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/nazar-pc/32/369_2.png) [@nazar-pc](https://mediasoup.discourse.group/u/nazar-pc)\
**Post date:** [December 5, 2021, 6:18am UTC](https://mediasoup.discourse.group/t/cannot-build-rust-mediasoup/3682/4 "2021-12-05T06:18:44Z")

</div>

I just created a fresh project, added `mediasoup = "0.9.0"` as dependency and it worked fine on Ubuntu 21.04.  
Deleting `target` directory would have helped for sure.

What OS are you on? Also make sure network doesn’t block access to downloading some of the dependencies (like from GitHub).

---

<div class="post-metadata">

**Author:** ![ChosunOne](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/chosunone/32/562_2.png) [@ChosunOne](https://mediasoup.discourse.group/u/ChosunOne)\
**Post date:** [December 5, 2021, 6:37am UTC](https://mediasoup.discourse.group/t/cannot-build-rust-mediasoup/3682/5 "2021-12-05T06:37:43Z")

</div>

I’m on Ubuntu 20.04. It seems that the directories that were causing problems were in my local ~/.cargo cache of mediasoup, not in the target directory of the project itself. I resolved it by deleting mediasoup from the cargo cache.

---

<div class="post-metadata">

**Author:** ![nazar-pc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/nazar-pc/32/369_2.png) [@nazar-pc](https://mediasoup.discourse.group/u/nazar-pc)\
**Post date:** [December 5, 2021, 6:50am UTC](https://mediasoup.discourse.group/t/cannot-build-rust-mediasoup/3682/6 "2021-12-05T06:50:19Z")

</div>

Interesting and weird. Either way, the other topic linked is still relevant and this issue should generally go away once fixed upstream.
