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 · May be fixed by #10644
Open

Warning source repeatedly wrong with unrecognized section #10635

philderbeast opened this issue Dec 12, 2024 · 0 comments · May be fixed by #10644
Assignees
Labels
re: project-file Concerning cabal.project files type: bug

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.

@philderbeast philderbeast self-assigned this Dec 14, 2024
@philderbeast philderbeast linked a pull request Dec 16, 2024 that will close this issue
6 tasks
@ulysses4ever ulysses4ever added re: project-file Concerning cabal.project files and removed needs triage labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
re: project-file Concerning cabal.project files type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants