-
Notifications
You must be signed in to change notification settings - Fork 724
Open
Labels
Cabal: parserre: conditionalAbout conditional declarations in cabal files(`if`)About conditional declarations in cabal files(`if`)type: bugtype: user-question
Description
Using an if/else block to provide alternative main-is values in the test-suite stanza results in a parsing error:
Test suite "cabal-bug" is missing required field "type" or the field is not present in all conditional branches.
A workaround is to include type field in both branches, as suggested by the error message:
if flag(breaks)
main-is: Main1.hs
type: exitcode-stdio-1.0
else
main-is: Main2.hs
type: exitcode-stdio-1.0
If this is the expected behavior, the error message could possibly be expressed more clearly, or the documentation could state the type field should be present in all conditional branches.
Tested on cabal version 3.0.0.
Metadata
Metadata
Assignees
Labels
Cabal: parserre: conditionalAbout conditional declarations in cabal files(`if`)About conditional declarations in cabal files(`if`)type: bugtype: user-question