-
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
Look for transitive setup dependency on Cabal when choosing Cabal spec version. #5170
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module CustomIssue where | ||
|
||
f x = x + 1 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import SetupHelper (setupHelperDefaultMain) | ||
|
||
main = setupHelperDefaultMain |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: T4288 | ||
version: 1.0 | ||
build-type: Custom | ||
|
||
-- cabal-version is lower than the version of Cabal that will be chosen for the | ||
-- setup script. | ||
cabal-version: >=1.10 | ||
|
||
-- Setup script only has a transitive dependency on Cabal. | ||
custom-setup | ||
setup-depends: base, setup-helper | ||
|
||
library | ||
exposed-modules: CustomIssue | ||
build-depends: base | ||
default-language: Haskell2010 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
packages: . setup-helper/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- This test is similar to the simplified example in issue #4288. The package's | ||
-- setup script only depends on base and setup-helper. setup-helper exposes a | ||
-- function that is a wrapper for Cabal's defaultMain (similar to | ||
-- cabal-doctest). This test builds the package to check that the flags passed | ||
-- to the setup script are compatible with the version of Cabal that it depends | ||
-- on, even though Cabal is only a transitive dependency. | ||
main = cabalTest $ do | ||
skipUnless =<< hasNewBuildCompatBootCabal | ||
r <- recordMode DoNotRecord $ cabal' "new-build" ["T4288"] | ||
assertOutputContains "This is setup-helper-1.0." r | ||
assertOutputContains | ||
("In order, the following will be built: " | ||
++ " - setup-helper-1.0 (lib:setup-helper) (first run) " | ||
++ " - T4288-1.0 (lib:T4288) (first run)") | ||
r |
5 changes: 5 additions & 0 deletions
5
cabal-testsuite/PackageTests/NewBuild/T4288/setup-helper/SetupHelper.hs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module SetupHelper (setupHelperDefaultMain) where | ||
|
||
import Distribution.Simple | ||
|
||
setupHelperDefaultMain = putStrLn "This is setup-helper-1.0." >> defaultMain |
9 changes: 9 additions & 0 deletions
9
cabal-testsuite/PackageTests/NewBuild/T4288/setup-helper/setup-helper.cabal
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: setup-helper | ||
version: 1.0 | ||
build-type: Simple | ||
cabal-version: >= 1.2 | ||
|
||
library | ||
exposed-modules: SetupHelper | ||
build-depends: base, Cabal | ||
default-language: Haskell2010 |
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.
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'm not completely sure I calculated the closure of the setup dependencies correctly, since I skipped calling
elaborateLibSolverId mapDep
. I calledCD.setupDeps
ondeps0
directly, because all setup dependencies are library dependencies.