Encourage top-level build-depends
when it occurs in all branches of a conditional
#7768
Labels
cabal-install: cmd/check
re: conditional
About conditional declarations in cabal files(`if`)
type: enhancement
See e.g. jvranish/Lenses#3.
Currently hackage does not allow revision of conditionals, and it does not allow new
build-depends
.In the situation (1)
the constraints for
B
cannot be revised.Thus, the better practice is to put a top-level
B
with extra constraints in the conditional (2):If
cabal check
would suggest a adding a top-levelbuild-depends
that appears in all branches, that would help with revisions on hackage.Of course, this could also be fixed on the hackage side; in case it is fixed there by rejecting packages that could be rewritten from (1) to (2),
cabal check
should also warn about possible complaints by the hackage server.The text was updated successfully, but these errors were encountered: