Skip to content

Commit

Permalink
Remove Werror and move it to CI only
Browse files Browse the repository at this point in the history
  • Loading branch information
locallycompact authored and ch1bo committed Nov 6, 2023
1 parent 80c1b5d commit 8fc75af
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 108 deletions.
8 changes: 0 additions & 8 deletions hydra-cardano-api/hydra-cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ source-repository head
type: git
location: https://github.com/input-output-hk/hydra

flag hydra-development
description: Disable -Werror for development
default: False
manual: True

common project-config
default-language: GHC2021
default-extensions:
Expand All @@ -40,9 +35,6 @@ common project-config
-Wincomplete-uni-patterns -Wredundant-constraints -Wunused-packages
-fprint-potential-instances

if !flag(hydra-development)
ghc-options: -Werror

library
import: project-config
hs-source-dirs: src
Expand Down
8 changes: 0 additions & 8 deletions hydra-cluster/hydra-cluster.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ source-repository head
type: git
location: https://github.com/input-output-hk/hydra

flag hydra-development
description: Disable -Werror for development
default: False
manual: True

common project-config
default-language: GHC2021
default-extensions:
Expand All @@ -83,9 +78,6 @@ common project-config
-Wincomplete-uni-patterns -Wredundant-constraints -Wunused-packages
-fprint-potential-instances

if !flag(hydra-development)
ghc-options: -Werror

library
import: project-config
hs-source-dirs: src
Expand Down
12 changes: 1 addition & 11 deletions hydra-node/hydra-node.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ source-repository head
type: git
location: https://github.com/input-output-hk/hydra

flag hydra-development
description: Disable -Werror for development
default: False
manual: True

common project-config
default-language: GHC2021
default-extensions:
Expand All @@ -46,9 +41,6 @@ common project-config
-Wincomplete-uni-patterns -Wredundant-constraints -Wunused-packages
-fprint-potential-instances

if !flag(hydra-development)
ghc-options: -Werror

library
import: project-config
hs-source-dirs: src
Expand Down Expand Up @@ -229,9 +221,7 @@ benchmark tx-cost

ghc-options: -threaded -rtsopts

if flag(hydra-development)
-- NOTE(SN): should fix HLS choking on PlutusTx plugin
ghc-options: -fplugin-opt PlutusTx.Plugin:defer-errors
ghc-options: -fplugin-opt PlutusTx.Plugin:defer-errors

benchmark micro
import: project-config
Expand Down
8 changes: 0 additions & 8 deletions hydra-plutus-extras/hydra-plutus-extras.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ source-repository head
type: git
location: https://github.com/input-output-hk/hydra

flag hydra-development
description: Disable -Werror for development
default: False
manual: True

common project-config
default-language: GHC2021
default-extensions:
Expand All @@ -43,9 +38,6 @@ common project-config
-Wincomplete-uni-patterns -Wredundant-constraints -Wunused-packages
-fprint-potential-instances

if !flag(hydra-development)
ghc-options: -Werror

library
import: project-config
exposed-modules:
Expand Down
12 changes: 1 addition & 11 deletions hydra-plutus/hydra-plutus.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ source-repository head
type: git
location: https://github.com/input-output-hk/hydra

flag hydra-development
description: Disable -Werror for development
default: False
manual: True

common project-config
default-language: GHC2021
default-extensions:
Expand All @@ -43,9 +38,6 @@ common project-config
-fno-ignore-interface-pragmas -fno-omit-interface-pragmas
-fno-strictness

if !flag(hydra-development)
ghc-options: -Werror

library
import: project-config
exposed-modules:
Expand Down Expand Up @@ -86,9 +78,7 @@ library
, template-haskell
, time

if flag(hydra-development)
-- NOTE(SN): should fix HLS choking on PlutusTx plugin
ghc-options: -fplugin-opt PlutusTx.Plugin:defer-errors
ghc-options: -fplugin-opt PlutusTx.Plugin:defer-errors

test-suite tests
import: project-config
Expand Down
2 changes: 1 addition & 1 deletion hydra-prelude/hydra-prelude.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ library
DerivingStrategies
LambdaCase

ghc-options: -Wall -Werror -Wcompat -Wunused-packages
ghc-options: -Wall -Wcompat -Wunused-packages
8 changes: 0 additions & 8 deletions hydra-test-utils/hydra-test-utils.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ source-repository head
type: git
location: https://github.com/input-output-hk/hydra

flag hydra-development
description: Disable -Werror for development
default: False
manual: True

common package-config
default-language: GHC2021
default-extensions:
Expand All @@ -32,9 +27,6 @@ common package-config
-Wall -Wcompat -Widentities -Wincomplete-record-updates
-Wincomplete-uni-patterns -Wredundant-constraints -Wunused-packages

if !flag(hydra-development)
ghc-options: -Werror

library
import: package-config
hs-source-dirs: src
Expand Down
8 changes: 0 additions & 8 deletions hydra-tui/hydra-tui.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ source-repository head
type: git
location: https://github.com/input-output-hk/hydra

flag hydra-development
description: Disable -Werror for development
default: False
manual: True

common project-config
default-language: GHC2021
default-extensions:
Expand All @@ -41,9 +36,6 @@ common project-config
-Wincomplete-uni-patterns -Wredundant-constraints -Wunused-packages
-fprint-potential-instances

if !flag(hydra-development)
ghc-options: -Werror

library
import: project-config
hs-source-dirs: src
Expand Down
56 changes: 36 additions & 20 deletions nix/hydra/project.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,33 +53,49 @@ let

inputMap = { "https://input-output-hk.github.io/cardano-haskell-packages" = CHaP; };

modules = [
# Strip debugging symbols from exes (smaller closures)
{
packages.hydra-node.dontStrip = false;
packages.hydra-tui.dontStrip = false;
packages.hydraw.dontStrip = false;
}
# Avoid plutus-tx errors in haddock (see also cabal.project)
{
packages.hydra-plutus.setupHaddockFlags = [ "--ghc-options='-fplugin-opt PlutusTx.Plugin:defer-errors'" ];
packages.plutus-merkle-tree.setupHaddockFlags = [ "--ghc-options='-fplugin-opt PlutusTx.Plugin:defer-errors'" ];
packages.plutus-cbor.setupHaddockFlags = [ "--ghc-options='-fplugin-opt PlutusTx.Plugin:defer-errors'" ];
}
# Fix compliation of strict-containers (see also cabal.project)
{
packages.strict-containers.ghcOptions = [ "-Wno-noncanonical-monad-instances" ];
modules = [{
packages = {

# Strip debugging symbols from exes (smaller closures)
hydra-node.dontStrip = false;
hydra-tui.dontStrip = false;
hydraw.dontStrip = false;

# Avoid plutus-tx errors in haddock (see also cabal.project)
hydra-plutus.setupHaddockFlags = [ "--ghc-options='-fplugin-opt PlutusTx.Plugin:defer-errors'" ];

plutus-merkle-tree.setupHaddockFlags = [ "--ghc-options='-fplugin-opt PlutusTx.Plugin:defer-errors'" ];
plutus-cbor.setupHaddockFlags = [ "--ghc-options='-fplugin-opt PlutusTx.Plugin:defer-errors'" ];

# Fix compliation of strict-containers (see also cabal.project)
strict-containers.ghcOptions = [ "-Wno-noncanonical-monad-instances" ];

# XXX: Could not figure out where to make this flag ^^^ effective in the haddock build
packages.strict-containers.doHaddock = false;
}
strict-containers.doHaddock = false;

# -Werror for CI

hydra-cardano-api.ghcOptions = [ "-Werror" ];
hydra-cluster.ghcOptions = [ "-Werror" ];
hydra-node.ghcOptions = [ "-Werror" ];
hydra-plutus.ghcOptions = [ "-Werror" ];
hydra-plutus-extras.ghcOptions = [ "-Werror" ];
hydra-prelude.ghcOptions = [ "-Werror" ];
hydra-test-utils.ghcOptions = [ "-Werror" ];
hydra-tui.ghcOptions = [ "-Werror" ];
hydraw.ghcOptions = [ "-Werror" ];
plutus-cbor.ghcOptions = [ "-Werror" ];
plutus-merkle-tree.ghcOptions = [ "-Werror" ];

};
}
({ lib, config, ... }:
lib.mkIf (lib.versionAtLeast config.compiler.version "9.4") {
# lib:ghc is a bit annoying in that it comes with it's own build-type:Custom, and then tries
# to call out to all kinds of silly tools that GHC doesn't really provide.
# For this reason, we try to get away without re-installing lib:ghc for now.
reinstallableLibGhc = false;
})
];
})];
};
in
{
Expand Down
12 changes: 1 addition & 11 deletions plutus-cbor/plutus-cbor.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ source-repository head
type: git
location: https://github.com/input-output-hk/hydra

flag hydra-development
description: Disable -Werror for development
default: False
manual: True

common project-config
default-language: GHC2021
default-extensions:
Expand All @@ -41,9 +36,6 @@ common project-config
-fno-ignore-interface-pragmas -fno-omit-interface-pragmas
-fno-strictness -fprint-potential-instances

if !flag(hydra-development)
ghc-options: -Werror

library
import: project-config
hs-source-dirs: src
Expand Down Expand Up @@ -113,8 +105,6 @@ executable encoding-cost
, QuickCheck
, scientific

if flag(hydra-development)
-- NOTE(SN): should fix HLS choking on PlutusTx plugin
ghc-options: -fplugin-opt PlutusTx.Plugin:defer-errors
ghc-options: -fplugin-opt PlutusTx.Plugin:defer-errors

ghc-options: -threaded -rtsopts
16 changes: 2 additions & 14 deletions plutus-merkle-tree/plutus-merkle-tree.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ source-repository head
type: git
location: https://github.com/input-output-hk/hydra

flag hydra-development
description: Disable -Werror for development
default: False
manual: True

common project-config
default-language: GHC2021
default-extensions:
Expand All @@ -41,9 +36,6 @@ common project-config
-Wnoncanonical-monad-instances -fno-ignore-interface-pragmas
-fno-omit-interface-pragmas -fno-strictness

if !flag(hydra-development)
ghc-options: -Werror

library
import: project-config
ghc-options: -haddock
Expand All @@ -56,9 +48,7 @@ library
, plutus-tx
, text

if flag(hydra-development)
-- NOTE(SN): should fix HLS choking on PlutusTx plugin
ghc-options: -fplugin-opt PlutusTx.Plugin:defer-errors
ghc-options: -fplugin-opt PlutusTx.Plugin:defer-errors

test-suite tests
import: project-config
Expand Down Expand Up @@ -103,6 +93,4 @@ benchmark on-chain-cost
, plutus-tx-plugin
, QuickCheck

if flag(hydra-development)
-- NOTE(SN): should fix HLS choking on PlutusTx plugin
ghc-options: -fplugin-opt PlutusTx.Plugin:defer-errors
ghc-options: -fplugin-opt PlutusTx.Plugin:defer-errors

0 comments on commit 8fc75af

Please sign in to comment.