generated from coulomb/repo-seed
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
Some checks failed
Build and Deploy / build-push-deploy (push) Has been cancelled
Some checks failed
Build and Deploy / build-push-deploy (push) Has been cancelled
This commit is contained in:
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"
|
||||
|
||||
Reference in New Issue
Block a user