-
Notifications
You must be signed in to change notification settings - Fork 701
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
Fix/build tool depends repeats 10758 #10764
base: master
Are you sure you want to change the base?
Fix/build tool depends repeats 10758 #10764
Conversation
- report the duplicate versions - intersect the version ranges
c096235
to
e854972
Compare
where | ||
mergeVersions :: [VersionRange] -> VersionRange | ||
mergeVersions [] = anyVersion | ||
mergeVersions (v : vs) = foldr intersectVersionRanges v vs |
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.
foldx intersectVersionRanges
seems a common pattern, maybe this version should be in Cabal-syntax
?
See: cabal-install/src/Distribution/Client/List.hs
,Cabal/src/Distribution/PackageDescription/Check/Target.hs
.
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.
I'd rather do that on a separate pull request if you think it is worth making it a maintenance task.
$ find . -type f -name '*.hs' | grep -v -E 'dist-|cabal-testsuite|IntegrationTests2' \
| xargs grep -Po 'intersectVersionRanges' | wc -l
57
I'll have to find where the solver is being called before ...
common warnings
ghc-options: -Wall
test-suite build-tool-depends-twice-test
import: warnings
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: Main.hs
build-depends: base >=4 && <5
build-tool-depends: markdown-unlit:markdown-unlit > 0.5.0 && <= 0.6
build-tool-depends: markdown-unlit:markdown-unlit <0
I've not seen the
|
Fixes #10758.
significance: significant
in the changelog file.QA Notes
Use
cabal init
to create a package with components of your choosing and then add abuild-tool-depends
stanza that builds. The one from the docs ismarkdown-unlit:markdown-unlit >= 0.5.0 && < 0.6
. When repeated, there should be a message asking that each build tool dependency is specified only once. The package should still build unless the effective intersection of version ranges is impossible to satisfy.