fix(build): add ghc-options -O0 to inter-hub-models — strips unfoldings from .hi files, keeps them under GHC 9.10.3 287MB binary limit
This commit is contained in:
parent
6c8babf214
commit
0f73061d41
1 changed files with 10 additions and 3 deletions
13
flake.nix
13
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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue