-
Notifications
You must be signed in to change notification settings - Fork 711
Spurious duplicate modules error #7525
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
Comments
I think it's worth designing a check that warns of such use of flags (even when the two module differ and so there's no error). I've just heard today experienced devs stating that cabal flags should not change a package API, as is the case in your example. Otherwise, flipping flags potentially causes breakage and cabal can't guess if it should rebuild half of package database or not to prevent it. Not to mention the horror of ensuring my package can handle various API-changing flags combinations of packages it depends on. Also, each if-then-else can double the time solving takes, because it can change what a package depends on. That gets nasty long before 5 flags. |
Having said that, if your goal is to conditionally expose internal modules, perhaps it can be done by putting them in an internal library, using in a library with exposed modules, and placing |
It sounds like we're just parsing through the relevant flags |
@emilypi: however, which flag values should |
@Mikolaj let's think about it - i dont know
"Flattening" branches seems to be happening here, and its wrong in this case. |
AHA!
From
|
Related: #4629 |
Curiouser and curiouser! Apart from performance, is there any other reason as to why this flattening behaviour, without considering the conditionals, would be desired? |
Laziness (in the pejorative sense) :) |
I would say this is duplicate of #4629 so I would close it |
Unless @Bodigrim objects, I think it makes sense to close. |
definitely a dup, closing. |
Uh oh!
There was an error while loading. Please reload this page.
cabal check
is unhappy with this:I understand that it's a tricky situation for
cabal
and that potentially there could be exponentially many flag combinations, but practically, when number of flags is < 5, I'd expectcabal
to evaluate all possible combinations and validate respective configurations independently.The text was updated successfully, but these errors were encountered: