-
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
Misspelled user-flags (-f
) are silently ignored
#7813
Comments
This is tricky. What if a version of package doesn't have (an automatic) flag. Should it be omitted by a solver? What if there is a package in the transitive dependency tree which uses I think you ask for a feature, which is not yet described precisely. |
The documentation is a bit scarce, I found these pages:
From there, I could not understand the concept of flags completely.
My natural assumption is that if I pass Under the correctness of my assumption, it would not matter if some dependency accepts the miss-spelled
This is more tricky. So the set of valid flags for a package depends on the version of that package. We can be conservative and take the union of all flags that have existed and exist now for this package. This would still allow me to catch most misspellings. Nonwithstanding the exact workings of flags, this improvement should always work:
(This is a bit comparable to a unused-import-warning in a compiler.) However, I would think scoping of flags can be exploited for a firmer error report. |
Hmm. Seems so that But this drives me nuts as |
Not anymore: #3883 (comment) |
I have another example but this time for a flag no longer used by a package. I'd like to be warned about obsolete flags. I tried to build haskell/cabal@976f86/cabal.project with stack (after generating the equivalent
If I do active-repositories: hackage.haskell.org:merge
constraints: any.Diff ==0.5,
...
any.these ==1.2,
...
index-state: hackage.haskell.org 2023-11-09T18:29:02Z For comparison, here's stack's full warning:
|
@philderbeast your example illustrates why miss-spelling a flag should never be an error. Also
In FWIW, this is another example where I think that |
💯 agree with @phadej. I am afraid separating the CLI will take some work but perhaps there's a quicker way to parse per-package flags? There is also the issue that project config goes through the legay |
To be clear, one can specify flags per-package on the command line, through the Setup.hs interface even, by passing flag settings via |
Misspelled user-flags (
-f
) are silently ignored. In the wild:Swallowing errors: not a good UI.
The text was updated successfully, but these errors were encountered: