-
Notifications
You must be signed in to change notification settings - Fork 704
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9792 from haskell/mergify/bp/3.12/pr-9768
Make `check` recognise `main-is` in conditional branches (backport #9768)
- Loading branch information
Showing
14 changed files
with
216 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# cabal check | ||
No errors or warnings could be found in the package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- `main-is` in both branches is not missing (after). | ||
main = cabalTest $ | ||
cabal "check" [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
cabal-version: 3.0 | ||
name: pkg | ||
synopsis: synopsis | ||
description: description | ||
version: 0 | ||
category: example | ||
maintainer: none@example.com | ||
license: GPL-3.0-or-later | ||
|
||
flag my-flag | ||
description: Test for branches. | ||
default: False | ||
manual: True | ||
|
||
executable exe | ||
if os(windows) | ||
ghc-options: -pgml misc/static-libstdc++ | ||
|
||
if flag(my-flag) | ||
main-is: Main.hs | ||
build-depends: async, unix | ||
c-sources: executable/link.c | ||
else | ||
main-is: ParallelMain.hs | ||
|
||
default-language: Haskell2010 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# cabal check | ||
No errors or warnings could be found in the package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- `main-is` in both branches is not missing. | ||
main = cabalTest $ | ||
cabal "check" [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
cabal-version: 3.0 | ||
name: pkg | ||
synopsis: synopsis | ||
description: description | ||
version: 0 | ||
category: example | ||
maintainer: none@example.com | ||
license: GPL-3.0-or-later | ||
|
||
flag my-flag | ||
description: Test for branches. | ||
default: False | ||
manual: True | ||
|
||
executable exe | ||
if flag(my-flag) | ||
main-is: Main.hs | ||
build-depends: async, unix | ||
c-sources: executable/link.c | ||
else | ||
main-is: ParallelMain.hs | ||
|
||
if os(windows) | ||
ghc-options: -pgml misc/static-libstdc++ | ||
|
||
default-language: Haskell2010 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# cabal check | ||
No errors or warnings could be found in the package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- `main-is` in both branches is not missing (deep). | ||
main = cabalTest $ | ||
cabal "check" [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
cabal-version: 3.0 | ||
name: pkg | ||
synopsis: synopsis | ||
description: description | ||
version: 0 | ||
category: example | ||
maintainer: none@example.com | ||
license: GPL-3.0-or-later | ||
|
||
flag my-flag | ||
description: Test for branches. | ||
default: False | ||
manual: True | ||
|
||
flag another-flag | ||
description: Deep test for branches. | ||
default: False | ||
manual: True | ||
|
||
executable exe | ||
if flag(my-flag) | ||
if flag(another-flag) | ||
main-is: Main.hs | ||
build-depends: async, unix | ||
c-sources: executable/link.c | ||
else | ||
main-is: AnotherMain.hs | ||
else | ||
main-is: ParallelMain.hs | ||
|
||
if os(windows) | ||
ghc-options: -pgml misc/static-libstdc++ | ||
|
||
default-language: Haskell2010 |
5 changes: 5 additions & 0 deletions
5
cabal-testsuite/PackageTests/Check/Cond/DeepMissing/cabal.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# cabal check | ||
The package will not build sanely due to these errors: | ||
Error: [no-main-is] No 'main-is' field found for executable exe | ||
Error: Hackage would reject this package. | ||
|
5 changes: 5 additions & 0 deletions
5
cabal-testsuite/PackageTests/Check/Cond/DeepMissing/cabal.test.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- `main-is` in both branches is not missing (deep, actually missing). | ||
main = cabalTest $ | ||
fails $ cabal "check" [] |
35 changes: 35 additions & 0 deletions
35
cabal-testsuite/PackageTests/Check/Cond/DeepMissing/pkg.cabal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
cabal-version: 3.0 | ||
name: pkg | ||
synopsis: synopsis | ||
description: description | ||
version: 0 | ||
category: example | ||
maintainer: none@example.com | ||
license: GPL-3.0-or-later | ||
|
||
flag my-flag | ||
description: Test for branches. | ||
default: False | ||
manual: True | ||
|
||
flag another-flag | ||
description: Deep test for branches. | ||
default: False | ||
manual: True | ||
|
||
executable exe | ||
if flag(my-flag) | ||
if flag(another-flag) | ||
main-is: Main.hs | ||
build-depends: async, unix | ||
c-sources: executable/link.c | ||
else | ||
build-depends: async, unix | ||
c-sources: executable/link.c | ||
else | ||
main-is: ParallelMain.hs | ||
|
||
if os(windows) | ||
ghc-options: -pgml misc/static-libstdc++ | ||
|
||
default-language: Haskell2010 |