-
Notifications
You must be signed in to change notification settings - Fork 244
[Feature request] auto-detect missing libstdc++.so.6 issue, and suggest fix or auto-apply fix #1596
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
Comments
@aidigital Thanks for filing this issue. Usually, the workaround for this Thanks also for your suggestions about improving the overall experience for such a scenario. I agree the developer-UX here can be better. |
@savil Thank you, that worked! Just for posterity, it turns out there are 2 ways to solve the problem:
|
@aidigital great. Glad to hear it worked. Good point about the home-manager. When developing Devbox, we usually have a frame-of-reference that tries to make the devbox-project be independently runnable, and reproducible. This matters much more for folks collaborating on a project with a team, or want it to be reproducible for CICD. Of course, totally valid to also add it as a global package for convenience as long as you're aware of the trade-off and can say its worth it for your scenario! Let me rename this task to track your other request of auto-detecting failed libstdc++ import error and suggesting a fix, or auto-applying the fix. |
Try this workaround in your {
"packages": [
// ...
"github:NixOS/nixpkgs/nixos-23.05#stdenv.cc.cc.lib"
],
// ...
} |
I'm not sure if the below is a devbox (latest version, 0.8.1) bug or not. For example, here I'm using { "packages": [ "stdenv.cc.cc.lib" ] } The above gives me ❯ devbox shell
❯ readlink -f ./.devbox/nix/profile/default/lib/libstdc++.so.6
/nix/store/9fy9zzhf613xp0c3jsjxbjq6yp8afrsv-gcc-12.3.0-lib/lib/libstdc++.so.6.0.30
❯ which gcc
/nix/store/zlzz2z48s7ry0hkl55xiqp5a73b4mzrg-gcc-wrapper-12.3.0/bin/gcc And if we use ❯ strings ./.devbox/nix/profile/default/lib/libstdc++.so.6 | grep ^GLIBC | sort | uniq
GLIBC_2.36
GLIBC_2.38 # 👈 oh oh
GLIBCXX_3.4.29
GLIBCXX_3.4.30
# ... ... however my machine has 2.36 ❯ ldd --version
ldd (Debian GLIBC 2.36-9+deb12u3) 2.36 So in my scenario, I had # note from the line below that I'm in both venv and the devbox shell
foo-repo on master [✓] via 🐍 v3.11.4 (venv) via ❄️ impure (nix-shell-env)
❯ dagster --version
ImportError: /nix/store/ld03l52xq2ssn4x0g5asypsxqls40497-glibc-2.37-8/lib/libc.so.6: version `GLIBC_2.38' not found (required by <...>/foo-repo/.devbox/nix/profile/default/lib/libstdc++.so.6) If I'm just in the # note I'm just in the venv
foo-repo on master [✓] via 🐍 v3.11.4 (venv)
❯ dagster --version
dagster, version 1.5.8 FixNow, if instead of ❯ strings ./.devbox/nix/profile/default/lib/libstdc++.so.6 | grep ^GLIBC | sort | uniq
GLIBC_2.36 # I _do_ have 2.36 on my system, so this will work
GLIBCXX_3.4.29
GLIBCXX_3.4.30
# ... @savil, instead of downgrading to gcc 12.2, can I specify something else in Notes:
OS: Debian GNU/Linux 12 (bookworm) on Windows 10.0.19044 x86_64
Kernel: 5.15.90.1-microsoft-standard-WSL2 On a different VM (the below specs) which also has glibc 2.36, until 1-2 weeks ago, OS: Debian GNU/Linux 12 (bookworm) aarch64
Host: Parallels ARM Virtual Machine Parallels ARM Virtual Platform
Kernel: 6.1.0-13-arm64
This also means that in all fairness, I actually don't need either |
@aidigital yeah, this Glibc version mismatch is an issue we've been working on. The underlying cause is a bit involved to explain, but it has to do with what version of glibc the nix packages were built by their maintainers. The glibc version installed on your system isn't relevant: nix packages are designed to be independent of the system by referencing all their dependencies in /nix/store. We have a preliminary fix that was implemented in #1574. We know that it still has some bugs, so take it with a grain of salt. So:
Hopefully, that will update your python and dagster to work with the latest glibc 2.38. Let us know if it does? |
@savil, thanks for your suggestion. The relavant pkgs are these: "[email protected]",
"[email protected]",
"[email protected]",
"stdenv.cc.cc.lib" I would create a venv, manually, then install Here's where it gets good:
"pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.3.so.2.1' : file not found (0) (SQLDriverConnect)")" I tried playing with |
For more context, I just lost 2-3 hours banging my head over this in cgohlke/imagecodecs#87. Essentially, the python package imagecodecs silently fails with no output making it really difficult to tract to this issue. |
Welp, that breaks nodejs. I am catching to the other issues. This seems like a very challenging problem.. |
Probably it's because Couple of thoughts:
|
gcc doesn't quite help, when
with
Aslo stdenv.cc.cc.lib breaks nodejs@14, but not nodejs@16 On the positive side, devbox makes this very easy to test. |
Similar to I saw in your issue you're using |
These versions, python 3.9 and node 14, are imposed by projects I am working on and have little agency over it. The pip imagecodecs with python39 works only with stdenv.cc.cc.lib, but then node14 doesn't. So they end up being kind of mutually exclusive in a single devbox. I can of course have multiple independent devbox to work around this. However, thinking out loud, these issues and the challenge in identifying/debugging them makes this nixos-based approach a bit less interesting/valuable. |
@aidigital @jpambrun thanks for reporting these. Apologies for the delay in acknowledging your messages; I'd been away for some family time over Thanksgiving here in the US. Will chat with others on the team about the glibc issue as well, and how to pursue a fix. |
Any updates? I've been bitten by this too. |
+1 on the above. I am really not sure if this is a combination of problems the use of venv within devbox and the fact that you use use a specific version of stdenv.cc.cc.lib and then some librady that relies on the cc.lib. A very common cse is Pandas nowdays! I have the following simple setup
But I still end up on
|
same here OSError: libstdc++.so.6: cannot open shared object file: No such file or directory |
@javapapo for me, installing python (either 3.10 or 3.12) from devbox, once I do update: this works if I |
added "export LD_LIBRARY_PATH=./.devbox/nix/profile/default/lib" , and it worked. {
"$schema": "https://raw.githubusercontent.com/jetpack-io/devbox/0.10.1/.schema/devbox.schema.json",
"packages": [
"[email protected]",
"[email protected]",
"github:NixOS/nixpkgs/nixos-23.05#stdenv.cc.cc.lib"
],
"env": {
"VENV_DIR": ".venv"
},
"shell": {
"init_hook": [
"export DEVBOX_DEBUG=1",
". $VENV_DIR/bin/activate",
"pip install -q -r requirements.txt",
"export LD_LIBRARY_PATH=./.devbox/nix/profile/default/lib"
],
"scripts": {
"test": [
"echo \"Error: no test specified\" && exit 1"
]
}
}
}
|
If you're using
|
had same issue as @bhavitsharma and did his fix. it worked well. tried to apply lib in override of UPDATE: in my case static linking could help i guess https://github.com/grpc/grpc/blob/dbaeee26111f954daeafcb94f9f4afa85dd12a6d/setup.py#L284 |
Setting LD_LIBRARY_PATH in The wrapper flake has the unfortunate downside of triggering a compile of python. This seems to be quite the slowdown, not great for sharing with a team. If there is a way to wrap things in a flake without a slowdown, that'd be interesting. For now, I've just created a shim that I link in the way of every binary potentially suffering from this issue.
|
So, the problem is the
// flake.nix
packages = {
poetry = poetry-wrapper;
};
|
This solution avoids all the nix LD_LIBRARY_PATH issues, and doesn't pollute the PATH with un-necessary libraries. |
According to #1276, this should be generally resolved, but the problem remains when using Poetry. I have created the repository https://github.com/az-wegift/devbox-numpy, where one can reproduce the issue with Poetry and see that the
@savil, could it be that the fix introduced in https://github.com/jetify-com/devbox/releases/tag/0.13.0 is missing for Poetry? |
Uh oh!
There was an error while loading. Please reload this page.
EDIT by @savil:
we resolved the immediate bug via being able to add
stdenv.cc.cc.lib
. However, the developer-UX here could be improved and this task is now tracking that:Original bug report:
Current Behavior (bug)
Most (python) packages won't suffer from the problem I'm describing below, but some will.
Still, I think the problem can be addressed by
devbox
.dagster
is a popular python framework, whose installation provides a package and a executable.What works:
dagster
can be installed with your python pip example in the venvimport dagster
works)What doesn't work:
libstdc++.so.6
.In my experience, not finding that library is a pretty common error that executables installed via
nix
run into.Expected Behavior (fix)
Why do I think this problem should be addressed by
devbox
?Imagine I didn't use
devbox
, and I had a globalpython
installation in/nix/store
.I can create a venv off of that global python, run
pip install dagster
in the venv, and I'd be in a similar place:import dagster
would work, but running the executable would fail.devbox
can be a step-up from that experience, and either fix or at least inform the user of the problem and suggest a solution.As a side note, the above scenario is how I currently do things, except that the global
python
which I create venvs from is fromasdf
, because doing that will allow thedagster
binary to work.Additional context
devbox.json
finding
libstdc++.so.6
on my systemThe text was updated successfully, but these errors were encountered: