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

Fix LD_LIBRARY_PATH issues on NixOS #179

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cydparser
Copy link

@cydparser cydparser commented Aug 3, 2023

I'm unable to use direnv with the flake provided by this repo on NixOS due to LD_LIBRARY_PATH being unset initially. Here is the output:

❯ rm -rf .direnv

❯ echo 'use flake -L github:alpmestan/ghc.nix' > .envrc
direnv: error /home/cyd/src/ghc/.envrc is blocked. Run `direnv allow` to approve its content

❯ echo $LD_LIBRARY_PATH


❯ direnv allow
direnv: loading /home/cyd/src/ghc/.envrc
direnv: using flake -L github:alpmestan/ghc.nix
trace: checking if /hadrian/hadrian.cabal is present:  no
[0/1 built] direnv: ([/nix/store/zchzkskbsrcimfslixzhy1mjn7zwxrxa-direnv-2.32.3/bin/direnv export zsh]) is taking a while to execute. Use CTRL-C to give up.
warning: Git tree '/home/cyd/src/ghc' is dirty
direnv: nix-direnv: renewed cache
/nix/store/8ksyipmh68wxmq3qdazkf3bccw786gpr-nix-direnv-2.3.0/share/nix-direnv/direnvrc:2057: LD_LIBRARY_PATH: unbound variable
direnv: error exit status 1

Additionally, LD_LIBRARY_PATH does not include a path to libstdc++, which causes some tests to fail.

@supersven
Copy link
Collaborator

Hey @cydparser ,

Could you please explain a bit which issue you're solving (error messages, etc.)?

@cydparser
Copy link
Author

The reason that direnv fails is due to my config enabling strict_env, which is supposed to be enabled by default at some point.

I've discovered another problem with LD_LIBRARY_PATH: it does not include a path to libstdc++.so.6, which causes tests like T11829 to fail.

@cydparser cydparser changed the title Fix direnv error when LD_LIBRARY_PATH is initially unset Fix LD_LIBRARY_PATH issues on NixOS Aug 6, 2023
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.

2 participants