Skip to content

Commit

Permalink
Merge pull request #10508 from cabalism/repro/config-from-duplicates
Browse files Browse the repository at this point in the history
Add Y-forking import project
  • Loading branch information
mergify[bot] authored Nov 11, 2024
2 parents 628ddc8 + 563be04 commit 287d347
Show file tree
Hide file tree
Showing 12 changed files with 199 additions and 0 deletions.
150 changes: 150 additions & 0 deletions cabal-testsuite/PackageTests/ConditionalAndImport/cabal.out
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,156 @@ Could not resolve dependencies:
(constraint from oops-0.project requires ==1.4.3.0)
[__1] fail (backjumping, conflict set: hashable, oops)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: hashable (3), oops (2)
# checking if we detect when the same config is imported via many different paths (we don't)
# cabal v2-build
Configuration is affected by the following files:
- yops-0.project
Configuration is affected by the following files:
- yops-2.config
imported by: yops/yops-1.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops-4.config
imported by: yops/yops-3.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops-4.config
imported by: yops/yops-3.config
imported by: yops-2.config
imported by: yops/yops-1.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops-6.config
imported by: yops/yops-5.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops-6.config
imported by: yops/yops-5.config
imported by: yops-4.config
imported by: yops/yops-3.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops-6.config
imported by: yops/yops-5.config
imported by: yops-4.config
imported by: yops/yops-3.config
imported by: yops-2.config
imported by: yops/yops-1.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops-8.config
imported by: yops/yops-7.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops-8.config
imported by: yops/yops-7.config
imported by: yops-6.config
imported by: yops/yops-5.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops-8.config
imported by: yops/yops-7.config
imported by: yops-6.config
imported by: yops/yops-5.config
imported by: yops-4.config
imported by: yops/yops-3.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops-8.config
imported by: yops/yops-7.config
imported by: yops-6.config
imported by: yops/yops-5.config
imported by: yops-4.config
imported by: yops/yops-3.config
imported by: yops-2.config
imported by: yops/yops-1.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops/yops-1.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops/yops-3.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops/yops-3.config
imported by: yops-2.config
imported by: yops/yops-1.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops/yops-5.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops/yops-5.config
imported by: yops-4.config
imported by: yops/yops-3.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops/yops-5.config
imported by: yops-4.config
imported by: yops/yops-3.config
imported by: yops-2.config
imported by: yops/yops-1.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops/yops-7.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops/yops-7.config
imported by: yops-6.config
imported by: yops/yops-5.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops/yops-7.config
imported by: yops-6.config
imported by: yops/yops-5.config
imported by: yops-4.config
imported by: yops/yops-3.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops/yops-7.config
imported by: yops-6.config
imported by: yops/yops-5.config
imported by: yops-4.config
imported by: yops/yops-3.config
imported by: yops-2.config
imported by: yops/yops-1.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops/yops-9.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops/yops-9.config
imported by: yops-8.config
imported by: yops/yops-7.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops/yops-9.config
imported by: yops-8.config
imported by: yops/yops-7.config
imported by: yops-6.config
imported by: yops/yops-5.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops/yops-9.config
imported by: yops-8.config
imported by: yops/yops-7.config
imported by: yops-6.config
imported by: yops/yops-5.config
imported by: yops-4.config
imported by: yops/yops-3.config
imported by: yops-0.project
Configuration is affected by the following files:
- yops/yops-9.config
imported by: yops-8.config
imported by: yops/yops-7.config
imported by: yops-6.config
imported by: yops/yops-5.config
imported by: yops-4.config
imported by: yops/yops-3.config
imported by: yops-2.config
imported by: yops/yops-1.config
imported by: yops-0.project
Up to date
# checking bad conditional
# cabal v2-build
Error: [Cabal-7090]
Expand Down
33 changes: 33 additions & 0 deletions cabal-testsuite/PackageTests/ConditionalAndImport/cabal.test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,39 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do
\ imported by: oops-0.project")
oopsing

-- The project is named yops as it is like hops but with y's for forks.
-- +-- yops-0.project
-- +-- yops/yops-1.config
-- +-- yops-2.config
-- +-- yops/yops-3.config
-- +-- yops-4.config
-- +-- yops/yops-5.config
-- +-- yops-6.config
-- +-- yops/yops-7.config
-- +-- yops-8.config
-- +-- yops/yops-9.config (no further imports)
-- +-- yops/yops-3.config
-- +-- yops-4.config
-- +-- yops/yops-5.config
-- +-- yops-6.config
-- +-- yops/yops-7.config
-- +-- yops-8.config
-- +-- yops/yops-9.config (no further imports)
-- +-- yops/yops-5.config
-- +-- yops-6.config
-- +-- yops/yops-7.config
-- +-- yops-8.config
-- +-- yops/yops-9.config (no further imports)
-- +-- yops/yops-7.config
-- +-- yops-8.config
-- +-- yops/yops-9.config (no further imports)
-- +-- yops/yops-9.config (no further imports)
--
-- We don't check and don't error or warn on the same config being imported
-- via many different paths.
log "checking if we detect when the same config is imported via many different paths (we don't)"
yopping <- cabal' "v2-build" [ "--project-file=yops-0.project" ]

log "checking bad conditional"
badIf <- fails $ cabal' "v2-build" [ "--project-file=bad-conditional.project" ]
assertOutputContains "Cannot set compiler in a conditional clause of a cabal project file" badIf
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
packages: .

import: yops/yops-1.config
import: yops/yops-3.config
import: yops/yops-5.config
import: yops/yops-7.config
import: yops/yops-9.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import: yops/yops-3.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import: yops/yops-5.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import: yops/yops-7.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import: yops/yops-9.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import: ../yops-2.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import: ../yops-4.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import: ../yops-6.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import: ../yops-8.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-- No imports here

0 comments on commit 287d347

Please sign in to comment.