-
Notifications
You must be signed in to change notification settings - Fork 332
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
Python language enable breaks devenv #555
Comments
We just merged a fix in the master, can you try |
@domenkozar: I'm still experiencing the same issue with this
|
What if you delete |
Unfortunately I get the exact same error. |
What OS/distro? |
I'm using NixOS unstable. Here is the When copying the |
This seemed very similar to the error that #552 attempted to solve. I tried to reproduce this by cloning the gist, but I it worked fine here. I also tried to place a failing python binary into As a response to this issue I thought it might be nice to debug such issues more in-depth: #556 |
@bobvanderlinden: Thanks for trying to replicate.If you cannot then it might be a problem on my end rather than with devenv. I've added your PR in my |
As a hunch I've tried specifying |
Oo nice, thanks! Good to have a concrete test-case for the PR as well 😄👍 From the Gist it seems that devenv is correctly creating a shell and exiting with 0. Does it only go wrong when calling |
It goes wrong when calling |
What is the output of the following?
|
Here is the result:
|
Hmm, so devenv does supply the correct python version, but it is built against an incompatible glibc version? Just calling I have the same
It is strange that your error mentions @domenkozar any idea? |
If I
My { pkgs, ... }:
{
env.GREET = "devenv";
packages = [
pkgs.git
pkgs.gcc-unwrapped.lib
];
languages.python.enable = true;
languages.python.package = pkgs.python311;
languages.python.venv.enable = true;
} And {
"nodes": {
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1682674748,
"narHash": "sha256-HQTp0U+OAlbH8Q7WBZglVA09mRNectkM17NZs4ebW3A=",
"owner": "cachix",
"repo": "devenv",
"rev": "971ca55b91f3f326b7067ec92345e4527fc01805",
"type": "github"
},
"original": {
"dir": "src/modules",
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1660459072,
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1682526928,
"narHash": "sha256-2cKh4O6t1rQ8Ok+v16URynmb0rV7oZPEbXkU0owNLQs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d6b863fd9b7bb962e6f9fdf292419a775e772891",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1678872516,
"narHash": "sha256-/E1YwtMtFAu2KUQKV/1+KFuReYPANM2Rzehk84VxVoc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9b8e5abb18324c7fe9f07cb100c3cd4a29cda8b8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-22.11",
"repo": "nixpkgs",
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1682596858,
"narHash": "sha256-Hf9XVpqaGqe/4oDGr30W8HlsWvJXtMsEPHDqHZA6dDg=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "fb58866e20af98779017134319b5663b8215d912",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks"
}
}
},
"root": "root",
"version": 7
} |
I think this is because Always setting @tfmoraes or @jocelynthode could you try:
If that works, should we remove devenv/src/modules/mkNakedShell.nix Line 102 in 971ca55
This might also be related to #507, as mkShell doesn't set |
It worked @bobvanderlinden: ❯ devenv info
/nix/store/b38iyffa5xsd26id1400b404c29p3s7d-nix-2.12.0pre20230216_7c91803/bin/nix: /nix/store/76l4v99sk83ylfwkz8wmwrm4s8h73rhd-glibc-2.35-224/lib/libc.so.6: version `GLIBC_2.36' not found (required by /nix/store/mm1zi7zaawqi6rahnf6ssarlq0dc9wln-devenv-profile/lib/libstdc++.so.6)
/nix/store/b38iyffa5xsd26id1400b404c29p3s7d-nix-2.12.0pre20230216_7c91803/bin/nix: /nix/store/76l4v99sk83ylfwkz8wmwrm4s8h73rhd-glibc-2.35-224/lib/libc.so.6: version `GLIBC_2.36' not found (required by /nix/store/mm1zi7zaawqi6rahnf6ssarlq0dc9wln-devenv-profile/lib/libcurl.so.4)
/nix/store/b38iyffa5xsd26id1400b404c29p3s7d-nix-2.12.0pre20230216_7c91803/bin/nix: /nix/store/76l4v99sk83ylfwkz8wmwrm4s8h73rhd-glibc-2.35-224/lib/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by /nix/store/1nyg1fvhpz8bx3vn3r9f18zhra2rpbx9-glibc-2.37-8/lib/libresolv.so.2)
❯ set -e LD_LIBRARY_PATH # because I'm on fish shell
❯ devenv info
Inputs:
├───devenv: github:cachix/devenv/971ca55b91f3f326b7067ec92345e4527fc01805?dir=src%2fmodules
├───nixpkgs: github:NixOS/nixpkgs/d6b863fd9b7bb962e6f9fdf292419a775e772891
└───pre-commit-hooks: github:cachix/pre-commit-hooks.nix/fb58866e20af98779017134319b5663b8215d912
├───flake-compat: github:edolstra/flake-compat/35bb57c0c8d8b62bbfd284272c928ceb64ddbde9
├───flake-utils: github:numtide/flake-utils/5aed5285a952e0b949eb3ba02c12fa4fcfef535f
├───gitignore: github:hercules-ci/gitignore.nix/a20de23b925fd8264fd7fad6454652e142fd7f73
│ └───nixpkgs follows input 'pre-commit-hooks/nixpkgs'
├───nixpkgs follows input 'nixpkgs'
└───nixpkgs-stable: github:NixOS/nixpkgs/9b8e5abb18324c7fe9f07cb100c3cd4a29cda8b8
# env
- DEVENV_DOTFILE: /home/thiago/tmp/mandible_segmentation/.devenv
- DEVENV_PROFILE: /nix/store/mm1zi7zaawqi6rahnf6ssarlq0dc9wln-devenv-profile
- DEVENV_ROOT: /home/thiago/tmp/mandible_segmentation
- DEVENV_STATE: /home/thiago/tmp/mandible_segmentation/.devenv/state
- GREET: devenv
- PYTHONPATH: $DEVENV_PROFILE/lib/python3.11/site-packages
# packages
- python3-3.11.3
... But there is a problem here. If LD_LIBRARY_PATH is not set how |
Nice 👍 See also #507 That said, even if you explicitly define The underlying problem is that poetry (or other package managers) download prebuilt binaries. These are not always suited for your system (built against a different glibc version for instance). Building them from source is safer, but requires more buildtools to be available in the shell environment. I'm experimenting with integrating poetry2nix into devenv. It has the right approach and builds everything from source. It however often requires more fiddling than with just poetry. |
I can also confirm that by unsetting |
Any idea on how we could fix this issue in a less hackish way? |
#507 will be helpful for that. Alternatively, removing devenv/src/modules/mkNakedShell.nix Line 103 in c388b8c
Both solutions will cause problems for people relying on LD_LIBRARY_PATH being set unfortunately. |
Similar issue happens if you add |
Wrap |
I think you'll still run into issues where other applications will still break. For instance if you use
For python I think the most stable option is to use poetry2nix. There, every python package will be built inside Nix instead of using a prebuilt binary. Packages with native dependencies will directly link to the Nix store path that way. It won't interfere with system-wide packages/binaries/libraries. |
I was thinking other way to fix this:
|
I have seen this happen on my machine (Fedora 38) when I tried to run a newer
So we could maybe remove any other |
https://twitter.com/domenkozar/status/1689213491628969985
Currently our best bet is to provide manylinux wheel for python and make it extendable. |
From what I gathered, it is possible to force pip/poetry to build the bindings from source. When doing so we do not need to rely on finding .so at runtime, but we do need to make sure to rebuild all packages when something relevant in the environment changes. Not totally sure though. Poetry2nix does sound like the most stable solution, but it needs quite a bit of UX work to actually use it. |
Maybe this can be used https://github.com/GuillaumeDesforges/fix-python |
I think this will be fixed when:
|
This is finally fixed in 1.0, great work everyone :) |
Describe the bug
When activating
languages.python.enable = true
devenv up
returnsInstalling glibc via devenv just results in a core dump.
This is probably because the python version from the
languages
overrides my system python.Not sure how I could still have devenv working while having python enabled
To reproduce
https://gist.github.com/jocelynthode/f97bc7a966d4e19ca50fc1ee4551d014
Version
devenv: 0.6.2
The text was updated successfully, but these errors were encountered: