Require cabal.project packages and/or optional-packages field#11574
Open
tbidne wants to merge 1 commit intohaskell:masterfrom
Open
Require cabal.project packages and/or optional-packages field#11574tbidne wants to merge 1 commit intohaskell:masterfrom
tbidne wants to merge 1 commit intohaskell:masterfrom
Conversation
1918b20 to
d6d316c
Compare
Currently, if a cabal.project file is present and the `packages` and `optional-packages` fields do not exist, a warning will be issued, and cabal will fail with a different, potentially misleading error message: "There is no <pkgname>.cabal package file or cabal.project file..." This changes it so that the prior warning is now an error, hence will cause cabal to fail before the misleading error is given. That at least one of these fields is required is already specified in the docs, hence this is not a specification change. See haskell#7401.
Bodigrim
approved these changes
Mar 16, 2026
geekosaur
requested changes
Mar 16, 2026
geekosaur
approved these changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #7401.
Turns the prior warning into an error. This has the effect that the misleading messages are never logged, since the new error causes an immediate failure.
I attempted to add as many test cases as I could think of, so there may be some redundancy (e.g. I checked explicit vs. implicit targets, and evidently it doesn't matter).
I also added the project file path to the error message. This is grabbed here:
This seems right to me, though someone should double-check this makes sense.
Thanks!
Template Α: This PR modifies behaviour or interface
Include the following checklist in your PR:
significance: significantin the changelog file.