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

test: ensure apt *and* python c extensions work properly #1103

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iloveitaly
Copy link
Contributor

I ran into a tricky problem:

  • I have a py project
  • The project has to execute a system command, notably apt in this case
  • stdenv.cc.cc.lib is required for numpy to work, but it breaks apt (and, more importantly, I'm assuming many other system commands) with the following error:
0.110 nix-env: /nix/store/02mqs1by2vab9yzw0qc4j7463w78p3ps-glibc-2.37-8/lib/libc.so.6: version `GLIBC_2.38' not found (required by nix-env)

This error can be fixed by reverting the mutated LD_LIBRARY_PATH from:

LD_LIBRARY_PATH=/nix/store/cq3kvw7kwz2n9c13fg6qaaj23mkm116l-gcc-12.3.0-lib/lib:/nix/store/wzm0753byf1app0xrsa97hjnfk9m1zs0-zlib-1.3/lib:/usr/lib

to:

LD_LIBRARY_PATH=/usr/lib

Did some research:

I'm new to nix. It seems like creating a bespoke shell env with LD modified is the way to go, but that wouldn't actually solve this issue since
LD_LIBRARY_PATH would be inherited by the py process and therefore passed to the shell (unless the modified LD only applies to package installation, but I'm confident that would work either.

In any case, I'm curious what folks think here. I added a failing test to work off of, but unsure of the best solution.

Docker container success assertion

In investigating this, I found that the docker container execution is not asserted to be successful. This feels like a good change
to make for all containers to avoid swallowing otherwise important errors.

@coffee-cup
Copy link
Contributor

Hey, thanks for these PRs! Just commented to let you know we haven't forgotten about these will get them reviewed and merged hopefully by the end of the week.

@coffee-cup
Copy link
Contributor

Hmm this is an interesting problem. Nixpacks users have had their fair share of GLIBC errors. The problem seems to be a mismatch between the glibc version installed in Ubuntu and used by the system packages and the glibc version installed and used by the Python Nix package. I'm not sure what the best step forward here would be. I'm not super comfortable globally modifying the LD_LIBRARY_PATH variable to not include any of the Nix packages. If possible I think we should update the Ubuntu glibc version or have an configuration option to reset the LD_LIBRARY_PATH variable.

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

Successfully merging this pull request may close these issues.

None yet

2 participants