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

Simple commands should work without ghc installed #4390

Closed
sschuberth opened this issue Nov 7, 2018 · 6 comments · Fixed by #4632
Closed

Simple commands should work without ghc installed #4390

sschuberth opened this issue Nov 7, 2018 · 6 comments · Fixed by #4632

Comments

@sschuberth
Copy link

sschuberth commented Nov 7, 2018

I believe several stack sub-command like dot and ls dependencies should work without ghc installed; after all, these commands do not require compiling anything.

What I see instead when running stack --no-install-ghc --skip-ghc-check dot --external on this example project is that stack complains with

No compiler found, expected minor version match with ghc-8.2.2 (x86_64) (based on resolver setting in quickcheck-state-machine\example\stack.yaml).
To install the correct GHC into C:\Users\<name>\AppData\Local\Programs\stack\x86_64-windows\, try running "stack setup" or use the "--install-ghc" flag.

As can bee seen above, I was trying to work around that issue by specifying --no-install-ghc --skip-ghc-check, but stack is checking for ghc nonetheless.

This issue seems to be somewhat related to #4181 where even a simple clean tries to bootstrap all of ghc.

Background: We use the OSS Review Toolkit to inspect Haskell project dependencies without building them. Right now, we still need to provide ghc, wasting time & space.

@sschuberth sschuberth changed the title Simple commands should work withouot ghc installed Simple commands should work without ghc installed Nov 7, 2018
@dbaynard
Copy link
Contributor

dbaynard commented Nov 7, 2018

There's #4268 for clean, which should be ready soon.

Which commands have you encountered, then? Just the following?

  • dot
  • ls dependencies

@sschuberth
Copy link
Author

These two sub-commands are the ones I'd personally need to work without ghc installed, but I guess there's more.

I wonder whether a good first step to generically work around the issue is to make --no-install-ghc --skip-ghc-check actually work. These should work anyway.

As a second step, the real fix should be that sub-command which don't require ghc can actually be called without --no-install-ghc --skip-ghc-check.

@dbaynard
Copy link
Contributor

dbaynard commented Nov 7, 2018

So the bug (which I have not confirmed) would be for --no-install-ghc --skip-ghc-check.

The enhancement is for the subcommands.

@dbaynard
Copy link
Contributor

@waddlaw (who implemented this for stack clean) is going to give this a go!

snoyberg added a commit that referenced this issue Mar 18, 2019
snoyberg added a commit that referenced this issue Mar 18, 2019
This flag allows us to bypass the need for an installation of GHC for
these commands, at the cost of not getting completely accurate
information on packages that ship with GHC.

* Fixes #4390
* Closes #4405
@sschuberth
Copy link
Author

Thanks @snoyberg for implementing this! Is there a way to try this feature out immediately without waiting for a new release? E.g. by running https://github.com/commercialhaskell/stack/blob/master/etc/scripts/get-stack.sh from master instead of from https://get.haskellstack.org/?

@snoyberg
Copy link
Contributor

You should be able to run stack upgrade --git.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants