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

Missing line numbers in cabal.project parse failure errors #10611

Open
9999years opened this issue Dec 2, 2024 · 2 comments
Open

Missing line numbers in cabal.project parse failure errors #10611

9999years opened this issue Dec 2, 2024 · 2 comments
Labels
needs triage re: error-message Concerning error messages delivered to the user re: project-file Concerning cabal.project files re: user experience User experience (UX) issue

Comments

@9999years
Copy link
Collaborator

Describe the bug
If a source-repository-package is missing its type field, the error message doesn't report a line number.

To Reproduce
Steps to reproduce the behavior:

$ cd $(mktemp -d)
$ echo > cabal.project
$ echo >> cabal.project
$ echo source-repository-package >> cabal.project
$ cabal build
Error: [Cabal-7090]
Error parsing project file /my-project/cabal.project:
???:0:0: "type" field missing

Expected behavior
The error message should show the line number containing the error.

System information

  • Operating system: macOS 15.1.1 (24B91)
  • Cabal: 3.12.1.0

Additional context
The error message is the same on the latest master commit (55ccc0a).

@9999years 9999years added re: project-file Concerning cabal.project files re: user experience User experience (UX) issue needs triage re: error-message Concerning error messages delivered to the user labels Dec 2, 2024
@9999years
Copy link
Collaborator Author

The error comes from here:

Nothing -> parseFatalFailure zeroPos $ show fn ++ " field missing"
Just [] -> parseFatalFailure zeroPos $ show fn ++ " field missing"

The class has no way to include a line number, so it just gets dropped...

@ulysses4ever
Copy link
Collaborator

I first hoped that #8889 could fix it but given the source of the issue above, that looks unlikely :'-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage re: error-message Concerning error messages delivered to the user re: project-file Concerning cabal.project files re: user experience User experience (UX) issue
Projects
None yet
Development

No branches or pull requests

2 participants