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

Should stack build automatically install the needed ghc? #215

Closed
DanBurton opened this issue Jun 9, 2015 · 9 comments
Closed

Should stack build automatically install the needed ghc? #215

DanBurton opened this issue Jun 9, 2015 · 9 comments
Milestone

Comments

@DanBurton
Copy link
Contributor

Or should it simply suggest that you run stack setup in order to do that? I think we agree that the stack build --auto-setup flag should exist, we just need to discuss whether the default for it should be on or off.

@snoyberg
Copy link
Contributor

snoyberg commented Jun 9, 2015

Relevant flags that already exist:

  --system-ghc             Enable using the system installed GHC (on the PATH)
                           if available and a matching version
  --no-system-ghc          Disable using the system installed GHC (on the PATH)
                           if available and a matching version
  --install-ghc            Enable downloading and installing GHC if necessary
                           (can be done manually with stack setup)
  --no-install-ghc         Disable downloading and installing GHC if necessary
                           (can be done manually with stack setup)

On top of having these flags, I think we should allow the config file to set their default value, so that a user could say globally "yes, I'd like to install GHC automatically" or "no, I wouldn't."

@snoyberg snoyberg added this to the Third release milestone Jun 9, 2015
@DanBurton
Copy link
Contributor Author

Here's a copy/paste of the relevant chat:

Emanuel Borsboom [9:22 PM] 
Hmm, looks like `stack build` now installs GHC automatically instead of telling me
to run `stack setup`.  So maybe I should change docker to auto-pull by default again.

Michael Snoyman [9:22 PM] 
It's probably worth an issue to track that question

Michael Snoyman [9:23 PM]
I'm not convinced that I made the right decision about the default behavior

Michael Snoyman [9:23 PM]
In any event, the default should probably be controlled via the config file

Dan Burton [9:23 PM] 
Maybe it should prompt instead of being automatic, and skip the prompt if
it gets a certain flag or config value.

Emanuel Borsboom [9:24 PM] 
@danburton That is the current behaviour.

Emanuel Borsboom [9:24 PM]
Well, not quite.  It just tells you to run `stack docker pull` rather than prompting.

Michael Snoyman [9:24 PM] 
I don't think prompting is better than telling the user to just run `stack setup`

Dan Burton [9:24 PM] 
I mean for ghc

Emanuel Borsboom [9:24 PM] 
I agree, in a CLI tool I don't want prompting.

Emanuel Borsboom [9:24 PM]
(unless I explicitly ask for it, like `git add -p`)

Dan Burton [9:25 PM] 
Prompting is more of a newbie-oriented thing, I think. It's gentler than asking them to
run another command.

Dan Burton [9:26 PM]
But I see what you're saying. It's really isn't *that* much different than
"try running this command".

Dan Burton [9:27 PM]
So I think I'd prefer the default of `stack build` to be _not_ automatically setting up.

Michael Snoyman [9:27 PM] 
The other side of the coin here is: prompting causes for ugliness when automating things

Emanuel Borsboom [9:27 PM] 
Alright, signed OS X binary is uploaded.

Dan Burton [9:28 PM] 
We could have `stack build --auto-setup` for automation

Michael Snoyman [9:28 PM] 
We already have the flag, it's just on by default instead of off

Dan Burton [9:29 PM] 
Cool. I say turn it off. It just seems jarring that if I change the `resolver` to
the new LTS, it might suddenly download a new ghc for me.

@gregwebs
Copy link
Contributor

gregwebs commented Jun 9, 2015

I may just need to adjust my PATH, and I could be on a bad network (cell phone WiFi, etc) so I think it is best to not install ghc by default but just tell the user what they can type to make that happen.

@mboes
Copy link
Contributor

mboes commented Jun 9, 2015

I may just need to adjust my PATH, and I could be on a bad network (cell phone WiFi, etc) so I think it is best to not install ghc by default

👍

@3noch
Copy link
Member

3noch commented Jun 10, 2015

Is there a way to specify which GHC arch is needed?

@snoyberg
Copy link
Contributor

I think the verdict is pretty clearly that we shouldn't download by default. Let's make that change, together with a config file option.

@3noch Not right now. I'm guessing you're asking regarding Windows 32-bit vs 64-bit? At @ndmitchell's recommendation, I've been avoiding 64-bit whenever possible, including in Stack.Setup (look in there for a comment about this). I don't mind making it an option to use 64-bit, but I think we have the right default currently.

snoyberg added a commit that referenced this issue Jun 10, 2015
Changes default behavior to not install GHC automatically. See: #215 #238
@snoyberg
Copy link
Contributor

Alright, default changed and install-ghc config option added. I'm going to consider this closed. If I missed something, speak up :)

@3noch
Copy link
Member

3noch commented Jun 10, 2015

@snoyberg I see the comment! I have not had any troubles with 64-bit GHC on Windows, but my use-case is pretty light. Where/how can I start the discussion to get 64-bit Windows back?

@snoyberg
Copy link
Contributor

Just open another issue and let's discuss. I'm in favor of doing it, we
just need to figure out the right defaults and ui for overriding them.

On Wed, Jun 10, 2015, 4:12 PM Elliot Cameron [email protected]
wrote:

@snoyberg https://github.com/snoyberg I see the comment! I have not had
any troubles with 64-bit GHC on Windows, but my use-case is pretty light.
Where/how can I start the discussion to get 64-bit Windows back?


Reply to this email directly or view it on GitHub
#215 (comment)
.

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

No branches or pull requests

5 participants