Merge pull request #259359 from hercules-ci/hci-output-closure-size

hci: Improve closure size

authored by Robert Hensing and committed by GitHub 08af27d9 70890d85

+19 -3
+19 -3
pkgs/development/tools/continuous-integration/hci/default.nix
··· 1 - { haskell, haskellPackages, lib, makeWrapper, runc, stdenv }: 2 let 3 - inherit (haskell.lib.compose) overrideCabal addBuildTools justStaticExecutables; 4 inherit (lib) makeBinPath; 5 bundledBins = lib.optional stdenv.isLinux runc; 6 7 pkg = 8 # justStaticExecutables is needed due to https://github.com/NixOS/nix/issues/2990 9 overrideCabal ··· 15 makeWrapper $out/libexec/hci $out/bin/hci --prefix PATH : ${lib.escapeShellArg (makeBinPath bundledBins)} 16 ''; 17 }) 18 - (addBuildTools [ makeWrapper ] (justStaticExecutables haskellPackages.hercules-ci-cli)); 19 in pkg // { 20 meta = pkg.meta // { 21 position = toString ./default.nix + ":1";
··· 1 + { haskell, haskellPackages, lib, makeWrapper, runc, stdenv, emptyDirectory }: 2 let 3 + inherit (haskell.lib.compose) overrideCabal addBuildTools justStaticExecutables appendConfigureFlags; 4 inherit (lib) makeBinPath; 5 bundledBins = lib.optional stdenv.isLinux runc; 6 7 + overrides = old: { 8 + hercules-ci-agent = 9 + overrideCabal 10 + (o: { 11 + isLibrary = true; 12 + isExecutable = false; 13 + postInstall = ""; # ignore completions 14 + enableSharedExecutables = false; 15 + buildTarget = "lib:hercules-ci-agent hercules-ci-agent-unit-tests"; 16 + configureFlags = o.configureFlags or [ ] ++ [ 17 + "--bindir=${emptyDirectory}/hercules-ci-built-without-binaries/no-bin" 18 + ]; 19 + }) 20 + old.hercules-ci-agent; 21 + }; 22 + 23 pkg = 24 # justStaticExecutables is needed due to https://github.com/NixOS/nix/issues/2990 25 overrideCabal ··· 31 makeWrapper $out/libexec/hci $out/bin/hci --prefix PATH : ${lib.escapeShellArg (makeBinPath bundledBins)} 32 ''; 33 }) 34 + (addBuildTools [ makeWrapper ] (justStaticExecutables (haskellPackages.hercules-ci-cli.override overrides))); 35 in pkg // { 36 meta = pkg.meta // { 37 position = toString ./default.nix + ":1";