-
Notifications
You must be signed in to change notification settings - Fork 701
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
Add --allow-newer/older to Cabal / Setup.hs #7445
Comments
The flags used to be with
I'd be in favor of reverting that decision. |
If it's needed, let the interested parties add and maintain it. Any objections? |
Based on incoming PR #9016, I optimistically add this to the 3.12 project. Please, review the PR! |
I wasn't aware of this discussion and I know I am late to the party. Since nixpkgs is mentioned as a usecase, I wonder if this is really necessary. @maralorn following on your comment linked above, could nixpkgs use IMHO, I'd find it more natural if A bit physosofically perhaps but I consider allow-newer and allow-older as options to influence the solver and there's no solver in Just my 2c, feel free to disagree with me |
It is confusing to hear about (seemingly) solver-related options inside |
In Cabal allow-newer is not a solver option but a check option.
Cabal does not do package resolution. It simply discovers present needed packages and passes them on to ghc. (It maybe be a bit smarter than that when there are multiple versions of the same dependency available. That I don't know. I guess it simply picks the first dependency which fulfills the version bounds.) In this step it checks whether the found configuration conforms with version bounds.
We rely very much on that check step in nixpkgs. ~~and using exact-configuration would prevent the check from happening at all.~~ But we want to only opt-out of the check for specific bounds and not all of them.
Am 13. Juni 2023 04:51:06 MESZ schrieb Artem Pelenitsyn ***@***.***>:
…It _is_ confusing to hear about (seemingly) solver-related options inside `Cabal`, when you think about it. I didn't think about it before…
--
Reply to this email directly or view it on GitHub:
#7445 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
Wait, I mixed that up a little. I don't know whether exact-configuration performs the check, but we don't use it and it would not solve our problem. |
As a service to the reader here the documentation: --exact-configuration This changes Cabal to require every dependency be explicitly specified using --dependency, rather than use Cabal’s (very simple) dependency solver. This is useful for programmatic use of Cabal’s API, where you want to error if you didn’t specify enough --dependency flags. |
So yeah, I assume using that flag would disable the check. So theoretically Cabal has a very simple solver, but in practice that is more or less simply a check whether installed packages match. |
|
I feel we are solving a haskell4nix problem here, but I have nothing against a flag to tell Cabal to not check dependency versions, if anything I am a bit hesitant about calling it with the same name as the cabal-install option. (Off topic: I am bit puzzled, how is the install plan determined in haskell4nix?) |
Hard to argue with that, as this is obviously why I am investing the time to work on this. Nevertheless, even without Nix as a motivation, this seems like a sensible feature request. Also, Cabal is a library to support different Haskell build systems and Nix is the third most used Haskell build system in the community. (https://taylor.fausak.me/2022/11/18/haskell-survey-results/#s3q0)
Well, the way it is implemented in this PR, it is really the same option. It has the same behaviour. cabal-install exposes quite a few Cabal flags directly, this will just be another example of that. But maybe there is a good argument against this sharing, that I am not aware of?
See the (short) subsections "Available package versions" and "Dependency resolution" in https://nixos.org/manual/nixpkgs/unstable/#haskell-available-packages. |
(move it from ConfigExFlags to ConfigFlags and use it both in Cabal and cabal-install)
This would make it easier for downstream distributions to surgically override the constraints in case they want to widen the bounds, eg. if they move faster than upstream
Originally from #7444 (comment)
/cc @maralorn
The text was updated successfully, but these errors were encountered: