treewide: no justStaticExecutables on aarch64-darwin for bogus refs

This commit disables justStaticExecutables for packages on
aarch64-darwin that incur a (usually incorrect) reference on GHC.
justStaticExecutables now fails when a GHC reference remains in the
output (#304352). Due to this reference justStaticExecutables (before
these changes) would only marginally reduce closure size.

In the future, we'll be able to re-introduce justStaticExecutables
after (manually) removing the incorrect references stemming from the use
of Paths_* modules. Tracking Issue: #318013
This commit is contained in:
sternenseemann
2024-06-08 10:33:23 +02:00
parent 26e3a02633
commit d785f1185e
3 changed files with 37 additions and 9 deletions
@@ -31,7 +31,10 @@ let
makeWrapper $out/libexec/hci $out/bin/hci --prefix PATH : ${lib.escapeShellArg (makeBinPath bundledBins)}
'';
})
(addBuildTools [ makeWrapper ] (justStaticExecutables (haskellPackages.hercules-ci-cli.override overrides)));
(addBuildTools [ makeWrapper ]
# TODO: Erroneous references to GHC on aarch64-darwin: https://github.com/NixOS/nixpkgs/issues/318013
((if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 then lib.id else haskell.lib.compose.justStaticExecutables)
(haskellPackages.hercules-ci-cli.override overrides)));
in pkg // {
meta = pkg.meta // {
position = toString ./default.nix + ":1";
@@ -28,7 +28,10 @@ let
makeWrapper $out/libexec/hercules-ci-agent $out/bin/hercules-ci-agent --prefix PATH : ${lib.escapeShellArg (makeBinPath bundledBins)}
'';
})
(addBuildTools [ makeBinaryWrapper ] (justStaticExecutables haskellPackages.hercules-ci-agent));
(addBuildTools [ makeBinaryWrapper ]
# TODO: Erroneous references to GHC on aarch64-darwin: https://github.com/NixOS/nixpkgs/issues/318013
((if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 then lib.id else haskell.lib.compose.justStaticExecutables)
haskellPackages.hercules-ci-agent));
in pkg.overrideAttrs (finalAttrs: o: {
meta = o.meta // {
position = toString ./default.nix + ":1";
+29 -7
View File
@@ -15922,7 +15922,10 @@ with pkgs;
cabal-install = haskell.lib.compose.justStaticExecutables haskellPackages.cabal-install;
stack = haskell.lib.compose.justStaticExecutables haskellPackages.stack;
stack =
# TODO: Erroneous references to GHC on aarch64-darwin: https://github.com/NixOS/nixpkgs/issues/318013
(if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 then lib.id else haskell.lib.compose.justStaticExecutables)
haskellPackages.stack;
hlint = haskell.lib.compose.justStaticExecutables haskellPackages.hlint;
@@ -18831,7 +18834,10 @@ with pkgs;
guile = guile_2_2;
};
hadolint = haskell.lib.compose.justStaticExecutables haskellPackages.hadolint;
hadolint =
# TODO: Erroneous references to GHC on aarch64-darwin: https://github.com/NixOS/nixpkgs/issues/318013
(if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 then lib.id else haskell.lib.compose.justStaticExecutables)
haskellPackages.hadolint;
halfempty = callPackage ../development/tools/halfempty { };
@@ -19132,7 +19138,10 @@ with pkgs;
msitools = callPackage ../development/tools/misc/msitools { };
haskell-ci = haskell.lib.compose.justStaticExecutables haskellPackages.haskell-ci;
haskell-ci =
# TODO: Erroneous references to GHC on aarch64-darwin: https://github.com/NixOS/nixpkgs/issues/318013
(if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 then lib.id else haskell.lib.compose.justStaticExecutables)
haskellPackages.haskell-ci;
nailgun = callPackage ../development/tools/nailgun { };
@@ -19488,7 +19497,10 @@ with pkgs;
inherit (darwin.apple_sdk.frameworks) Security;
};
shake = haskell.lib.compose.justStaticExecutables haskellPackages.shake;
shake =
# TODO: Erroneous references to GHC on aarch64-darwin: https://github.com/NixOS/nixpkgs/issues/318013
(if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 then lib.id else haskell.lib.compose.justStaticExecutables)
haskellPackages.shake;
shallot = callPackage ../tools/misc/shallot { };
@@ -20581,6 +20593,7 @@ with pkgs;
elfio = callPackage ../development/libraries/elfio { };
# TODO: Fix references and add justStaticExecutables https://github.com/NixOS/nixpkgs/issues/318013
emanote = haskellPackages.emanote;
enchant2 = callPackage ../development/libraries/enchant/2.x.nix { };
@@ -23215,7 +23228,10 @@ with pkgs;
matio = callPackage ../development/libraries/matio { };
matterhorn = haskell.lib.compose.justStaticExecutables haskellPackages.matterhorn;
matterhorn =
# TODO: Erroneous references to GHC on aarch64-darwin: https://github.com/NixOS/nixpkgs/issues/318013
(if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 then lib.id else haskell.lib.compose.justStaticExecutables)
haskellPackages.matterhorn;
maxflow = callPackage ../development/libraries/maxflow { };
@@ -31475,7 +31491,10 @@ with pkgs;
hledger-iadd = haskell.lib.compose.justStaticExecutables haskellPackages.hledger-iadd;
hledger-interest = haskell.lib.compose.justStaticExecutables haskellPackages.hledger-interest;
hledger-ui = haskell.lib.compose.justStaticExecutables haskellPackages.hledger-ui;
hledger-web = haskell.lib.compose.justStaticExecutables haskellPackages.hledger-web;
hledger-web =
# TODO: Erroneous references to GHC on aarch64-darwin: https://github.com/NixOS/nixpkgs/issues/318013
(if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 then lib.id else haskell.lib.compose.justStaticExecutables)
haskellPackages.hledger-web;
hledger-utils = with python3.pkgs; toPythonApplication hledger-utils;
hmm = callPackage ../applications/misc/hmm { };
@@ -36150,7 +36169,10 @@ with pkgs;
bean-add = callPackage ../applications/office/beancount/bean-add.nix { };
bench = haskell.lib.compose.justStaticExecutables haskellPackages.bench;
bench =
# TODO: Erroneous references to GHC on aarch64-darwin: https://github.com/NixOS/nixpkgs/issues/318013
(if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 then lib.id else haskell.lib.compose.justStaticExecutables)
haskellPackages.bench;
cri-o = callPackage ../applications/virtualization/cri-o/wrapper.nix { };
cri-o-unwrapped = callPackage ../applications/virtualization/cri-o { };