-
Notifications
You must be signed in to change notification settings - Fork 841
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
Command-line --ghc-options don't seem to pass through #827
Comments
Consider the implications of applying the --ghc-options to every single compiled package:
The logic we have now is to apply ghc-options to all local targets. This can in fact be confusing, but the alternatives are also all confusing. See https://github.com/commercialhaskell/stack/wiki/FAQ#stack-sometimes-rebuilds-based-on-flag-changes-when-i-wouldnt-expect-it-to-how-come and the linked discussion for more details. Like flags, I think the best approach is to be explicit about which package you're applying this change to.
Can you point out where in the documentation you see that? |
@snoyberg spake thus:
Last sentence of https://github.com/commercialhaskell/stack/wiki/stack.yaml#ghc-options? |
The last line is slightly wrong, I've updated it from "targets" to "local targets." That said, I don't think it's telling you "you should do it this way," but telling you the actual trade-offs between the two. The language though is unclear; could you take a hand at improving it based on my description above? |
Sure, happy to. I still don't quite understand why the (I get why its hard due to 1 & 2 above) That said, presumably the right thing to do is amend the help to say "Do not try to use (the last time I tried to amend your help it didn't end well, so I'm not doing a pull request unless you say to) |
Pull request welcome. You're not changing a highly controversial naming this time ;) "local targets" refer to things that exist in the |
Ok. So when I said |
Correct. I considered changing it to apply to extra-deps as well. However, that would likely have a very disastrous effect for a command use case. Imagine a stack.yaml such as: resolver: lts-3.0
extra-deps:
- text-1.2.3
packages: [.] If you then ran |
Ok. I have it now. I'll make the edits this weekend. AfC P.S. Why can't I assign this to myself? |
Cool, thanks! On Fri, Aug 21, 2015 at 7:46 AM, Andrew Cowie [email protected]
|
Bumping |
One more bump before closing |
Sorry @snoyberg I will get to this sometime this month but if someone else wants to do it first by all means. |
I'm trying to fix this issue in #2402. You may want to check if what I wrote is actually correct. ;) |
Closing as the documentation issue is resolved. |
The instructions to build leksah say to do:
So I tried same with stack:
And it didn't pick up FlexibleContexts, build fails. #758 gave me the impression this technique should work?
I then discovered you can add
ghc-options
sections to a stack.yaml, like so:(and then realized the one added to the leksah repo turns out to have had that, but I wasn't then using 'master', was trying to build release) and it built.
Shouldn't
--ghc-options=-XBlah
have passed-XBlah
through to enable the Blah language extension? The stack documentation talks about this being preferable to doing it in stack.yaml so snapshot version isn't impacted (not that anyone else is using this package, but anyway).[I gather the issue on point is https://github.com/leksah/leksah/issues/156 but I wanted to report my attempted workaround and my impression that it should have worked]
AfC
The text was updated successfully, but these errors were encountered: