Skip to content

Commit 4c73bfc

Browse files
committed
Add trimmed down PackageTests/VersionPriority
1 parent 9cea7e9 commit 4c73bfc

33 files changed

+720
-2
lines changed

cabal-install/src/Distribution/Client/ProjectConfig/Legacy.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ module Distribution.Client.ProjectConfig.Legacy
3535

3636
import Data.Coerce (coerce)
3737
import Distribution.Client.Compat.Prelude
38-
import GHC.Stack (HasCallStack)
3938

4039
import Distribution.Types.Flag (FlagName, parsecFlagAssignment)
4140

@@ -313,7 +312,7 @@ parseProjectSkeleton srcImporters srcImportee cacheDir httpTransport verbosity s
313312
addWarnings x' = x'
314313
liftPR _ (ParseFailed e) = pure $ ParseFailed e
315314

316-
fetchImportConfig :: HasCallStack => ProjectConfigPath -> IO BS.ByteString
315+
fetchImportConfig :: ProjectConfigPath -> IO BS.ByteString
317316
fetchImportConfig = \case
318317
(ProjectRoot (RootConfig root)) -> fetch root
319318
(ProjectImport ImportedConfig{importee = Importee pci}) -> fetch pci
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# cabal v2-update
2+
Downloading the latest package list from test-local-repo
3+
# cabal v2-build
4+
Resolving dependencies...
5+
Error: [Cabal-7107]
6+
Could not resolve dependencies:
7+
[__0] trying: cabal-version-override-0.1.0.0 (user goal)
8+
[__1] next goal: hashable (dependency of cabal-version-override)
9+
[__1] rejecting: hashable-1.4.3.0 (constraint from project requires ==1.4.2.0)
10+
+-- <ROOT>/0-local.project requires ==1.4.2.0
11+
[__1] rejecting: hashable-1.4.2.0 (constraint from project requires ==1.4.3.0)
12+
+-- <ROOT>/0-local.project requires ==1.4.3.0
13+
[__1] fail (backjumping, conflict set: cabal-version-override, hashable)
14+
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: hashable (3), cabal-version-override (2)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
packages: .
2+
constraints: hashable ==1.4.3.0
3+
constraints: hashable ==1.4.2.0
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import Test.Cabal.Prelude
2+
3+
main = cabalTest . withRepo "repo" . withProjectFile "0-local.project" $ do
4+
fails $ cabal "v2-build" ["--dry-run"]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
packages: .
2+
allow-newer: hashable:*
3+
constraints: hashable ==1.4.2.0
4+
import: stackage-local.config
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
packages: .
2+
allow-newer: hashable:*
3+
import: stackage-local.config
4+
constraints: hashable ==1.4.2.0
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# cabal v2-update
2+
Downloading the latest package list from test-local-repo
3+
# cabal v2-build
4+
Resolving dependencies...
5+
Error: [Cabal-7107]
6+
Could not resolve dependencies:
7+
[__0] trying: cabal-version-override-0.1.0.0 (user goal)
8+
[__1] next goal: hashable (dependency of cabal-version-override)
9+
[__1] rejecting: hashable-1.4.3.0 (constraint from project requires ==1.4.2.0)
10+
+-- <ROOT>/1-local-constraints-import.project requires ==1.4.2.0
11+
[__1] rejecting: hashable-1.4.2.0 (constraint from project requires ==1.4.3.0)
12+
+-- <ROOT>/1-local-constraints-import.project
13+
+-- stackage-local.config requires ==1.4.3.0
14+
[__1] fail (backjumping, conflict set: cabal-version-override, hashable)
15+
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: hashable (3), cabal-version-override (2)
16+
# cabal v2-build
17+
Resolving dependencies...
18+
Error: [Cabal-7107]
19+
Could not resolve dependencies:
20+
[__0] trying: cabal-version-override-0.1.0.0 (user goal)
21+
[__1] next goal: hashable (dependency of cabal-version-override)
22+
[__1] rejecting: hashable-1.4.3.0 (constraint from project requires ==1.4.2.0)
23+
+-- <ROOT>/1-local-import-constraints.project requires ==1.4.2.0
24+
[__1] rejecting: hashable-1.4.2.0 (constraint from project requires ==1.4.3.0)
25+
+-- <ROOT>/1-local-import-constraints.project
26+
+-- stackage-local.config requires ==1.4.3.0
27+
[__1] fail (backjumping, conflict set: cabal-version-override, hashable)
28+
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: hashable (3), cabal-version-override (2)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Test.Cabal.Prelude
2+
3+
testVersionWin project =
4+
withProjectFile project $ do
5+
fails $ cabal "v2-build" ["--dry-run"]
6+
7+
main = cabalTest . withRepo "repo" $ do
8+
testVersionWin "1-local-constraints-import.project"
9+
testVersionWin "1-local-import-constraints.project"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
packages: .
2+
allow-newer: hashable:*
3+
constraints: hashable ==1.4.2.0
4+
import: https://www.stackage.org/nightly-2023-12-07/cabal.config
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
packages: .
2+
allow-newer: hashable:*
3+
import: https://www.stackage.org/nightly-2023-12-07/cabal.config
4+
constraints: hashable ==1.4.2.0

0 commit comments

Comments
 (0)