-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Prebuilt mediasoup-worker fails in Debian Bullseye 11: version `GLIBC_2.33' not found #1089
Comments
@barlock help please |
I've found a probably completely unrelated fix (no idea if it makes sense, haven't tested it because no idea about it): https://github.com/anbox/anbox/pull/1892/files |
Problem seems to be that my Debian host has different version of
while prebuilt mediasoup-worker requires... 4 different versions???
|
…oesn't run on current host A workaround for issue #1089 Basically, try to run the fetched binary and, if it doesn't work as expected, fallback to building it locally.
Working on a workaround: #1090 |
Interesting, I'm afraid this type of error is far out of my wheel house. I have a few folks on my team who know c++, I'll have someone take a look to see if they can make sense of it and make better suggestions. Immediate things that come to mind would be:
|
|
See my ignorance of c projects 😅
I meant just for prebuilds, not entirely. Then linux would function the same way it always had. Your fix is a clever one for sure and probably better than just removing it. I was thinking more as you'll likely need a new version of the project to publish your fix (3.12.1?) for 3.12.0, you can remove the linux asset and anyone using it won't be broken. |
Yep, 3.12.1 should workaround the issue in Linux. Just wondering if we can avoid the issue entirely. Perhaps prebuilt binaries should be more OS specific. Absolutely no idea. |
As I was commenting in one of the older PRs, downloading should happen for a specific distro, specific version. If either distro or version do not match, it should be cmpiled frm scratch. |
You shold be able to compile static binary with musl libc, with Glibc it is not possible AFAIK. |
Easy enough to add more runners across the spectrum that GitHub offers. Will also add a lot of good "test cases" for supported platforms. Honest question here, is it really distro/version though? I would assume there's something more runtime specific to check against (like libc version as mentioned here). |
And how to the get OS name and versión to name the prebuilts? Some uname command (not in Windows AFAIU) with specific options? I have bad experience using it. |
Glibc generally is forwards compatible. So if you compile for Ubuntu 18.04, it should also run on 20.04, 22.04 and all versions in between. And we don't depend on specific versions of other dependencies, we compile them from source. And for Linux you don't care about host OS, it is possible to build software for any distro and any architecture in a container.
Overall worth looking at other projects that ship prebuilt stuff, this is not a new problem, it was solved many times before. |
So maybe the problem is that we are building in Ubuntu 22.04 and then trying to use in Debian stable which comes with an older version of glib? |
Yes, glibc uses symbol versioning. The program references the latest available versions of functions/structures provided by libc in the build environment. Possible workarounds are:
|
I'll write a PR today using older Ubuntu 20.04 to generate the prebuilt and will check it.
I have no idea about gLib. Any tip about how to do it in Ubuntu 22.04, please?
And how to do that? 😀
How to do it? Thanks a lot. |
Trying it here: #1091 |
I confirm that using Ubuntu 20.04 (instead of 22.04) to build the Linux prebuilt makes the binary work in Debian 11. |
I say it'd be better to build a statically-linked executable with musl libc like @nazar-pc suggested, rather than praying that the glibc version is compatible, to avoid issues of the kind. It'd be worth trying out. |
I have no idea how to do it. Also, in case the prebuilt worker is not compatible with the host the mediasoup install process builds it from scratch, so this is no longer an urgent issue. Said that, feel free to comment how to statically link the worker with such a "musl glib" (I don't know what that is). |
I think the easiest is to compile under Alpine Linux, then IIRC it should result in statically linked executable, Alpine Linux is using musl by default. |
@nazar-pc It will not result in a static executable as-is, since you'd need to pass the variables to the compiler, so it builds a static binary. It'd just depend on musl libc instead of glibc. It could be done on Alpine Linux, but musl can also be installed on Debian/Ubuntu, and is packaged on the repos: https://packages.ubuntu.com/jammy/musl |
On Ubuntu musl seems to be significantly harder to use comparing to Alpine Linux. But yes, we'd have to explicitly compile static version (we might already, I'm too lazy to check). |
So if we use an alpine machine in CI to build the worker:
|
No need for a machine, any Linux able to run Alpine container image will work. I'd try the container and then inspect the binary afterwards. |
Do you mean that we should install Docker in the |
It is already installed by default, but yeah |
I'll put this at the bottom of my endless TODO list because I have very little knowledge about GitHub CI and I don't know what "it's already installed" means. |
FWIW, if someone can create the build target to be run in alpine that will generate the binary, I'm happy to submit the PR to automate the build. |
Not sure if I understand. Why can't that be part of the PR you may write? |
I don't know how to compile c projects, but I do know how to orchestrate builds and write automations with docker and GHA. I was offering that, if someone else could create the script to build the binary with a statically linked musl libc that we could use for a generic linux binary, I'd be happy to automate it. If there's a human who has both of those skills, I'm obviously not necessary. |
This PR exposes kernel mayor number in the mediasoup-worker binary name to make it possible to have prebuilts for Linux with kernel 5 and 6 (the latter supports `io-uring`). **NOTE 1:** This is related to issue #1282 but doesn't complete it. **TODO:** In `mediasoup-worker-prebuild.yaml` we must include an Ubuntu version with kernel >= 6. Problem is that Ubuntu 22.04 still uses kernel 5.15 and there are no other more modern Ubuntu versions in GitHub CI. **NOTE 2:** When that is done (in part 2 of this task), we must still keep Ubuntu 20.04 since, as documented in the job file, it uses an older version of GLib and otherwise we'd run into this issue again: #1089.
Bug Report
After #1087 is merged and released,
npm i mediasoup
in Debian Bullseye 11 fetchesmediasoup-worker-3.12.0-linux-x64.tgz
from mediasoup GitHub Releases:https://github.com/versatica/mediasoup/releases.Then it fails in runtime. Easy to reproduce by just running the worker directly:
Your environment
The text was updated successfully, but these errors were encountered: