diff --git a/flake.nix b/flake.nix index 4917809..f9e7fce 100644 --- a/flake.nix +++ b/flake.nix @@ -152,11 +152,18 @@ 'import Generated.TypesPart2' \ > "$_types" - # Add TypesPart1/TypesPart2 to cabal exposed-modules if absent. - # Write to same dir (not /tmp which is size-limited in sandbox). + # Add TypesPart1/TypesPart2 to cabal exposed-modules and add + # ghc-options: -O0 to keep interface file sizes below the + # GHC 9.10.3 binary-deserialisation limit (~287 MB). + # -O0 strips unfoldings/specialisations from .hi files, + # reducing them by ~10x so TypesPart*.hi stays well under the limit. _cabal=$(ls "$sourceRoot"/*.cabal | head -1) if ! grep -q 'Generated\.TypesPart1' "$_cabal"; then - awk '/Generated\.LearningInsightInclude/{ + awk '/^ exposed-modules:/{ + print " ghc-options: -O0" + print + next + } /Generated\.LearningInsightInclude/{ print print " Generated.TypesPart1" print " Generated.TypesPart2"