on master help sign in
Ensure asserts are on in debug/dev/non-opt builds
commit1953900342625c63e4d4968f6769f10f290fd3e5 authorHarendra Kumar <harendra@composewell.com> dateTue 5 Oct 2021, 22:57 (5 years ago) parentb38ae55
2 files changed+8−5
streamly.cabal+4−3 test/streamly-tests.cabal+4−2
streamly.cabal+4−3
@@ -235,9 +235,6 @@ common compile-options
235235 ghc-options: -Wmissed-specialisations
236236 -Wall-missed-specialisations
237237
238− if flag(dev) || flag(debug)
239− ghc-options: -fno-ignore-asserts
240−
241238 if flag(limit-build-mem)
242239 ghc-options: +RTS -M1000M -RTS
243240
@@ -283,6 +280,10 @@ common optimization-options
283280 -fspec-constr-recursive=16
284281 -fmax-worker-args=16
285282
283+ -- For this to be effective it must come after the -O2 option
284+ if flag(dev) || flag(debug) || !flag(opt)
285+ ghc-options: -fno-ignore-asserts
286+
286287common threading-options
287288 ghc-options: -threaded
288289 -with-rtsopts=-N
test/streamly-tests.cabal+4−2
@@ -68,7 +68,6 @@ common compile-options
6868 -Wredundant-constraints
6969 -Wnoncanonical-monad-instances
7070 -Rghc-timing
71− -fno-ignore-asserts
7271
7372 if flag(has-llvm)
7473 ghc-options: -fllvm
@@ -130,6 +129,8 @@ common optimization-options
130129 -fdicts-strict
131130 -fmax-worker-args=16
132131 -fspec-constr-recursive=16
132+ -- This must come after -O2
133+ -fno-ignore-asserts
133134 if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
134135 ghc-options: -fplugin Fusion.Plugin
135136 else
@@ -181,7 +182,7 @@ library
181182common test-options
182183 import: lib-options
183184 , threading-options
184− ghc-options: -rtsopts
185+ ghc-options: -rtsopts -fno-ignore-asserts
185186 include-dirs: .
186187 build-depends: streamly-tests
187188
@@ -195,6 +196,7 @@ common always-optimized
195196 -fmax-worker-args=16
196197 -fspec-constr-recursive=16
197198 -rtsopts
199+ -fno-ignore-asserts
198200 if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
199201 ghc-options: -fplugin Fusion.Plugin
200202