diff --git a/.github/workflows/bundle-ucm.yaml b/.github/workflows/bundle-ucm.yaml index bd05781b39..e97da0292a 100644 --- a/.github/workflows/bundle-ucm.yaml +++ b/.github/workflows/bundle-ucm.yaml @@ -59,6 +59,7 @@ jobs: --ghc-options='-O2' \ --local-bin-path ucm-bin \ --copy-bins \ + --flag unison-runtime:optchecks \ && break; done diff --git a/unison-runtime/package.yaml b/unison-runtime/package.yaml index aa8a9713a1..8d874dfe1f 100644 --- a/unison-runtime/package.yaml +++ b/unison-runtime/package.yaml @@ -12,6 +12,13 @@ flags: stackchecks: manual: true default: false + + # Run optimization assertion tests, make sure this runs with O2 + optchecks: + manual: true + default: false + + # Dumps core for debugging to unison-runtime/.stack-work/dist//ghc-x.y.z/build/ dumpcore: manual: true default: false @@ -21,9 +28,9 @@ when: cpp-options: -DARRAY_CHECK - condition: flag(stackchecks) cpp-options: -DSTACK_CHECK - # Run optimization assertion tests, make sure this runs with O2 - condition: flag(optchecks) - ghc-options: -O2 -DOPT_CHECK + ghc-options: -O2 + cpp-options: -DOPT_CHECK - condition: flag(dumpcore) ghc-options: -ddump-simpl -ddump-stg-final -ddump-to-file -dsuppress-coercions -dsuppress-idinfo -dsuppress-module-prefixes -ddump-str-signatures -ddump-simpl-stats # -dsuppress-type-applications -dsuppress-type-signatures diff --git a/unison-runtime/unison-runtime.cabal b/unison-runtime/unison-runtime.cabal index f6b622cff3..b908088591 100644 --- a/unison-runtime/unison-runtime.cabal +++ b/unison-runtime/unison-runtime.cabal @@ -25,6 +25,10 @@ flag dumpcore manual: True default: False +flag optchecks + manual: True + default: False + flag stackchecks manual: True default: False @@ -148,6 +152,9 @@ library cpp-options: -DARRAY_CHECK if flag(stackchecks) cpp-options: -DSTACK_CHECK + if flag(optchecks) + ghc-options: -O2 + cpp-options: -DOPT_CHECK if flag(dumpcore) ghc-options: -ddump-simpl -ddump-stg-final -ddump-to-file -dsuppress-coercions -dsuppress-idinfo -dsuppress-module-prefixes -ddump-str-signatures -ddump-simpl-stats @@ -232,5 +239,8 @@ test-suite runtime-tests cpp-options: -DARRAY_CHECK if flag(stackchecks) cpp-options: -DSTACK_CHECK + if flag(optchecks) + ghc-options: -O2 + cpp-options: -DOPT_CHECK if flag(dumpcore) ghc-options: -ddump-simpl -ddump-stg-final -ddump-to-file -dsuppress-coercions -dsuppress-idinfo -dsuppress-module-prefixes -ddump-str-signatures -ddump-simpl-stats