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

Can't run stack solver on NixOS due to not finding cabal-install #4818

Closed
SomeDer opened this issue May 12, 2019 · 1 comment
Closed

Can't run stack solver on NixOS due to not finding cabal-install #4818

SomeDer opened this issue May 12, 2019 · 1 comment

Comments

@SomeDer
Copy link

SomeDer commented May 12, 2019

Steps to reproduce

  1. Install stack on NixOS
  2. Run stack solver in a new project

What happened

$ stack solver --verbose
1.9.3 x86_64 hpack-0.31.2
2019-05-12 10:31:13.708892: [debug] Checking for project config at: /home/me/a/stack.yaml
2019-05-12 10:31:13.709154: [debug] Loading project config file stack.yaml
2019-05-12 10:31:13.711307: [debug] PATH is: Just "/nix/store/drazdzxpps2arpqg6apbalm3sn0zbwd3-kitty-0.13.3/bin:/nix/store/fx3ck31fsq2mhs3fm558yqn4jf0c8mkm-imagemagick-6.9.9-34/bin:/nix/store/14azcfykizvgyh0ivll671hprfr0w3p3-xsel-unstable-2018-01-10/bin:/home/me/bin:/run/wrappers/bin:/home/me/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/etc/profiles/per-user/me/bin:/home/me/.local/bin:/home/me/.local/bin"
2019-05-12 10:31:13.711421: [debug] Using a nix-shell environment with nix packages: haskell.compiler.ghc864, git, gcc, gmp
2019-05-12 10:31:13.712212: [debug] Run process: /run/current-system/sw/bin/nix-shell --pure -E "with (import <nixpkgs> {}); let inputs = [haskell.compiler.ghc864 git gcc gmp]; libPath = lib.makeLibraryPath inputs; stackExtraArgs = lib.concatMap (pkg: [ ''--extra-lib-dirs=${lib.getLib pkg}/lib''   ''--extra-include-dirs=${lib.getDev pkg}/include'' ]) inputs; in runCommand ''myEnv'' { buildInputs = lib.optional stdenv.isLinux glibcLocales ++ inputs; STACK_PLATFORM_VARIANT=''nix''; STACK_IN_NIX_SHELL=1; LD_LIBRARY_PATH = libPath;STACK_IN_NIX_EXTRA_ARGS = stackExtraArgs; } \"\"" --run "'/nix/store/7iadhfqpw2rpplpf36p5wyrbwcl48fxc-stack-1.9.3/bin/stack' $STACK_IN_NIX_EXTRA_ARGS '--internal-re-exec-version=1.9.3' 'solver' '--verbose'"
1.9.3 x86_64 hpack-0.31.2
2019-05-12 10:31:15.066727: [debug] Checking for project config at: /home/me/a/stack.yaml
2019-05-12 10:31:15.066969: [debug] Loading project config file stack.yaml
2019-05-12 10:31:15.069384: [debug] Getting system compiler version
2019-05-12 10:31:15.069599: [debug] Run process: /nix/store/wfgrz42bpcl1r635dasfk7r236hm83az-ghc-8.6.4/bin/ghc --info
2019-05-12 10:31:15.136778: [debug] Process finished in 67ms: /nix/store/wfgrz42bpcl1r635dasfk7r236hm83az-ghc-8.6.4/bin/ghc --info
2019-05-12 10:31:15.138469: [debug] Getting global package database location
2019-05-12 10:31:15.138715: [debug] Run process: /nix/store/wfgrz42bpcl1r635dasfk7r236hm83az-ghc-8.6.4/bin/ghc-pkg --no-user-package-db list --global
2019-05-12 10:31:15.139786: [debug] Asking GHC for its version
2019-05-12 10:31:15.140117: [debug] Run process: /nix/store/wfgrz42bpcl1r635dasfk7r236hm83az-ghc-8.6.4/bin/ghc --numeric-version
2019-05-12 10:31:15.140725: [debug] Getting Cabal package version
2019-05-12 10:31:15.140815: [debug] Run process: /nix/store/wfgrz42bpcl1r635dasfk7r236hm83az-ghc-8.6.4/bin/ghc-pkg --no-user-package-db field --simple-output Cabal version
2019-05-12 10:31:15.177137: [debug] Process finished in 38ms: /nix/store/wfgrz42bpcl1r635dasfk7r236hm83az-ghc-8.6.4/bin/ghc-pkg --no-user-package-db list --global
2019-05-12 10:31:15.177686: [debug] Process finished in 37ms: /nix/store/wfgrz42bpcl1r635dasfk7r236hm83az-ghc-8.6.4/bin/ghc-pkg --no-user-package-db field --simple-output Cabal version
2019-05-12 10:31:15.185811: [debug] Process finished in 46ms: /nix/store/wfgrz42bpcl1r635dasfk7r236hm83az-ghc-8.6.4/bin/ghc --numeric-version
2019-05-12 10:31:15.185913: [debug] GHC version is: ghc-8.6.4
2019-05-12 10:31:15.186050: [debug] Resolving package entries
2019-05-12 10:31:15.186558: [debug] Trying to decode /home/me/.stack/loaded-snapshot-cache/x86_64-linux-nix/ghc-8.6.4/ghc-8.6.4.cache
2019-05-12 10:31:15.186912: [debug] Success decoding /home/me/.stack/loaded-snapshot-cache/x86_64-linux-nix/ghc-8.6.4/ghc-8.6.4.cache
2019-05-12 10:31:15.187952: [debug] Starting to execute command inside EnvConfig
2019-05-12 10:31:15.188083: [info] Using configuration file: stack.yaml
2019-05-12 10:31:15.188248: [debug] Running hpack on /home/me/a/package.yaml
2019-05-12 10:31:15.192102: [debug] hpack output unchanged in /home/me/a/a.cabal
2019-05-12 10:31:15.198787: [info] Using cabal packages:
2019-05-12 10:31:15.198889: [info] - ./

2019-05-12 10:31:15.198991: [debug] Getting system compiler version
2019-05-12 10:31:15.199451: [debug] Run process: /nix/store/wfgrz42bpcl1r635dasfk7r236hm83az-ghc-8.6.4/bin/ghc --info
2019-05-12 10:31:15.267811: [debug] Process finished in 68ms: /nix/store/wfgrz42bpcl1r635dasfk7r236hm83az-ghc-8.6.4/bin/ghc --info
Solver requires that cabal be on your PATH
Try running 'stack install cabal-install'

Stack version

$ stack --version                                                             
1.9.3 x86_64 hpack-0.31.2

Method of installation

Installed stack from nixpkgs

Comments

cabal is installed:

$ cabal --version                                                                                   
cabal-install version 2.4.1.0
compiled using version 2.4.1.0 of the Cabal library
@qrilka
Copy link
Contributor

qrilka commented May 12, 2019

As it was said in #4410 solver was not check/updated for versions of cabal-install newer than 1.24 so it was removed from master. I think we should close this one as WONTFIX.
Regarding your listing of cabal --version @SomeDer - locally installed cabal-install won't get used by default as Nix mode is pure by default (see the --pure flag in the log you posted). You could try working around that either by using impure nix mode (e.g. with --no-nix-pure) or by adding cabal-install into nix packages or your project. But as I've said - solver was tested to work only with cabal-install-1.24 so I'm not sure if it's worth trying those out.

@SomeDer SomeDer closed this as completed May 13, 2019
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

No branches or pull requests

2 participants