Uh oh!
There was an error while loading. Please reload this page.
Do not remove sublibrary information when adding pvp-bounds - #5309
Merged
Conversation
snoyberg
requested changes
Jun 8, 2020
snoyberg
left a comment
Contributor
There was a problem hiding this comment.
Looks great, thanks! One request: can you rebase this to target the stable branch instead?
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` from https://hackage.haskell.org/package/Cabal-3.0.0.0/docs/src/Distribution.Types.Dependency.html#line-58 will just print an empty set there: build-depends: vector : {} <0.13 This leads to the following error when using `stack sdist`: - 46:16: unexpected Sublibrary dependency syntax used. To use this syntax the package needs to specify at least 'cabal-version: 3.0'. Alternatively, if you are depending on an internal library, you can write directly the library name as it were a package. expecting space 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]`, which thanks to `instance Pretty Dependency` omits the `{}` in the dependency line and is hence (hopefully) compatible with whatever `cabal-version` the original .cabal file used.
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 freeto 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.
This fixes
stack sdistbroken 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 Dependencyfromhttps://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 Dependencyomits the{}in thedependency line and is hence (hopefully) compatible with whatever
cabal-versionthe 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 sdistin a package which haspvp-boundsenabled.