From 6ccf14ba235944f96f67e252812d59ef1fb15e38 Mon Sep 17 00:00:00 2001 From: Terje Larsen Date: Wed, 30 Jul 2025 15:07:00 +0200 Subject: [PATCH] dockerTools.streamLayeredImage: fix enableFakechroot This broke with #417132 where the previous behaviour of suppressing errors of the export into $NIX_BUILD_TOP/env-vars when dumping env vars. This error seems to stem from the non-existance of $NIX_BUILD_TOP. This fix ensures the NIX_BUILD_TOP propagates into the proot environment. --- pkgs/build-support/docker/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix index 14b952424ca0..ecc7b410b54f 100644 --- a/pkgs/build-support/docker/default.nix +++ b/pkgs/build-support/docker/default.nix @@ -1049,6 +1049,7 @@ rec { "/proc/" "/sys/" "${builtins.storeDir}/" + "$NIX_BUILD_TOP" "$out/layer.tar" ] ); @@ -1085,6 +1086,7 @@ rec { --exclude=./proc \ --exclude=./sys \ --exclude=.${builtins.storeDir} \ + --exclude=".$NIX_BUILD_TOP" \ --numeric-owner --mtime "@$SOURCE_DATE_EPOCH" \ --hard-dereference \ -cf $out/layer.tar .