Do not remove sublibrary information when adding pvp-bounds #5309
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.
This fixes
stack sdist
broken when using pvp-bounds, see#5289. This is a
regression after #5156.
When using pvp-bounds we pretty-print an updated package description
back to .cabal file. If a set of sublibraries used in a dependency is
empty (from cabal-the-library perspective) then
instance Pretty Dependency
fromhttps://hackage.haskell.org/package/Cabal-3.0.0.0/docs/src/Distribution.Types.Dependency.html#line-58
will just print an empty set there:
This leads to the following error when using
stack sdist
:What we want instead is to use the same sublibrary set as the original
dep. I suspect most of the time it's just
[LMainLibName]
, whichthanks to
instance Pretty Dependency
omits the{}
in thedependency line and is hence (hopefully) compatible with whatever
cabal-version
the original .cabal file used.Note: Documentation fixes for https://docs.haskellstack.org/en/stable/ should target the "stable" branch, not master.
Please include the following checklist in your PR:
I tested this manually doing a
stack sdist
in a package which haspvp-bounds
enabled.