Skip to content
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 Y-forking import project #10508

Merged
merged 3 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading