Skip to content

Commit 0d1b5d5

Browse files
committed
Don't report unused packages in tests
For not, '-Wno-redundant-constraints' is needed in testing libraries to prevent false-positives that lead to build errors with `-Werror`. See https://gitlab.haskell.org/ghc/ghc/-/issues/24173 for details.
1 parent ee9a4f9 commit 0d1b5d5

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

cardano-diffusion/cardano-diffusion.cabal

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,16 @@ common ghc-options
4747
-- in tests librararies redundant constraints are sometimes useful (e.g.
4848
-- by default truned off debug tracing might require extra constraints like
4949
-- `Show` or `MonadSay`).
50+
--
51+
-- TODO: '-Wno-redundant-constraints' remove when we support
52+
-- `quickcheck-monoids`. For now, it is needed to prevent
53+
-- false-positives that lead to build errors with `-Werror`.
54+
-- See https://gitlab.haskell.org/ghc/ghc/-/issues/24173 for details.
5055
common ghc-options-tests
5156
import: ghc-options
52-
ghc-options: -Wno-redundant-constraints
57+
ghc-options:
58+
-Wno-redundant-constraints
59+
-Wno-unused-packages
5360

5461
library api
5562
import: ghc-options

ouroboros-network/ouroboros-network.cabal

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,16 @@ common ghc-options
5555
-- in tests librararies redundant constraints are sometimes useful (e.g.
5656
-- by default truned off debug tracing might require extra constraints like
5757
-- `Show` or `MonadSay`).
58+
--
59+
-- TODO: '-Wno-redundant-constraints' remove when we support
60+
-- `quickcheck-monoids`. For now, it is needed to prevent
61+
-- false-positives that lead to build errors with `-Werror`.
62+
-- See https://gitlab.haskell.org/ghc/ghc/-/issues/24173 for details.
5863
common ghc-options-tests
5964
import: ghc-options
60-
ghc-options: -Wno-redundant-constraints
65+
ghc-options:
66+
-Wno-redundant-constraints
67+
-Wno-unused-packages
6168

6269
library api
6370
import: ghc-options
@@ -451,7 +458,7 @@ library tests-lib
451458
cpp-options: -DNIGHTLY
452459

453460
test-suite tests-lib-tests
454-
import: ghc-options
461+
import: ghc-options-tests
455462
type: exitcode-stdio-1.0
456463
main-is: Main.hs
457464
hs-source-dirs: tests-lib/tests
@@ -468,7 +475,7 @@ test-suite tests-lib-tests
468475
-threaded
469476

470477
library framework-tests-lib
471-
import: ghc-options
478+
import: ghc-options-tests
472479
mixins:
473480
QuickCheck hiding (Test.QuickCheck.Monoids)
474481

@@ -500,7 +507,7 @@ library framework-tests-lib
500507
typed-protocols:{typed-protocols, examples},
501508

502509
test-suite framework-sim-tests
503-
import: ghc-options
510+
import: ghc-options-tests
504511
mixins:
505512
QuickCheck hiding (Test.QuickCheck.Monoids)
506513

@@ -547,7 +554,7 @@ test-suite framework-sim-tests
547554
cpp-options: -DOUROBOROS_NETWORK_IPV6
548555

549556
test-suite framework-io-tests
550-
import: ghc-options
557+
import: ghc-options-tests
551558
type: exitcode-stdio-1.0
552559
main-is: Main.hs
553560
hs-source-dirs: framework/io-tests
@@ -583,7 +590,7 @@ test-suite framework-io-tests
583590
-threaded
584591

585592
library orphan-instances
586-
import: ghc-options
593+
import: ghc-options-tests
587594
visibility: public
588595
hs-source-dirs: orphan-instances
589596
exposed-modules:
@@ -742,7 +749,7 @@ library protocols
742749
typed-protocols:{typed-protocols, cborg, stateful, stateful-cborg} ^>=1.1,
743750

744751
library protocols-tests-lib
745-
import: ghc-options
752+
import: ghc-options-tests
746753
visibility: public
747754
hs-source-dirs: protocols/tests-lib
748755
exposed-modules:

0 commit comments

Comments
 (0)