diff --git a/cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/cabal.out b/cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/cabal.out new file mode 100644 index 00000000000..2ba99a9be5f --- /dev/null +++ b/cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/cabal.out @@ -0,0 +1,2 @@ +# checking "using config from message" with URI imports +# cabal v2-build diff --git a/cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/cabal.test.hs b/cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/cabal.test.hs new file mode 100644 index 00000000000..bb67f2d2a42 --- /dev/null +++ b/cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/cabal.test.hs @@ -0,0 +1,38 @@ +import Test.Cabal.Prelude + +main = cabalTest . recordMode RecordMarked $ do + let log = recordHeader . pure + + log "checking \"using config from message\" with URI imports" + woopping <- fails $ cabal' "v2-build" [ "--dry-run", "--project-file=woops-0-packages-in-woops.project" ] + + -- Use assertRegex when the output is tainted by the temp directory, like + -- this: + -- + -- When using configuration from: + -- - /tmp/cabal-testsuite-282695/woops-0.project + -- - /tmp/cabal-testsuite-282695/woops-2.config etc + assertRegex + "Project configuration with URI imports is listed in full" + "When using configuration from:(\n|\r\n) \ + \ .*woops-0-packages-in-woops\\.project(\n|\r\n) \ + \ .*with-ghc\\.config(\n|\r\n) \ + \ .*woops-0\\.config(\n|\r\n) \ + \ .*woops-2\\.config(\n|\r\n) \ + \ .*woops-4\\.config(\n|\r\n) \ + \ .*woops-6\\.config(\n|\r\n) \ + \ .*woops-8\\.config(\n|\r\n) \ + \ .*woops-1\\.config(\n|\r\n) \ + \ .*woops-3\\.config(\n|\r\n) \ + \ .*woops-5\\.config(\n|\r\n) \ + \ .*woops-7\\.config(\n|\r\n) \ + \ .*woops-9\\.config(\n|\r\n) \ + \ .*https://www.stackage.org/lts-21.25/cabal.config(\n|\r\n)" + woopping + + assertOutputContains + "The following errors occurred: \ + \ - The package directory 'woops' does not contain any .cabal file." + woopping + + return () diff --git a/cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/with-ghc.config b/cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/with-ghc.config new file mode 100644 index 00000000000..140a00be1b9 --- /dev/null +++ b/cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/with-ghc.config @@ -0,0 +1,7 @@ +-- WARNING: Override the `with-compiler: ghc-x.y.z` of the stackage import, of +-- https://www.stackage.org/nightly-yyyy-mm-dd/cabal.config. Otherwise tests +-- will fail with: +-- -Error: [Cabal-5490] +-- -Cannot find the program 'ghc'. User-specified path 'ghc-x.y.z' does not +-- refer to an executable and the program is not on the system path. +with-compiler: ghc diff --git a/cabal-testsuite/PackageTests/ConditionalAndImport/woops-0-packages-in-woops.project b/cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops-0-packages-in-woops.project similarity index 100% rename from cabal-testsuite/PackageTests/ConditionalAndImport/woops-0-packages-in-woops.project rename to cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops-0-packages-in-woops.project diff --git a/cabal-testsuite/PackageTests/ConditionalAndImport/woops-0.config b/cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops-0.config similarity index 92% rename from cabal-testsuite/PackageTests/ConditionalAndImport/woops-0.config rename to cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops-0.config index 412e17aafba..480367e45f1 100644 --- a/cabal-testsuite/PackageTests/ConditionalAndImport/woops-0.config +++ b/cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops-0.config @@ -1,5 +1,3 @@ -packages: . - import: woops/woops-1.config import: woops/woops-3.config import: woops/woops-5.config diff --git a/cabal-testsuite/PackageTests/ConditionalAndImport/woops-2.config b/cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops-2.config similarity index 100% rename from cabal-testsuite/PackageTests/ConditionalAndImport/woops-2.config rename to cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops-2.config diff --git a/cabal-testsuite/PackageTests/ConditionalAndImport/woops-4.config b/cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops-4.config similarity index 100% rename from cabal-testsuite/PackageTests/ConditionalAndImport/woops-4.config rename to cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops-4.config diff --git a/cabal-testsuite/PackageTests/ConditionalAndImport/woops-6.config b/cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops-6.config similarity index 100% rename from cabal-testsuite/PackageTests/ConditionalAndImport/woops-6.config rename to cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops-6.config diff --git a/cabal-testsuite/PackageTests/ConditionalAndImport/woops-8.config b/cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops-8.config similarity index 100% rename from cabal-testsuite/PackageTests/ConditionalAndImport/woops-8.config rename to cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops-8.config diff --git a/cabal-testsuite/PackageTests/ConditionalAndImport/woops/woops-1.config b/cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops/woops-1.config similarity index 100% rename from cabal-testsuite/PackageTests/ConditionalAndImport/woops/woops-1.config rename to cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops/woops-1.config diff --git a/cabal-testsuite/PackageTests/ConditionalAndImport/woops/woops-3.config b/cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops/woops-3.config similarity index 100% rename from cabal-testsuite/PackageTests/ConditionalAndImport/woops/woops-3.config rename to cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops/woops-3.config diff --git a/cabal-testsuite/PackageTests/ConditionalAndImport/woops/woops-5.config b/cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops/woops-5.config similarity index 100% rename from cabal-testsuite/PackageTests/ConditionalAndImport/woops/woops-5.config rename to cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops/woops-5.config diff --git a/cabal-testsuite/PackageTests/ConditionalAndImport/woops/woops-7.config b/cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops/woops-7.config similarity index 100% rename from cabal-testsuite/PackageTests/ConditionalAndImport/woops/woops-7.config rename to cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops/woops-7.config diff --git a/cabal-testsuite/PackageTests/ConditionalAndImport/woops/woops-9.config b/cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops/woops-9.config similarity index 100% rename from cabal-testsuite/PackageTests/ConditionalAndImport/woops/woops-9.config rename to cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops/woops-9.config diff --git a/cabal-testsuite/PackageTests/ConditionalAndImport/cabal.out b/cabal-testsuite/PackageTests/ConditionalAndImport/cabal.out index 37b4b4b8f36..95d5e173cbd 100644 --- a/cabal-testsuite/PackageTests/ConditionalAndImport/cabal.out +++ b/cabal-testsuite/PackageTests/ConditionalAndImport/cabal.out @@ -379,336 +379,8 @@ Configuration is affected by the following files: imported by: yops/yops-1.config imported by: yops-0.project Up to date -# 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: -- woops-0-packages-in-root.project -- with-ghc.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops-0.config - imported by: woops-0-packages-in-root.project -- woops-2.config - imported by: woops/woops-1.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops-4.config - imported by: woops/woops-3.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops-4.config - imported by: woops/woops-3.config - imported by: woops-2.config - imported by: woops/woops-1.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops-6.config - imported by: woops/woops-5.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops-6.config - imported by: woops/woops-5.config - imported by: woops-4.config - imported by: woops/woops-3.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops-6.config - imported by: woops/woops-5.config - imported by: woops-4.config - imported by: woops/woops-3.config - imported by: woops-2.config - imported by: woops/woops-1.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops-8.config - imported by: woops/woops-7.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops-8.config - imported by: woops/woops-7.config - imported by: woops-6.config - imported by: woops/woops-5.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops-8.config - imported by: woops/woops-7.config - imported by: woops-6.config - imported by: woops/woops-5.config - imported by: woops-4.config - imported by: woops/woops-3.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops-8.config - imported by: woops/woops-7.config - imported by: woops-6.config - imported by: woops/woops-5.config - imported by: woops-4.config - imported by: woops/woops-3.config - imported by: woops-2.config - imported by: woops/woops-1.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops/woops-1.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops/woops-3.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops/woops-3.config - imported by: woops-2.config - imported by: woops/woops-1.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops/woops-5.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops/woops-5.config - imported by: woops-4.config - imported by: woops/woops-3.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops/woops-5.config - imported by: woops-4.config - imported by: woops/woops-3.config - imported by: woops-2.config - imported by: woops/woops-1.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops/woops-7.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops/woops-7.config - imported by: woops-6.config - imported by: woops/woops-5.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops/woops-7.config - imported by: woops-6.config - imported by: woops/woops-5.config - imported by: woops-4.config - imported by: woops/woops-3.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops/woops-7.config - imported by: woops-6.config - imported by: woops/woops-5.config - imported by: woops-4.config - imported by: woops/woops-3.config - imported by: woops-2.config - imported by: woops/woops-1.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops/woops-9.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops/woops-9.config - imported by: woops-8.config - imported by: woops/woops-7.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops/woops-9.config - imported by: woops-8.config - imported by: woops/woops-7.config - imported by: woops-6.config - imported by: woops/woops-5.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops/woops-9.config - imported by: woops-8.config - imported by: woops/woops-7.config - imported by: woops-6.config - imported by: woops/woops-5.config - imported by: woops-4.config - imported by: woops/woops-3.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- woops/woops-9.config - imported by: woops-8.config - imported by: woops/woops-7.config - imported by: woops-6.config - imported by: woops/woops-5.config - imported by: woops-4.config - imported by: woops/woops-3.config - imported by: woops-2.config - imported by: woops/woops-1.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops-2.config - imported by: woops/woops-1.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops-4.config - imported by: woops/woops-3.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops-4.config - imported by: woops/woops-3.config - imported by: woops-2.config - imported by: woops/woops-1.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops-6.config - imported by: woops/woops-5.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops-6.config - imported by: woops/woops-5.config - imported by: woops-4.config - imported by: woops/woops-3.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops-6.config - imported by: woops/woops-5.config - imported by: woops-4.config - imported by: woops/woops-3.config - imported by: woops-2.config - imported by: woops/woops-1.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops-8.config - imported by: woops/woops-7.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops-8.config - imported by: woops/woops-7.config - imported by: woops-6.config - imported by: woops/woops-5.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops-8.config - imported by: woops/woops-7.config - imported by: woops-6.config - imported by: woops/woops-5.config - imported by: woops-4.config - imported by: woops/woops-3.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops-8.config - imported by: woops/woops-7.config - imported by: woops-6.config - imported by: woops/woops-5.config - imported by: woops-4.config - imported by: woops/woops-3.config - imported by: woops-2.config - imported by: woops/woops-1.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops/woops-1.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops/woops-3.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops/woops-3.config - imported by: woops-2.config - imported by: woops/woops-1.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops/woops-5.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops/woops-5.config - imported by: woops-4.config - imported by: woops/woops-3.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops/woops-5.config - imported by: woops-4.config - imported by: woops/woops-3.config - imported by: woops-2.config - imported by: woops/woops-1.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops/woops-7.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops/woops-7.config - imported by: woops-6.config - imported by: woops/woops-5.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops/woops-7.config - imported by: woops-6.config - imported by: woops/woops-5.config - imported by: woops-4.config - imported by: woops/woops-3.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops/woops-7.config - imported by: woops-6.config - imported by: woops/woops-5.config - imported by: woops-4.config - imported by: woops/woops-3.config - imported by: woops-2.config - imported by: woops/woops-1.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops/woops-9.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops/woops-9.config - imported by: woops-8.config - imported by: woops/woops-7.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops/woops-9.config - imported by: woops-8.config - imported by: woops/woops-7.config - imported by: woops-6.config - imported by: woops/woops-5.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops/woops-9.config - imported by: woops-8.config - imported by: woops/woops-7.config - imported by: woops-6.config - imported by: woops/woops-5.config - imported by: woops-4.config - imported by: woops/woops-3.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -- https://www.stackage.org/lts-21.25/cabal.config - imported by: woops/woops-9.config - imported by: woops-8.config - imported by: woops/woops-7.config - imported by: woops-6.config - imported by: woops/woops-5.config - imported by: woops-4.config - imported by: woops/woops-3.config - imported by: woops-2.config - imported by: woops/woops-1.config - imported by: woops-0.config - imported by: woops-0-packages-in-root.project -Resolving dependencies... -Up to date # checking "using config from message" without URI imports # cabal v2-build -# checking "using config from message" with URI imports -# cabal v2-build # checking bad conditional # cabal v2-build Error: [Cabal-7090] diff --git a/cabal-testsuite/PackageTests/ConditionalAndImport/cabal.test.hs b/cabal-testsuite/PackageTests/ConditionalAndImport/cabal.test.hs index 519b1225734..31bdf80ee4e 100644 --- a/cabal-testsuite/PackageTests/ConditionalAndImport/cabal.test.hs +++ b/cabal-testsuite/PackageTests/ConditionalAndImport/cabal.test.hs @@ -258,9 +258,6 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do 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 if we detect when the same config is imported via many different paths (we don't)" - woopping <- cabal' "v2-build" [ "--project-file=woops-0-packages-in-root.project" ] - log "checking \"using config from message\" without URI imports" withDirectory "yops" $ do yopping <- fails $ cabal' "v2-build" [ "--dry-run", "--project-file=../yops-0.project" ] @@ -296,41 +293,6 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do return () - log "checking \"using config from message\" with URI imports" - withDirectory "woops" $ do - woopping <- fails $ cabal' "v2-build" [ "--dry-run", "--project-dir=..", "--project-file=woops-0-packages-in-woops.project" ] - - -- Use assertRegex when the output is tainted by the temp directory, like - -- this: - -- - -- When using configuration from: - -- - /tmp/cabal-testsuite-282695/woops-0.project - -- - /tmp/cabal-testsuite-282695/woops-2.config etc - assertRegex - "Project configuration with URI imports is listed in full" - "When using configuration from:(\n|\r\n) \ - \ .*woops-0-packages-in-woops\\.project(\n|\r\n) \ - \ .*with-ghc\\.config(\n|\r\n) \ - \ .*woops-0\\.config(\n|\r\n) \ - \ .*woops-2\\.config(\n|\r\n) \ - \ .*woops-4\\.config(\n|\r\n) \ - \ .*woops-6\\.config(\n|\r\n) \ - \ .*woops-8\\.config(\n|\r\n) \ - \ .*woops-1\\.config(\n|\r\n) \ - \ .*woops-3\\.config(\n|\r\n) \ - \ .*woops-5\\.config(\n|\r\n) \ - \ .*woops-7\\.config(\n|\r\n) \ - \ .*woops-9\\.config(\n|\r\n) \ - \ .*https://www.stackage.org/lts-21.25/cabal.config(\n|\r\n)" - woopping - - assertOutputContains - "The following errors occurred: \ - \ - The package directory 'woops' does not contain any .cabal file." - woopping - - return () - 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 diff --git a/cabal-testsuite/PackageTests/ConditionalAndImport/woops-0-packages-in-root.project b/cabal-testsuite/PackageTests/ConditionalAndImport/woops-0-packages-in-root.project deleted file mode 100644 index a1f15f5d996..00000000000 --- a/cabal-testsuite/PackageTests/ConditionalAndImport/woops-0-packages-in-root.project +++ /dev/null @@ -1,3 +0,0 @@ -packages: . - -import: woops-0.config