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:
stack ghci --ghc-options ".."
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.
stack ghci --ghc-options
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.
stack ghci --help
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 ...
stack build --ghc-options ...
stack ghci --no-build ...
Yeah, to be clear I like your proposed solutions.
Have "stack ghci" use --ghc-options #2199
Easy fix! stack ghci will now use --ghc-options.
No longer use build options with ghci #2199
I have actually resolved this a different, better way, which is to no longer take all of the CLI build options with stack ghci.