forked from cachix/devenv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Injecting `LD_LIBRARY_PATH` to the Python runtime environment is great to bypass the need of having to patch non-nix binaries loaded into that environment, however it breaks down, when Python executes any other program not compiled for the given Nix system, e.g. a shell script via `subprocess`. To work this around, `devenv` could inject a `pth`[^1] file to the virtual environment it creates, to undo our changes, but it breaks down in the other ways. One example is `pre-commit` (when not using git-hooks.nix), which creates its own virtual environments, where our `pth` file change won't propagate to. The most durable solution is to just ~accept defeat~, use `patchelf` via the obscure `auto-patchelf`[^2] helper script which powers the `autoPatchelfHook` helper in `nixpkgs`. This is a bit more 'static' approach than what we had before, so any changes in packages will get patched only at the next `direnv` invocation. Fixes cachix#1111 [^1]: https://docs.python.org/3/library/site.html [^2]: https://github.com/NixOS/nixpkgs/blob/725bc5338587583da77f31afb55c41043bbf84df/pkgs/by-name/au/auto-patchelf/source/auto-patchelf.py
- Loading branch information
Showing
1 changed file
with
37 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters