-
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
Unify behaviour of flags and ghc-options #849
Comments
This may be subsumed by #1265 (Unify extra-deps and extensible snapshots) |
We have a couple cases where a ghc-option must be applied to all packages. I'm not even sure how feasible that is considering that we have wired-in packages (that come with GHC / GHCJS). Nonetheless, it makes a lot of sense for ghc-options to actually be declarative rather than having the meaning be sensitive to what's already installed. I think this is one of the ugliest parts of stack right now. I agree that this is likely to be subsumed by #1265 |
I've spent some time looking into this, and figured I'd note down the current state of things: The Flags specified in the config and cli replace those specified in the snapshot. Conversely, ghc-options get added to those specified in the snapshot. See |
I specifically avoided making this change when doing my refactoring to match the previous behavior, together with FIXMEs in the code to reconsider. I'm happy to see this issue. After the PR is merged (#3249), I'll attack this with a separate PR. |
Alright, here's a bit of a wrinkle from a design standpoint. We've got two kinds of ghc-options overrides:
For by package options (specified in the
It doesn't seem like (1) is a good option, even if it's the most straightforward. And we know that (3) is troublesome from a reproducibility standpoint. How about a modified version of (2)?
I'm open to other ideas. |
I just realized we already have an |
I definitely like the |
There are certainly cases where folks want to set an option for all packages in the build, such as #2708 .
I thought implicit snapshots meant that this promotion was unnecessary? I thought this was one of the reasons for implicit snapshots. With that, options won't silently affect snapshot packages that get reused by projects that don't specify those options. Moreover, if you've built a package with a particular set of options before, it can be reused. Not sure where (couldn't find it by search), but I recently saw mention of the idea of allowing ghc-options to apply to different categories of packages, like: ghc-options:
# Options applied to all packages
"*": ...
# Options applied to local packages
"$local": ... Could deprecate |
Looks like implicit snapshots aren't happening (see #1265 (comment)). It might be worth elaborating those reasons. @snoyberg having been deep in this code recently almost certainly saw problems I hadn't thought of. But yeah, this was the sort of thing I'd hoped implicit snapshots would take care of in an elegant way. |
Oh darn, that change was rather large so I figured implicit snapshots was happening. From the perspective of the current code, it would indeed be a sweeping change. My responses to the points brought up in the reason not to do it:
This just means we need to have some variety of GC that deletes packages and DBs based on last use time. This would already be good to have, it's easy for STACK_ROOT to eat up HD over time with stuff that's unlikely to be reused. This would indeed exacerbate the problem, and make automation for it necessary.
Why not promote extra-deps to local packages in this case? Seems perfectly consistent to me. |
…ptions Promote packages to local database by ghc-options #849
In particular, ghc-options in stack.yaml should also promote snapshot dependencies to extra-deps (to avoid breaking the snapshot sandbox). This also will open the door to more easily adding other options that effect what is passed to
runhaskell Setup.hs configure
.The text was updated successfully, but these errors were encountered: