Skip to content

make cabal less chatty w.r.t. project files in use #10940

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ulysses4ever
Copy link
Collaborator

This is a WIP to fix #10885.


Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:

@ulysses4ever ulysses4ever force-pushed the cabal-project-message-less-chatty-t10885 branch 2 times, most recently from d2194da to 45dcb0d Compare April 26, 2025 23:49
@ulysses4ever ulysses4ever force-pushed the cabal-project-message-less-chatty-t10885 branch 6 times, most recently from 4501f79 to cc63eaf Compare May 13, 2025 23:09
@ulysses4ever ulysses4ever force-pushed the cabal-project-message-less-chatty-t10885 branch 3 times, most recently from 528cf85 to fae5b09 Compare May 19, 2025 15:59
@Mikolaj
Copy link
Member

Mikolaj commented May 27, 2025

Are you still seeing the problems in the CI? As in

I'm seeing weird (seemingly) unrelated test failures in CI (just several) on my draft PR and can't explain them.
They all seem to start with output:


+ /usr/bin/git ls-files --cached --modified


so that's a new line in the output, right? No idea where it comes from...

Here's an example run https://github.com/haskell/cabal/actions/runs/15117706253/job/42492471019

Would appreciate any insights...

@ulysses4ever
Copy link
Collaborator Author

@Mikolaj yes, that's why the pipelines are currently failing I believe

@Mikolaj
Copy link
Member

Mikolaj commented May 28, 2025

I don't think this + indicates an error, because it's not in the context of "Actual output differs from expected:" and there's no patch syntax (---, +++, @@ -1,7 +1,5 @@, etc.). See this real error from the same file for comparison:

Actual output differs from expected:

stderr:
--- /tmp/cabal-testsuite-154925/cabal.yes.dist/cabal.yes.out.normalized	2025-05-19 16:23:19.039827000 +0000
+++ /tmp/cabal-testsuite-154925/cabal.yes.dist/cabal.yes.comp.out.normalized	2025-05-19 16:23:19.039827000 +0000
@@ -1,7 +1,5 @@
 # cabal clean
 # cabal v2-repl
-Configuration is affected by the following files:
-- cabal.project
 Resolving dependencies...
 Build profile: -w ghc-<GHCVER> -O1
 In order, the following will be built:

*** unexpected failure for PackageTests/MultiRepl/CustomSetupKeepTempFiles/cabal.test.hs

@ulysses4ever
Copy link
Collaborator Author

Oh my, I had a feeling I lost my way in the output... I wonder if in the future we could try to avoid generating +'s like the one that confused me.

The actual failure is expected and will be fixed. The reason it wasn't fixed before is that when I ran the testsuite locally --accept'ing the necessary changes, this test failed with an exception in ProjectaOrchestration.hs. This is a discrepancy between my local setup and CI that probably deserves a separate ticket but let's not get bogged down by this.

Thanks for unlocking me! Now I can probably finish fixing tests at least.

@ulysses4ever ulysses4ever force-pushed the cabal-project-message-less-chatty-t10885 branch 2 times, most recently from 2f4b051 to df7fc70 Compare May 29, 2025 15:04
Comment on lines +470 to +472
map projectConfigPathRoot configFiles
L.\\ ["cabal.project", "cabal.project.local", "cabal.freeze"]
== []
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative is something like

Suggested change
map projectConfigPathRoot configFiles
L.\\ ["cabal.project", "cabal.project.local", "cabal.freeze"]
== []
all ((`elem` cwdProjectFiles) . projectConfigPathRoot) configFiles
cwdProjectFiles = ["cabal.project", "cabal.project.local", "cabal.freeze"]

[path1, path2] ->
text "Configuration is affected by '" <+> path1 <+> text "' and '" <+> path2 <+> text "'"
[path] ->
text "Configuration is affected by '" <+> path <+> text "'"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd expect

Suggested change
text "Configuration is affected by '" <+> path <+> text "'"
text "Configuration is affected by '" <> path <> text "'"

and similar above.

@ulysses4ever ulysses4ever force-pushed the cabal-project-message-less-chatty-t10885 branch from df7fc70 to 5c90821 Compare May 29, 2025 17:52
@ulysses4ever
Copy link
Collaborator Author

ulysses4ever commented May 29, 2025

2025-05-29T15:32:41.9907347Z PackageTests/JS/JSPPOptions/other-arch.test.hs                                                                    FAIL (2.94s)

I don't see this test in my tree — is it a ghost?

@geekosaur
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cabal got annoyingly chatty
4 participants