-
Notifications
You must be signed in to change notification settings - Fork 710
Remove local options from global program options #7973
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
Conversation
This is amazing! However, people have already got used to the wrong behaviour, so let's make sure we change it once and don't ask them to re-adjust repeatedly. Is the desired semantics completely clear or do we need to ask users, discuss again on the tickets you mentioned, etc.? |
It is somewhat weird this did not break any test. I think we should add some sort of regression test to exercise the change and have evidences it fixes those issues |
well, as noted in the pr description
so it is not so weird there are no tests checking ghc-options are applied to non local packages Probably this will break quite use cases, it is worth to note you can recover the old behaviour with
if you have a local project. Not sure if there would be a easy one for installing from a tarball or hackage though |
4038fd8
to
e530351
Compare
Tests added to demonstrate old behavior/verify fix. Before the fix, tests failed with:
Here I need to double check, but I believe command-line options are also passed into the "local" portion of the project config, which means this would also affect that. I think command line only affecting local packages is the intended behavior, but as you mentioned it might break some use cases. To recreate old behavior, this still works:
|
e530351
to
98ece87
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great fix, thanks!
98ece87
to
ab0c9c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job. Let me try to merge this.
@Mergifyio rebase |
☑️ Nothing to do
|
Simplifies *.project.* files a bit. It wasn't feasible before #7973, as program-options were applied to dependencies as well, which is undesirable.
Simplifies *.project.* files a bit. It wasn't feasible before #7973, as program-options were applied to dependencies as well, which is undesirable.
Simplifies *.project.* files a bit. It wasn't feasible before #7973, as program-options were applied to dependencies as well, which is undesirable.
Simplifies *.project.* files a bit. It wasn't feasible before #7973, as program-options were applied to dependencies as well, which is undesirable.
Simplifies *.project.* files a bit. It wasn't feasible before #7973, as program-options were applied to dependencies as well, which is undesirable.
Simplifies *.project.* files a bit. It wasn't feasible before #7973, as program-options were applied to dependencies as well, which is undesirable.
Simplifies *.project.* files a bit. It wasn't feasible before #7973, as program-options were applied to dependencies as well, which is undesirable.
Simplifies *.project.* files a bit. It wasn't feasible before #7973, as program-options were applied to dependencies as well, which is undesirable.
Simplifies *.project.* files a bit. It wasn't feasible before haskell#7973, as program-options were applied to dependencies as well, which is undesirable.
Please include the following checklist in your PR:
Please also shortly describe how you tested your change. Bonus points for added tests!
Local options for compiler related flags are 1) applied to all packages and 2) cached. Both of which seem incorrect.
This PR removes those options from the pre-configured program DB. Note that options are still applied correctly here:
cabal/cabal-install/src/Distribution/Client/ProjectPlanning.hs
Line 1914 in 7d66cea
There are lots of related issues around weird behavior trying to apply ghc-options:
--ghc-options
are cached, but shouldn't be #7816This PR makes this
cabal.project
stanza work as intended, applying theghc-options
to all/only local packages:and removes the need for this workaround: