-
Notifications
You must be signed in to change notification settings - Fork 698
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
Add package-db flag for v2 commands #7676
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
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
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
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
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
16 changes: 16 additions & 0 deletions
16
cabal-testsuite/PackageTests/PackageDB/cabal-fail-no-base.out
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 @@ | ||
# Setup configure | ||
Configuring p-1.0... | ||
# Setup build | ||
Preprocessing library for p-1.0.. | ||
Building library for p-1.0.. | ||
# Setup copy | ||
Installing library in <PATH> | ||
# Setup register | ||
Registering library for p-1.0.. | ||
# cabal v2-build | ||
Resolving dependencies... | ||
Error: cabal: Could not resolve dependencies: | ||
[__0] trying: q-1.0 (user goal) | ||
[__1] unknown package: base (dependency of q) | ||
[__1] fail (backjumping, conflict set: base, q) | ||
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: q (2), base (1) |
12 changes: 12 additions & 0 deletions
12
cabal-testsuite/PackageTests/PackageDB/cabal-fail-no-base.test.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,12 @@ | ||
import Test.Cabal.Prelude | ||
main = cabalTest $ do | ||
withPackageDb $ do | ||
withDirectory "p" $ | ||
setup_install [] | ||
|
||
env <- getTestEnv | ||
let pkgDbPath = testPackageDbDir env | ||
|
||
withDirectory "q" $ do | ||
res <- fails $ cabal' "v2-build" ["--package-db=clear", "--package-db=" ++ pkgDbPath] | ||
assertOutputContains "unknown package: base" res |
16 changes: 16 additions & 0 deletions
16
cabal-testsuite/PackageTests/PackageDB/cabal-fail-no-p.out
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 @@ | ||
# Setup configure | ||
Configuring p-1.0... | ||
# Setup build | ||
Preprocessing library for p-1.0.. | ||
Building library for p-1.0.. | ||
# Setup copy | ||
Installing library in <PATH> | ||
# Setup register | ||
Registering library for p-1.0.. | ||
# cabal v2-build | ||
Resolving dependencies... | ||
Error: cabal: Could not resolve dependencies: | ||
[__0] trying: q-1.0 (user goal) | ||
[__1] unknown package: p (dependency of q) | ||
[__1] fail (backjumping, conflict set: p, q) | ||
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: q (2), p (1) |
9 changes: 9 additions & 0 deletions
9
cabal-testsuite/PackageTests/PackageDB/cabal-fail-no-p.test.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,9 @@ | ||
import Test.Cabal.Prelude | ||
main = cabalTest $ do | ||
withPackageDb $ do | ||
withDirectory "p" $ | ||
setup_install [] | ||
|
||
withDirectory "q" $ do | ||
res <- fails $ cabal' "v2-build" [] | ||
assertOutputContains "unknown package: p" res |
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/PackageDB/cabal-fail-no-packagedbs.out
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,2 @@ | ||
# cabal v2-build | ||
Error: cabal: No package databases have been specified. If you use --package-db=clear, you must follow it with --package-db= with 'global', 'user' or a specific file. |
6 changes: 6 additions & 0 deletions
6
cabal-testsuite/PackageTests/PackageDB/cabal-fail-no-packagedbs.test.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,6 @@ | ||
import Test.Cabal.Prelude | ||
main = cabalTest $ do | ||
withPackageDb $ do | ||
withDirectory "p-no-package-dbs" $ do | ||
res <- fails $ cabal' "v2-build" [] | ||
assertOutputContains "No package databases have been specified." res |
17 changes: 17 additions & 0 deletions
17
cabal-testsuite/PackageTests/PackageDB/cabal-manual-packagedb.out
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 @@ | ||
# Setup configure | ||
Configuring p-1.0... | ||
# Setup build | ||
Preprocessing library for p-1.0.. | ||
Building library for p-1.0.. | ||
# Setup copy | ||
Installing library in <PATH> | ||
# Setup register | ||
Registering library for p-1.0.. | ||
# cabal v2-build | ||
Resolving dependencies... | ||
Build profile: -w ghc-<GHCVER> -O1 | ||
In order, the following will be built: | ||
- q-1.0 (exe:q) (first run) | ||
Configuring executable 'q' for q-1.0.. | ||
Preprocessing executable 'q' for q-1.0.. | ||
Building executable 'q' for q-1.0.. |
12 changes: 12 additions & 0 deletions
12
cabal-testsuite/PackageTests/PackageDB/cabal-manual-packagedb.test.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,12 @@ | ||
import Test.Cabal.Prelude | ||
main = cabalTest $ do | ||
withPackageDb $ do | ||
withDirectory "p" $ | ||
setup_install [] | ||
|
||
env <- getTestEnv | ||
let pkgDbPath = testPackageDbDir env | ||
withDirectory "q" $ | ||
cabal "v2-build" [ "--package-db=clear" | ||
, "--package-db=global" | ||
, "--package-db=" ++ pkgDbPath] |
17 changes: 17 additions & 0 deletions
17
cabal-testsuite/PackageTests/PackageDB/cabal-packagedb.out
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 @@ | ||
# Setup configure | ||
Configuring p-1.0... | ||
# Setup build | ||
Preprocessing library for p-1.0.. | ||
Building library for p-1.0.. | ||
# Setup copy | ||
Installing library in <PATH> | ||
# Setup register | ||
Registering library for p-1.0.. | ||
# cabal v2-build | ||
Resolving dependencies... | ||
Build profile: -w ghc-<GHCVER> -O1 | ||
In order, the following will be built: | ||
- q-1.0 (exe:q) (first run) | ||
Configuring executable 'q' for q-1.0.. | ||
Preprocessing executable 'q' for q-1.0.. | ||
Building executable 'q' for q-1.0.. |
Oops, something went wrong.
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.
Please add @SInCE annotations
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.
updated