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

stack script should allow setting ghc-options #3454

Closed
mgsloan opened this issue Sep 25, 2017 · 3 comments
Closed

stack script should allow setting ghc-options #3454

mgsloan opened this issue Sep 25, 2017 · 3 comments

Comments

@mgsloan
Copy link
Contributor

mgsloan commented Sep 25, 2017

Currently, stack script only allows specifying arguments to the user's program, not to the ghc invocation. Should probably use --ghc-arg as described in https://downloads.haskell.org/~ghc/master/users-guide/runghc.html , rather than passing the arguments directly. I suggest adding the following:

  • --ghc-options, which works just like the argument to build
  • --ghc-arg, which allows passing it to just the script command's ghc invocation.
@danieledapo
Copy link
Contributor

@mgsloan if nobody has taken this yet, I can work on it.

I'm not sure I understand what would be the difference between --ghc-options and --ghc-arg though. My understanding is:

  • stack script --resolver lts-9.2 --ghc-options -threaded -v5 would be roughly equivalent to runghc -v5 foo;
  • stack script --resolver lts-9.2 --ghc-arg -v5 foo would be roughly equivalent to runghc --ghc-arg -v5 foo.

but I'm not sure that's 100% right.

@mgsloan
Copy link
Contributor Author

mgsloan commented Oct 26, 2017

@d-dorazio Awesome! Sorry for the delay in getting back to you on clarification.

I've thought about this a bit more, and actually I don't think it makes sense to allow providing ghc options for use when building packages (this is what I intended --ghc-options to be). So, this means no need to make up a new flag name (--ghc-arg).

So I think a better design is to make --ghc-options get passed to the ghc invocation. So, stack script --resolver lts-9.2 --ghc-options "-threaded -v5" would do something like runghc --ghc-arg "-v5 foo";

@dbaynard
Copy link
Contributor

dbaynard commented Dec 4, 2018

Closing due to #3519

@dbaynard dbaynard closed this as completed Dec 4, 2018
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

3 participants