-
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
Improve "Cannot read .cabal file inside ..." errors #10647
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have (a) a PR template and (b) a changelog entry, since this is user visible? Otherwise, nice.
e7e04d9
to
35917bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
35917bf
to
29be740
Compare
OK, added a changelog entry and updated the test suite. I think moving |
906397d
to
97a94a7
Compare
This error message was very confusing -- it doesn't tell you what `.cabal` file it's looking for or why it cannot read the `.cabal` file. (Did it fail to parse the `.tar` archive itself? Did parsing the `.cabal` file fail? If so, why?) This patch improves the error message to include the name of the `.cabal` file being searched for. Additionally, parse errors and warnings are printed, as are format failures in the tarball itself. I ran into this error while I was writing tests for Cabal and it confused the hell out of me; this is an expanded version of the changes I made to help debug that failure. Before: ``` Error: [Cabal-7046] Cannot read .cabal file inside my-lib-1.0.tar.gz ``` After: ``` Error: In <ROOT>/cabal.dist/repo/my-lib-1.0.tar.gz: Errors encountered when parsing cabal file my-lib-1.0/my-lib.cabal: my-lib-1.0/my-lib.cabal:4:22: error: unexpected Unknown SPDX license identifier: 'puppy' 3 | version: 1.0 4 | license: puppy license :) | ^ my-lib-1.0/my-lib.cabal:5:1: warning: Unknown field: "puppy" 4 | license: puppy license :) 5 | puppy: teehee! | ^ Error: [Cabal-7046] Failed to read my-lib-1.0/my-lib.cabal from archive <ROOT>/cabal.dist/repo/my-lib-1.0.tar.gz ```
298df94
to
0eabec2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am afraid I have to request changes until the comment below is taken care of. I will push a branch that implements the changes I describe, to merge into this one.
Fix local+noindex repos on Windows
I'm sorry it seems like it needs a formatting change. Here is a patch to apply |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for merging the PR.
Oof we need to add |
Aha I see those errors and they are because of
So I guess we will have to split the string? |
Here is a patch I would push for this change. |
@jasagredo I'm going to undo your changes for now, let this get merged with the hack, and then we can see about making it cleaner in a follow-up PR. |
This reverts commit 4917d57.
This pull request has been removed from the queue for the following reason: The pull request can't be updated. You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
/cc: @9999years |
You had the bad luck of being in the queue behind another PR, so it needs to be rebased again. It still has |
This error message was very confusing -- it doesn't tell you what
.cabal
file it's looking for or why it cannot read the.cabal
file. (Did it fail to parse the.tar
archive itself? Did parsing the.cabal
file fail? If so, why?)This patch improves the error message to include the name of the
.cabal
file being searched for. Additionally, parse errors and warnings are printed, as are format failures in the tarball itself.I ran into this error while I was writing tests for Cabal and it confused the hell out of me; this is an expanded version of the changes I made to help debug that failure.
Before:
After:
changelog.d/pr-YOUR_PR_NUMBER
base
and third-party library imports use qualified imports or explicit import lists