Try to run stack solver on a machine that didn't know anything about haskell & cabal before you installed stack and ran stack setup. (In particular, there would not be any cabal in path.)
stack solver runs and does something useful -- more or less equivalent to sandboxed cabal installation.
There is no cabal executable. It was not installed by stack setup. But it is required by stack solver. So, stack solver does not run.
% stack solver
Using configuration file: stack.yaml
Using cabal packages:
- ./
Using resolver: lts-9.0
Executable named cabal not found on path: ["/home/kindaro/.stack/programs/x86_64-linux/ghc-ncurses6-8.0.2/bin","/home/kindaro/.stack/snapshots/x86_64-linux-ncurses6/lts-9.0/8.0.2/bin","/home/kindaro/.stack/compiler-tools/x86_64-linux-ncurses6/ghc-8.0.2/bin","/home/kindaro/.stack/programs/x86_64-linux/ghc-ncurses6-8.0.2/bin","/home/kindaro/.local/bin","/home/kindaro/.local/bin","/usr/local/sbin","/usr/local/bin","/usr/bin","/usr/bin/site_perl","/usr/bin/vendor_perl","/usr/bin/core_perl"]
% stack --version
Version 1.7.0, Git revision 2631803b9c502fa5225eac3536acda9d1d314aa7 (5619 commits) x86_64 hpack-0.20.0
ArchLinux AUR haskell-stack-git
A line suggesting to stack install cabal-install would be helpful.
@wiz Sounds good! Feel like opening a PR to encourage that?
IIRC there was some logic to automatically install cabal-install, but maybe I mis-remember.
I experienced this same issue yesterday, which made me take a peek into stack's internals.
From what I can tell, the line to suggest stack install cabal-install already exists, but I can't figure out why it's not being displayed.
run "stack solver" command
-> solverCmd
-> solveExtraDeps
-> solveResolverSpec
-> setupCabalEnv
-> getCabalInstallVersion
On unwrapping the Maybe context returned by getCabalInstallVersion:
Also, searching for the error string Executable named cabal not found on path (or parts thereof) yield no results.
@mgsloan I'd be happy to take this on, but being a Haskell scrub I'll unfortunately need a bit of hand-holding 馃槥.
EDIT: I've just noticed that this issue has not been tagged "newcomer friendly", so perhaps I shouldn't be attempting this.
@adrianwong Great! This seems like a newcomer friendly issue to me, so please do give it a try.
I suspect that the error message is coming from https://github.com/commercialhaskell/rio , and probably this logic is not working after the extraction of rio from the stack codebase.
Most helpful comment
A line suggesting to
stack install cabal-installwould be helpful.