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

Warning source repeatedly wrong with unrecognized section #10635

Open
philderbeast opened this issue Dec 12, 2024 · 0 comments
Open

Warning source repeatedly wrong with unrecognized section #10635

philderbeast opened this issue Dec 12, 2024 · 0 comments

Comments

@philderbeast
Copy link
Collaborator

Describe the bug
The warning message for a mis-typed comment in a project import repeats the project name but not the source of the parse error.

To Reproduce
Take the test from #10546 and modify it:

$ git diff
diff --git \
   a/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromSimple/z-empty.config \
   b/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromSimple/z-empty.config
index 771bb389f..9a8cd37b9 100644
--- a/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromSimple/z-empty.config
+++ b/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromSimple/z-empty.config
@@ -1 +1 @@
--- This file is intentionally empty, just this comment.
+- This file is intentionally empty, just this comment.
$ ~/.ghcup/bin/cabal-3.12.1.0 build all --dry-run
...
Warning:
/.../cabal/cabal-testsuite/PackageTests/ProjectImport/DedupUsingConfigFromSimple/cabal.project,
cabal.project, cabal.project, cabal.project, cabal.project, cabal.project,
cabal.project, cabal.project, cabal.project, cabal.project, cabal.project,
cabal.project, cabal.project, cabal.project, cabal.project, cabal.project,
cabal.project: Unrecognized section '-' on line 1
When using configuration from:
  - a-very-extra.config
  - an-extra.config
  - cabal.project
  - 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
  - with-ghc.config
  - z-empty.config
The following errors occurred:
  - The package location 'no-pkg-dir' does not exist.

Expected behavior
I'd expect that the source file z-empty.config would have been mentioned for the "Unrecognized section '-'". Mentioning cabal.project repeatedly is now redundant with the "using configuration from" message of #9985.

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

No branches or pull requests

1 participant