Skip to content

Commit

Permalink
Remove clearDeps function
Browse files Browse the repository at this point in the history
`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 <daniel@githedgehog.com>
  • Loading branch information
daniel-noland committed Feb 4, 2025
1 parent 874d1aa commit 034e886
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -544,9 +551,6 @@ rec {
musl64.release
];

clearDeps =
obj: with builtins; (/. + "${unsafeDiscardStringContext (unsafeDiscardOutputDependency (obj))}");

maxLayers = 120;

initfrr = toolchainPkgs.stdenv.mkDerivation {
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit 034e886

Please sign in to comment.