-
Notifications
You must be signed in to change notification settings - Fork 705
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
Parse failure for 'if' with flags inside test-suite #5055
Comments
So far I think this is a documentation bug Trying with
For now you can workaround this by writing (conditional statements are interpreted after "main" body):
or having dummy module Main (main) where
import Tests (main) and
Currently we are conservative when checking that test-suite always have Now as I look into the code, that check looks fishy anyway as
works AND with current-ish
which should fail and does fail with
that said, I think that fix won't be invasive. May need to change the public interface of |
@phadej Thanks a lot for your response! Your workarounds really help me 👍 |
This is not a proper fix, but we are more conservative than is strictly required. I.e. each "branch" must have `type`. Also as `type` is set, then `main-is` (or module) have to be specified, because of `validate*` functions. The `onAllBranches` is wrong. But we can fix (i.e. relax) it for Cabal-2.4
This is not a proper fix, but we are more conservative than is strictly required. I.e. each "branch" must have `type`. Also as `type` is set, then `main-is` (or module) have to be specified, because of `validate*` functions. The `onAllBranches` is wrong. But we can fix (i.e. relax) it for Cabal-2.4 /Note:/ regressions/issue-5055.format: it's broken as there isn't `main-is` `os(windows) conditional branch in the formatted output.
Make Cabal-2.2 behave like Cabal-2.0 related to #5055
Fixed by #5076. |
I'm following these suggestions from official documentation to use different
main
files for different flags:But when I'm trying to use this approach for my test-suite I see parsing error when using
cabal new-build
command.Expected behavior
Build without problems
Observed behavior
I've tried to create minimal reproducible example. You can see it here:
The text was updated successfully, but these errors were encountered: