-
Notifications
You must be signed in to change notification settings - Fork 846
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
Applying options to all packages of stack.yaml #1089
Comments
I should add that this applies to other options such as |
Related
I still want this solved differently as well... I'd like to be able to set this in stack.yaml and have it apply to all local dependencies. As a second step it would also be useful to be able to say "build all test suites and compile with -Werror, except for this package" Previously I ran |
This was already discussed at length, see https://github.com/commercialhaskell/stack/blob/master/doc/faq.md#stack-sometimes-rebuilds-based-on-flag-changes-when-i-wouldnt-expect-it-to-how-come and the linked issue. There are going to stack.yaml changes made to allow setting ghc-options there. But the exact change requested here almost certainly will not become a part of stack, since it breaks reproducibility. |
@snoyberg to clarify, are you saying |
For the record, the reproducibility is not an issue. It just exacerbates the real issue of not passing flags the way I expect it. |
The problem with this topic is that we can't discuss one piece of it without pulling it many others. I gave this all some thought over the past few days, I'll try to summarize (pinging @borsboom, who's working on some related things). There are essentially two different questions at play right now:
I'm willing to reopen the discussion on (1), specifically since experience has shown the argument against to be very strong. I'm also open to discussion on (2), but I have a strong inclination against changing it without also changing (1), as that would break a common workflow ( |
Being a power user, I don't really care much about the "how" as long as I can automate it (e.g., I can put explicit options on a shell script once and for all). So all of the options you've mentioned work for me except for the status quo. Obviously you need to work out how Stack should work for everyone else, though :). I honestly have no idea what users expect, outside the fact that the |
To be fair, even the status quo does allow you to do exactly what you're after:
|
For question (1), my feeling is that once we're passing GHC options on the command-line, we've basically thrown reproducibility out the window anyway, since we could pass all sorts of options in that change the build result. I'd be in favour of Stack not rebuilding non-target packages if the command-line ghc-options change. However, changing ghc-options in stack.yaml should still force a rebuild. I think this would exhibit the behaviour most people would expect. With that change, (2) probably should be left as-is. Saying that --ghc-options applies to all locals, only to have them ignored in many cases (since they wouldn't trigger a rebuild in non-targets), would just be confusing. |
This sounds good to me @borsboom! |
It might also be nice to have an extra option (like |
I think it's clear that no set of decisions here will make everyone happy, so (following @borsboom's ideas in a chat we had) I've added two new config options:
I think this is the best we can do right now. @meteficha want to review? |
I'll admit that I don't fully grasp @borsboom's comment. I don't see why reproducibility goes out of the window when you pass explicit GHC options. Thus, my opinion remains that The new |
Are you using As for the default for Anyway, looks like this is tied up now, closing. |
Background:
I have a
stack.yaml
with many packages. Many times I'llbecause I'm not interested in running all of the test suites.
What stack does:
Builds every dependency of the
foo-package
as if--pedantic
wasn't given, then buildsfoo-package
with--pedantic
.What I expect:
Builds dependencies using
--pedantic
if, and only if, they are specified as a package onstack.yaml
. Always builds packages given as argument with--pedantic
.Why this is an issue:
While working on
foo-package
I'm only interested in running its test suite because that's where I'm writing new tests. However, I may have to change something on one of the other packages. Any small issue that gives an warning will break the CI while still working on my machine.Furthermore, if you switch between
stack test --pedantic
andstack test --pedantic foo-package
, you'll notice that stack needs to recompile dependencies because their flags changed.The text was updated successfully, but these errors were encountered: