diff --git a/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromSimple/cabal.project b/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromSimple/cabal.project index 5933ea2efc4..32308f3491f 100644 --- a/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromSimple/cabal.project +++ b/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromSimple/cabal.project @@ -1,4 +1,5 @@ packages: no-pkg-dir +import: z-empty.config import: an-extra.config import: an-extra.config import: a-very-extra.config diff --git a/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromSimple/cabal.test.hs b/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromSimple/cabal.test.hs index 594e6020f11..cf37d1621a6 100644 --- a/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromSimple/cabal.test.hs +++ b/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromSimple/cabal.test.hs @@ -17,6 +17,7 @@ main = cabalTest . recordMode RecordMarked $ do \ .*a-very-extra\\.config(\n|\r\n) \ \ .*an-extra\\.config(\n|\r\n) \ \ .*with-ghc\\.config(\n|\r\n) \ + \ .*z-empty\\.config(\n|\r\n) \ \ .*https://www.stackage.org/lts-21.25/cabal.config(\n|\r\n)" out diff --git a/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromSimple/z-empty.config b/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromSimple/z-empty.config new file mode 100644 index 00000000000..771bb389fde --- /dev/null +++ b/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromSimple/z-empty.config @@ -0,0 +1 @@ +-- This file is intentionally empty, just this comment. diff --git a/changelog.d/pr-10546 b/changelog.d/pr-10546 index ed87e56459c..db0951505f0 100644 --- a/changelog.d/pr-10546 +++ b/changelog.d/pr-10546 @@ -7,19 +7,22 @@ prs: 10546 ## Using Configuration From Message Changes Deduplicates and sorts the list of configuration files and URIs printed with the -"using configuration from" messages. This is the message shown when there's a -build failure. We can trigger that message by using a non-existant package in -the project, "no-pkg-dir". +"using configuration from" message. This message is shown when there's a build +failure. We can trigger that message by using a non-existant package in the +project, "no-pkg-dir". If an import is repeated in a `.project` or `.config` file it only imported once -but if the same import is made from an imported file then it is repeated in the -message. +but if the same import is made from an imported file then it was being repeated +in the message. Additional problems were not showing the project first and +mixing configuration files and URIs together. * The test set up: ``` $ cat cabal.project + cat cabal.project packages: no-pkg-dir + import: z-empty.config import: an-extra.config import: an-extra.config import: a-very-extra.config @@ -34,6 +37,9 @@ message. $ cat a-very-extra.config import: https://www.stackage.org/lts-21.25/cabal.config import: https://www.stackage.org/lts-21.25/cabal.config + + $ cat z-empty.config + - This file is intentionally empty, just this comment. ``` * Before the fix: @@ -47,6 +53,7 @@ message. - https://www.stackage.org/lts-21.25/cabal.config - https://www.stackage.org/lts-21.25/cabal.config - https://www.stackage.org/lts-21.25/cabal.config + - z-empty.config The following errors occurred: - The package location 'no-pkg-dir' does not exist. ``` @@ -59,6 +66,7 @@ message. - cabal.project - a-very-extra.config - an-extra.config + - z-empty.config - https://www.stackage.org/lts-21.25/cabal.config The following errors occurred: - The package location 'no-pkg-dir' does not exist.