Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build rust target x86_64-unknown-linux-musl #1490

Open
simon-fu opened this issue Feb 9, 2025 · 7 comments
Open

Can't build rust target x86_64-unknown-linux-musl #1490

simon-fu opened this issue Feb 9, 2025 · 7 comments

Comments

@simon-fu
Copy link

simon-fu commented Feb 9, 2025

Bug Report

Your environment

  • Operating system: Debian 6.1.119
  • Node version:
  • npm version: 10.9.2
  • gcc/clang version: gcc (Debian 12.2.0-14) 12.2.0
  • mediasoup version: 3.15.3 (commit 4638d83)
  • mediasoup-client version:

Issue description

cargo build --release --target=x86_64-unknown-linux-musl --example echo
  = note: /usr/bin/ld: /root/simon/mediasoup/target/x86_64-unknown-linux-musl/release/deps/libmediasoup_sys-d3efff36dce0438a.rlib(src_unix_core.c.o): in function `uv__nonblock_fcntl':
          core.c:(.text+0xaa4): undefined reference to `fcntl64'
          /usr/bin/ld: core.c:(.text+0xaee): undefined reference to `fcntl64'
@simon-fu simon-fu added the bug label Feb 9, 2025
@nazar-pc
Copy link
Collaborator

nazar-pc commented Feb 9, 2025

I think if you build for musl on non-musl platform like Debian you might need to tweak some things. I don't think musl is propagated to C++ part right now, so I'd recommend to build in Alpine Linux container instead for now.

Labeling as a feature request (cross-compilation) rather than a bug.

@ibc
Copy link
Member

ibc commented Feb 9, 2025

Labeling as a feature request (cross-compilation) rather than a bug.

Is this something we can really address? I have no idea about cross-compilation stuff and honestly I don't want that this becomes one of those issues that stay open forever without any real effort on them.

@nazar-pc
Copy link
Collaborator

nazar-pc commented Feb 9, 2025

Fair, we can certainly address this. Whether we will is a slightly different questions though.
External contribution will be appreciated here, I suspect some Meson flag will be sufficient to make this work as expected, just need to figure out which one.

@ibc
Copy link
Member

ibc commented Feb 9, 2025

But the issue description doesn't even mention Docker or anything about containers.

@ibc
Copy link
Member

ibc commented Feb 9, 2025

I mean: if I come to this ticket within next 2 months I will have no idea what it is about.

@nazar-pc
Copy link
Collaborator

nazar-pc commented Feb 9, 2025

This has nothing to do with Docker, but running Alpine Linux under Docker can help to bypass this issue (Debian uses Glibc by default and compiling for Musl is a bit less straightforward there).

@ibc
Copy link
Member

ibc commented Feb 9, 2025

I don't think this is really something in our side given the similar problems exist out there (with solutions included):

https://stackoverflow.com/questions/72081987/cant-build-for-target-x86-64-unknown-linux-musl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants