Files
postgrest/nix/split-sections-cross.patch
T
Wolfgang WaltherandWolfgang Walther ea02729ebd nix: Use -split-sections with pkgsStatic to make static executable smaller again
This works around https://github.com/NixOS/nixpkgs/issues/286285 to use -split-sections
in a cross-compiling scenario. This will reduce the size of the static executable and also
remove the remaining references to /nix/store/.. reducing closure size dramatically.

This also fixes the docker image blowing up in size since we switched to pkgsStatic.
2024-02-06 10:19:31 +01:00

15 lines
741 B
Diff

This works around https://github.com/NixOS/nixpkgs/issues/286285 by passing --enable-split-sections instead of ghc-options.
---
--- a/pkgs/development/haskell-modules/generic-builder.nix
+++ b/pkgs/development/haskell-modules/generic-builder.nix
@@ -245,8 +245,7 @@ let
(enableFeature doBenchmark "benchmarks")
"--enable-library-vanilla" # TODO: Should this be configurable?
(enableFeature enableLibraryForGhci "library-for-ghci")
- ] ++ optionals (enableDeadCodeElimination && (lib.versionOlder "8.0.1" ghc.version)) [
- "--ghc-option=-split-sections"
+ (enableFeature enableDeadCodeElimination "split-sections")
] ++ optionals dontStrip [
"--disable-library-stripping"
"--disable-executable-stripping"