-
Notifications
You must be signed in to change notification settings - Fork 696
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
Deduplicate "using config from" message #10546
base: master
Are you sure you want to change the base?
Deduplicate "using config from" message #10546
Conversation
290bd75
to
8423986
Compare
I think it fixes only part of the duplication problem in the snippet you reference. I.e. it dedups file names but it doesn't dedup the phrase notice verbosity . render . vcat $
text "Configuration is affected by the following files:"
: [ text "-" <+> docProjectConfigPath path
| Explicit path <- Set.toList $ projectConfigProvenance projectConfig
]
|
8423986
to
f6a310b
Compare
I'm already doing dedup of the intro message as a part of #10548 btw. It'd be best if this one only handled the Ord instance. It's also a bit more complicated than I said above: with implicit config provenance, it'll print the intro message and then nothing else, which doesn't make sense. THis is not hard to fix of course. |
f6a310b
to
f28cb93
Compare
@mpickering for these added tests do we already have a normalization of the project root directory for tests, something like $ git diff
...
--- a/cabal-testsuite/PackageTests/ConditionalAndImport/cabal.test.hs
+++ b/cabal-testsuite/PackageTests/ConditionalAndImport/cabal.test.hs
@@ -261,6 +261,49 @@ 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)"
woopping <- cabal' "v2-build" [ "--project-file=woops-0.project" ]
+ log "checking \"using config from message\" without URI imports"
+ withDirectory "yops" $ do
+ yopping <- fails $ cabal' "v2-build" [ "--project-file=../yops-0.project" ]
+ assertOutputContains
+ (normalizeWindowsOutput "When using configuration from: \
+ \ - /tmp/cabal-testsuite-286573/yops-0.project \
+ \ - /tmp/cabal-testsuite-286573/yops-2.config \
+ \ - /tmp/cabal-testsuite-286573/yops-4.config \
+ \ - /tmp/cabal-testsuite-286573/yops-6.config \
+ \ - /tmp/cabal-testsuite-286573/yops-8.config \
+ \ - /tmp/cabal-testsuite-286573/yops/yops-1.config \
+ \ - /tmp/cabal-testsuite-286573/yops/yops-3.config \
+ \ - /tmp/cabal-testsuite-286573/yops/yops-5.config \
+ \ - /tmp/cabal-testsuite-286573/yops/yops-7.config \
+ \ - /tmp/cabal-testsuite-286573/yops/yops-9.config \
+ \ The following errors occurred: \
+ \ - The package directory '.' does not contain any .cabal file.")
+ yopping
+
+ return ()
+
+ log "checking \"using config from message\" with URI imports"
+ withDirectory "woops" $ do
+ woopping <- fails $ cabal' "v2-build" [ "--project-file=../woops-0.project" ]
+ assertOutputContains
+ (normalizeWindowsOutput "When using configuration from: \
+ \ - /tmp/cabal-testsuite-282695/woops-0.project \
+ \ - /tmp/cabal-testsuite-282695/woops-2.config \
+ \ - /tmp/cabal-testsuite-282695/woops-4.config \
+ \ - /tmp/cabal-testsuite-282695/woops-6.config \
+ \ - /tmp/cabal-testsuite-282695/woops-8.config \
+ \ - /tmp/cabal-testsuite-282695/woops/woops-1.config \
+ \ - /tmp/cabal-testsuite-282695/woops/woops-3.config \
+ \ - /tmp/cabal-testsuite-282695/woops/woops-5.config \
+ \ - /tmp/cabal-testsuite-282695/woops/woops-7.config \
+ \ - /tmp/cabal-testsuite-282695/woops/woops-9.config \
+ \ - https://www.stackage.org/lts-21.25/cabal.config \
+ \ The following errors occurred: \
+ \ - The package directory '.' does not contain any .cabal file.")
+ woopping
+
+ return () |
The previous person who bumped into this problem wasn't able to find an existing solution: #8617 (comment) |
bf674e3
to
7070d18
Compare
@ulysses4ever and @mpickering, to get around the I see that cabal/cabal-testsuite/src/Test/Cabal/Monad.hs Lines 790 to 791 in 7de199a
|
This will need another review because previously I'd mucked up the |
I didn't add a test of an http import importing another http config file. Two possible ways of doing this are running a local server for the test or picking up the import from somewhere like |
I'm traveling this week, so will only be able to get to this next week at earliest. Sorry! |
@ulysses4ever there are two similar messages. You've dealt with the
|
7070d18
to
88b92e6
Compare
a565c1e
to
b364cd8
Compare
The CI rework (#10503) speeds CI up enormously, fwiw. |
I am tempted to say it's the test that was wrong (and recorded as such): should it really have been up to date on creation? That said, it only happening on Windows is worrisome. (But I'm shortly leaving for another doctor appointment, and in any case I can't test on Windows here.) |
b364cd8
to
af5f4bb
Compare
- Consider URI in Ord instance
- Add unconsProjectConfigPath - Add docProjectConfigFiles
- Regen expected output without duplication
- Use with-ghc.config with woops project
- docProjectConfigFiles is the better name when not reporting "imported by"
af5f4bb
to
9a4242a
Compare
Adds an
Ord
instance forProjectConfigPath
and fixes the duplication in the reported "Configuration is affected by the following files", fixes #10509 by usingdocProjectConfigFiles
instead ofdocProjectConfigPath
.Template Α: This PR modifies behaviour or interface
Include the following checklist in your PR:
significance: significant
in the changelog file.