Skip to content

How to specify flag A XOR flag B / reject install plan? (from darcs) #3742

Open
@ezyang

Description

@ezyang

In Darcs, there is some code that looks like this:

    if (!flag(curl) && !flag(http))
        buildable: False

I think the intent is to say, "Darcs needs either the curl or http flag to be turned on." But I don't think this is the right way to go about doing it: this says that it is acceptable for Cabal to set curl and http false; the only consequence is the library isn't buildable. If we somehow have a constraint that the library must be buildable, I suppose this has the desired effect if darcs is a dependency (I imagine the solver then requires the library to be buildable), but if you run cabal configure there's no reason to enable the library (well, if we want to build the executable there is, but you could also set the executable flag false and now nothing is built.)

Question 1: What's the right way to write the logic program that is desired here?

Question 2: How should we document this, and educate users to write logic programs that actually work?

I got this from #3740.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions