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

`--ghc-options` only takes a single option #3315

Closed
mgsloan opened this issue Aug 6, 2017 · 6 comments

Comments

Projects
None yet
5 participants
@mgsloan
Copy link
Collaborator

commented Aug 6, 2017

From the comment here #758 (comment) :

$ stack ghci --ghc-options="-ddump-simpl -dsuppress-idinfo"
Configuring GHCi with the following packages:
GHCi, version 8.0.2: http://www.haskell.org/ghc/  :? for help
ghc.EXE: unrecognised flag: -ddump-simpl -dsuppress-idinfo

Usage: For basic information, try the `--help' option.

Curiously, the documentation on the argsOption function that handles this mentions --ghc-options, but it isn't currently used:

-- | An option which accepts a list of arguments e.g. @--ghc-options="-X P.hs \"this\""@.
argsOption :: O.Mod O.OptionFields [String] -> O.Parser [String]

Fix is to use this for ghc-options and make sure it's also used for other similar options fields

mgsloan added a commit that referenced this issue Aug 6, 2017

mgsloan added a commit that referenced this issue Aug 6, 2017

mgsloan added a commit that referenced this issue Aug 7, 2017

decentral1se added a commit that referenced this issue Aug 7, 2017

mgsloan added a commit that referenced this issue Aug 7, 2017

Merge pull request #3316 from commercialhaskell/multiword-ghc-options
Make --ghc-options and --ghcjs-boot-options take multiple args #3315
@decentral1se

This comment has been minimized.

Copy link
Member

commented Aug 7, 2017

Done in 9e2bd40.

@mgsloan

This comment has been minimized.

Copy link
Collaborator Author

commented Oct 23, 2017

Re-opening this. Here's what happened:

  • The fix broke another usecase - #3353

  • We want to do a release soon.

  • I don't want to try implementing any complex solution this close to release, so I reverted the fix to this.

Note that any future fix to this should also consider the usecase in #3353. It is also worthwhile to take a look at how ghc-options and ghcjs-options work in the stack configuration, and have it be consistent with the CLI in its parsing.

@mgsloan mgsloan reopened this Oct 23, 2017

mgsloan added a commit that referenced this issue Oct 23, 2017

@sclausen

This comment has been minimized.

Copy link

commented Jan 30, 2018

@mgsloan I would be glad, if you could tell, what the status of this is.

@mgsloan

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 30, 2018

@sclausen I think the proper steps forward were in the other issue #3353 (comment) . Copying what I said there:

Actually, I think that this was never a problem for configure-options, just an issue when invoking ghci directly with multi-ghc-options. I noticed that the configuration parsing code for stack.yaml uses argument parsing for "ghc-options", when it probably shouldn't. So, steps would be:

  • Use parseArgs for options passed to ghci
  • Remove use of parseArgs for --ghc-options in cli and ghc-options: in config

Also, some stuff to make sure this doesn't regress:

  • Add tests for mutltiword options that both build and invoke ghc ( tswelsh@9832fd9 + more)
  • Add tests for multiword options that include RTS options.

@mgsloan mgsloan added this to the P1: Must milestone Jan 30, 2018

@sclausen

This comment has been minimized.

Copy link

commented Jan 30, 2018

@mgsloan thanks for the quick answer!

snoyberg added a commit that referenced this issue Apr 16, 2019

@snoyberg

This comment has been minimized.

Copy link
Contributor

commented Apr 16, 2019

See #4747

@snoyberg snoyberg closed this in 073ed3f Apr 16, 2019

snoyberg added a commit that referenced this issue Apr 16, 2019

Merge pull request #4747 from commercialhaskell/3315-ghci-multi-options
stack ghci --ghc-options multi args (fixes #3315)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.