Drop static linking

This commit is contained in:
Eelco Dolstra 2024-01-09 12:02:14 +01:00
parent 16dd05e8f0
commit d73bb0a676
2 changed files with 5 additions and 21 deletions

View file

@ -41,27 +41,7 @@
in
{
packages = forEachSupportedSystem ({ pkgs, cranePkgs, ... }: rec {
magic-nix-cache = (pkgs.pkgsStatic.callPackage ./package.nix {
rustPlatform = pkgs.pkgsStatic.rustPackages_1_70.rustPlatform;
nix = pkgs.pkgsStatic.nix.overrideAttrs (old: {
patches = (old.patches or []) ++ [ ./nix.patch ];
});
}).overrideAttrs (old: {
nativeBuildInputs = (old.nativeBuildInputs or []) ++ [
pkgs.nukeReferences
];
# Read by pkg_config crate (do some autodetection in build.rs?)
PKG_CONFIG_ALL_STATIC = "1";
"NIX_CFLAGS_LINK_${pkgs.pkgsStatic.stdenv.cc.suffixSalt}" = "-lc";
RUSTFLAGS = "-C relocation-model=static";
postFixup = (old.postFixup or "") + ''
rm -f $out/nix-support/propagated-build-inputs
nuke-refs $out/bin/magic-nix-cache
'';
});
magic-nix-cache = pkgs.callPackage ./package.nix { };
#inherit (cranePkgs) magic-nix-cache;
default = magic-nix-cache;
});

View file

@ -38,4 +38,8 @@ in rustPlatform.buildRustPackage rec {
# Recursive Nix is not stable yet
doCheck = false;
postFixup = ''
rm -f $out/nix-support/propagated-build-inputs
'';
}