-
Notifications
You must be signed in to change notification settings - Fork 698
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
Fresh ~/.cabal/config written by cabal 3.10 crashes any older cabal #8864
Comments
The old definition of the
( |
My preference here as to a solution would be simply to have the value of this flag, if it is the default, written in generated config files commented out rather than enabled and explicitly set to the default. |
That's good enough IMHO too. |
@cbclemmer: given your knowledge of cabal usage in Nix, could you tell if writing the offending line in a fresh config commented out is likely to cause any problems for the Nix users? If you think no problems are likely, would you be up to implementing this? |
Hey @Mikolaj, thanks for pinging me again. I looked at this issue earlier and meant to get back to you about it, but it got lost in my notifications. I'll look into this and see if I can fix it. |
@Mikolaj So my problem with the #8522 PR was that I assumed what |
Wow, that indeed is mysterious. So it seems another PR, at some point between 3.6.2 and 3.10.1, changed the Indeed, there's barely any difference between |
I found the issue -- its here, and was introduced with that PR: https://github.com/haskell/cabal/blob/master/cabal-install/src/Distribution/Client/Setup.hs#L372 Basically we need to make the The reason for this is as follows. Eventually we call That will detect if the docstring in the field prints as empty or not. If it does print as empty, it prints the field commented out. If it prints as nonempty (i.e. "disabled") then it will print the value. So all other fields have the property that
I would propose both fixing this, and also adding a regression test for this property so we don't violate it in the future. |
Right, this makes sense and my hint was probably a blind alley. @cbclemmer: let us know if this works for you. |
@gbaz Thanks for the help. Unfortunately returning PR #8878 |
This was originally reported in haskell/actions#202, partially worked around there, but affects any users and any mixed-GHC CI (either testing many GHCs with the same CI cache or picking a random cabal version for a given GHC).
Judging by the dates of the PRs involved, this seems to affect already cabal 3.8.1.0 (please correct if not).
This was probably caused by the helpful and seemingly benign #8054, later amended in #8522, that make Nix flags easier to read. Note that old cabal happily ignore ~/.cabal/config options they don't understand, but choke on old options they recognize, but can't parse in a new way. That seems to be the root cause of the breakage.
I think, without a very good reason, we should not let cabal break the config file for old cabals, so let's think how to fix this. Ideally, without reverting the PRs in question.
@cbclemmer: I'm a bit lost in the history of these changes. Do you perhaps remember why we ended up changing the config option at all? Do you have any suggestions how to eat the cake (improve the command-line options) and have it too (parse the config option using the old parsing code in old cabals)?
The text was updated successfully, but these errors were encountered: