-
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
"cabal: Internal error in target matching" (was: Internal error/infinite loop in D.Client.TargetSelector) #5081
Comments
/cc @dcoutts, may be caused by your recent patches. |
I found it, I'll send a PR |
The pattern guard was clearly meant as a list-comprehension filter, but on a let-bound pattern, it instead caused a circular loop in which whether the LHS variables are bound the the RHS values depends on the values of the LHS variables. fixes #5081
Reopening, since there is still an internal error. After #5263, cabal prints the full error message:
|
Ah, I thought this bug was only about the loop, but now that I am taking a closer look at the error message, it does say "Internal error", so I guess this error message isn't supposed to be displayed in the first place. Hmm, what's the desired behaviour instead? Let's see, if there is a package
So I think what is going on is that But wait, why is Okay, so apparently there are many more ways of specifying a target than I though. Only looking at packages, libraries (which have the same name as the package) and test suites, we have all of those possibilities:
So if the package and the test-suite are both named
Our bug seems to be in phase 4:
but since we're talking about a non-existing component, who knows which non-existing package name and component-name we should pick? I now think the expected behaviour should be to offer the following disambiguations:
Where the first disambiguation uses an empty package name, meaning the current package. That syntax doesn't refer to any package if the current folder uses a |
A simple reproducer for this internal error is:
cabal/cabal-testsuite/PackageTests/Regression/T4025/T4025.cabal Lines 1 to 15 in 95a9241
The error is likely caused by a The internal error goes away if I create a
[Meta: removing stalled assignment.] |
When using list-bin on https://gitlab.com/awjchen/hs-bittorrent , I get this error even without any cabal.project:
And even if I add one, I still get it. Should I open another issue? |
This is a bad error, but in this case it is because there is only one stanza, and that stanza is not named hs-bittorrent, but rather hs-bittorrent-exe. So the target selector needs to pick that.
|
I reproduced the issue on master (3781531) by running the following command in the cabal repository:
It also occurs when I run the same command on a simple project with one directory containing a simple .cabal file:
The error message is from D.Client.TargetSelector:
cabal/cabal-install/Distribution/Client/TargetSelector.hs
Line 653 in 3781531
The text was updated successfully, but these errors were encountered: