on master help sign in
Ensure asserts are on in debug/dev/non-opt builds
1953900Harendra Kumar
streamly.cabal+4−3
@@ -235,9 +235,6 @@ common compile-options
235 ghc-options: -Wmissed-specialisations
235 ghc-options: -Wmissed-specialisations
236 -Wall-missed-specialisations
236 -Wall-missed-specialisations
237
237
238− if flag(dev) || flag(debug)
239− ghc-options: -fno-ignore-asserts
240−
241 if flag(limit-build-mem)
238 if flag(limit-build-mem)
242 ghc-options: +RTS -M1000M -RTS
239 ghc-options: +RTS -M1000M -RTS
243
240
@@ -283,6 +280,10 @@ common optimization-options
283 -fspec-constr-recursive=16
280 -fspec-constr-recursive=16
284 -fmax-worker-args=16
281 -fmax-worker-args=16
285
282
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+
286common threading-options
287common threading-options
287 ghc-options: -threaded
288 ghc-options: -threaded
288 -with-rtsopts=-N
289 -with-rtsopts=-N
test/streamly-tests.cabal+4−2
@@ -68,7 +68,6 @@ common compile-options
68 -Wredundant-constraints
68 -Wredundant-constraints
69 -Wnoncanonical-monad-instances
69 -Wnoncanonical-monad-instances
70 -Rghc-timing
70 -Rghc-timing
71− -fno-ignore-asserts
72
71
73 if flag(has-llvm)
72 if flag(has-llvm)
74 ghc-options: -fllvm
73 ghc-options: -fllvm
@@ -130,6 +129,8 @@ common optimization-options
130 -fdicts-strict
129 -fdicts-strict
131 -fmax-worker-args=16
130 -fmax-worker-args=16
132 -fspec-constr-recursive=16
131 -fspec-constr-recursive=16
132+ -- This must come after -O2
133+ -fno-ignore-asserts
133 if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
134 if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
134 ghc-options: -fplugin Fusion.Plugin
135 ghc-options: -fplugin Fusion.Plugin
135 else
136 else
@@ -181,7 +182,7 @@ library
181common test-options
182common test-options
182 import: lib-options
183 import: lib-options
183 , threading-options
184 , threading-options
184− ghc-options: -rtsopts
185+ ghc-options: -rtsopts -fno-ignore-asserts
185 include-dirs: .
186 include-dirs: .
186 build-depends: streamly-tests
187 build-depends: streamly-tests
187
188
@@ -195,6 +196,7 @@ common always-optimized
195 -fmax-worker-args=16
196 -fmax-worker-args=16
196 -fspec-constr-recursive=16
197 -fspec-constr-recursive=16
197 -rtsopts
198 -rtsopts
199+ -fno-ignore-asserts
198 if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
200 if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
199 ghc-options: -fplugin Fusion.Plugin
201 ghc-options: -fplugin Fusion.Plugin
200
202