-
Notifications
You must be signed in to change notification settings - Fork 710
cabal sdist
: Rename Cabal file to match the package name
#10947
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
base: master
Are you sure you want to change the base?
Conversation
It feels to me like it can break someone's workflows, i.e. people may assume that the name of the cabal file does not magically change --- a very reasonable expectation! Maybe the new behaviour could be enabled by a flag?.. In any case, there should be an issue with the discussion of the design before a PR, see https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md#pull-requests--issues |
If Hackage is currently rejecting such packages, it's probably not breaking many workflows. |
First, thanks for your feedback @ulysses4ever @geekosaur !
I see your concerns, and I am not sure about that myself; That's why this is a draft PR.
I am aware of the guide lines, but I also forgot to link two related issues #6299 and the aforementioned #7322 in the description of the PR; Sorry for that. BTW: The PR template proposed to me referred to contribution guidelines found in |
Before, if the name of the Cabal file did not match the acutual package name, then `cabal sdist` would include the Cabal file as-is in the source distribution, causing a subsequent `cabal check` to issue a warning and the failure of a Hackage upload. This commit changes that behaviour: The name of the Cabal file in the source distribution always matches the package name, regardless what it was named in the filesystem. Related issue: haskell#6299
b8cea4d
to
572626b
Compare
mbWorkDir <- Just . makeSymbolicPath <$> canonicalizePath dir | ||
cabalFilePath <- | ||
getSymbolicPath | ||
<$> tryFindPackageDesc verbosity mbWorkDir |
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.
You could probably pass in the location, since you must have already read the cabal file, but I do see that listPackageSources
does also call tryFindPackageDesc
.
This PR modifies how source distribution are packaged by
cabal-install:exe:cabal
:Before, if the name of the Cabal file did not match the actual package name, then
cabal sdist
would include the Cabal file as-is in the source distribution, causing a subsequentcabal check
to issue a warning and the failure of a Hackage upload.This commit changes that behaviour: The name of the Cabal file in the source distribution always matches the package name, regardless what it was named in the filesystem.
EDIT:
Related issue: #6299
Fixes #7322
significance: significant
in the changelog file.