From 0f73061d41a2f8af2d90eaf0deea666449d65c41 Mon Sep 17 00:00:00 2001 From: tegwick Date: Thu, 30 Apr 2026 17:15:51 +0200 Subject: [PATCH] =?UTF-8?q?fix(build):=20add=20ghc-options=20-O0=20to=20in?= =?UTF-8?q?ter-hub-models=20=E2=80=94=20strips=20unfoldings=20from=20.hi?= =?UTF-8?q?=20files,=20keeps=20them=20under=20GHC=209.10.3=20287MB=20binar?= =?UTF-8?q?y=20limit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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"