From e8a896e986507124b8a33049b6d6137233914a38 Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Sun, 26 Jan 2025 17:16:17 -0700 Subject: [PATCH] Remove `clearDeps` function `clearDeps` is a bit of a bug factory as it turns out. It is not necessary anyway; all it does is shrink the development containers a bit, which we can very much live without. Signed-off-by: Daniel Noland --- default.nix | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/default.nix b/default.nix index f5140e6..5a49eac 100644 --- a/default.nix +++ b/default.nix @@ -421,7 +421,12 @@ rec { cacert cargo-nextest coreutils + glibc.dev + glibc.out just + libgcc.libgcc + libgccjit + libz llvmPackages.clang llvmPackages.libclang.lib llvmPackages.lld @@ -511,6 +516,8 @@ rec { ) + ( if libc == "gnu64" then + # libm.a file contains a GROUP instruction which contains absolute paths to /nix + # and those paths are not preserved by the rsync commands. '' export lib="$out/sysroot/x86_64-unknown-linux-${libcShortName}/${profile}/lib" cd $lib @@ -544,9 +551,6 @@ rec { musl64.release ]; - clearDeps = - obj: with builtins; (/. + "${unsafeDiscardStringContext (unsafeDiscardOutputDependency (obj))}"); - maxLayers = 120; initfrr = toolchainPkgs.stdenv.mkDerivation { @@ -582,7 +586,7 @@ rec { frr = toolchainPkgs.dockerTools.buildLayeredImage { name = "${contianer-repo}/frr"; tag = "${image-tag}"; - contents = map clearDeps frrContainerContents; + contents = frrContainerContents; config = { Env = [ "LD_LIBRARY_PATH=/lib" @@ -595,9 +599,6 @@ rec { compile-env = toolchainPkgs.dockerTools.buildLayeredImage { name = "${contianer-repo}/compile-env"; tag = "${image-tag}"; - # glibc is needed as an explicit dependency due to the use of linker script in the libm.a file. - # Specifically, the libm.a file contains a GROUP instruction which contains absolute paths to /nix - # and those paths are not preserved by the rsync and clearDeps commands. contents = [ env.compile pkgs.dev.gnu64.glibc.static @@ -606,7 +607,7 @@ rec { pkgs.release.gnu64.glibc.dev pkgs.dev.gnu64.glibc.out pkgs.release.gnu64.glibc.out - ] ++ (map clearDeps sysroots); + ] ++ (sysroots); inherit maxLayers; }; doc-env = toolchainPkgs.dockerTools.buildLayeredImage {