Open freeman42x opened 5 years ago
@nh2 does anything spring to mind, here?
@razvan-flavius-panda I don't quite remember all the internal details of Stack invocation with Nix but the main thing is that Stack reexecutes itself with needed dependencies set up by a nix-shell
. In your log I see that 2nd invocation doesn't see that it gets reexecuted so it tries to go 1 more level deeper and fails because of a different $PATH in pure nix-shell session. Probably something in your code breaks this Stack mechanism e.g. by unsetting $STACK_IN_NIX_SHELL.
Hi ! I'm trying to have the haskell tools installed and working same problem with context and actions:
curl https://get-ghcup.haskell.org -sSf | sh
curl -sSL https://get.haskellstack.org/ | sh
source ~/.ghcup/env
to ~/.zshrc
and here are my logs:
$> stack build --verbose
Version 2.1.3, Git revision 0fa51b9925decd937e4a993ad90cb686f88fa282 (7739 commits) x86_64 hpack-0.31.2
2019-09-01 11:11:54.939215: [debug] Checking for project config at: /Users/pierremardon/Haskell/hahp/stack.yaml
2019-09-01 11:11:54.939751: [debug] Loading project config file stack.yaml
2019-09-01 11:11:54.944505: [debug] SELECT COUNT(*) FROM "last_performed" WHERE ("action"=?) AND ("timestamp">=?); [PersistInt64 1,PersistUTCTime 2019-08-31 09:11:54.944433 UTC]
2019-09-01 11:11:54.945328: [debug] Using package location completions from a lock file
2019-09-01 11:11:55.059375: [debug] PATH is: Just "/Users/pierremardon/.cabal/bin:/Users/pierremardon/.ghcup/bin:/Users/pierremardon/Library/Python/3.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
2019-09-01 11:11:55.059440: [debug] Using a nix-shell environment with nix packages: blas, haskellPackages.hmatrix, openblasCompat, liblapack, haskell.compiler.ghc802, git, gcc, gmp
2019-09-01 11:11:55.065817: [error] Executable named nix-shell not found on path: ["/Users/pierremardon/.cabal/bin","/Users/pierremardon/.ghcup/bin","/Users/pierremardon/Library/Python/3.7/bin","/usr/local/bin","/usr/bin","/bin","/usr/sbin","/sbin"]
EDIT: I'm a total beginner in haskell's world and have no clue for now how an env variable could be overwritten. I tried with sh
btw, and have the exact same result.
@PierreMardon your case looks to be different from what the orginal poster has. Regarding your log it would be good to answer some questions: what's the stack.yaml
you're using? Do you use system GHC option with Stack (otherwise ghcup
looks to be superfluous as Stack by default manages GHC installation by itself)? It looks like you enable Nix mode in Stack, isn't it? Is nix-shell
available by default in your $PATH?
I add the same problem, just in case someone stumbles upon this issue.
You should add the --no-nix
flag to your stack command if invoking stack within --pure
nix-shell.
Also, you probably have to add the --system-ghc
flag to your stack command, to tell it to take ghc from the nix-shell.
Steps to reproduce
stack build
in project rootExpected
Build to succeed.
Actual
What actually happened.
Stack version
Method of installation
Installed via Nix
Other details
If I set in the
stack.yaml
file:pure: false
then the build fails with the issue mentioned in: https://github.com/commercialhaskell/stack/issues/5008