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

Apply `--ghc-options` in stack ghci even when no packages get loaded #2199

Closed
mgsloan opened this Issue May 27, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@mgsloan
Collaborator

mgsloan commented May 27, 2016

Via #haskell-stack, @chreekat just ran into a case where stack ghci --ghc-options ".." did not behave as expected. Namely, since this was run with the package-less global project, --ghc-options does not get applied to anything. We have a couple options for dealing with this:

  • Apply CLI --ghc-options even if there are no local package targets. This is the approach I prefer.
  • Warn when --ghc-options aren't getting applied to anything. This would actually be a good enhancement independently of ghci.

If both of these actions are taken, then we should make sure that stack ghci --ghc-options doesen't warn about --ghc-options not being applied.

@chreekat

This comment has been minimized.

Contributor

chreekat commented May 27, 2016

I also feel like this could also be improved with documentation somehow, since I didn't grasp that --ghc-options and --ghci-options could ever both be useful at the same time. Maybe:

--ghc-options OPTION       Additional options passed to GHC when building the project,
                           before launching the interpreter. See --ghci-options.

I know that's a global option though, so I'm not sure if the helpdoc can be tweaked when running stack ghci --help.

@mgsloan

This comment has been minimized.

Collaborator

mgsloan commented May 27, 2016

Yeah, it'd be tough to do conditional option docs like that. I think I'd prefer to address the root cause and just have --ghc-options always apply to ghci. For the very rare case where that would cause issues, the user can always perform a stack build --ghc-options ... followed by a stack ghci --no-build ...

@chreekat

This comment has been minimized.

Contributor

chreekat commented May 27, 2016

Yeah, to be clear I like your proposed solutions.

mgsloan added a commit that referenced this issue Oct 18, 2016

@mgsloan

This comment has been minimized.

Collaborator

mgsloan commented Oct 18, 2016

Easy fix! stack ghci will now use --ghc-options.

@mgsloan

This comment has been minimized.

Collaborator

mgsloan commented Oct 19, 2016

I have actually resolved this a different, better way, which is to no longer take all of the CLI build options with stack ghci.

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