From 425aa1bf7c35839f5e500515ff3b5a861a7533d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 25 Mar 2026 18:58:12 +0100 Subject: [PATCH] daemon: Dereference symlinks for /etc/services & co. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes a regression on Guix System introduced in c4298638ca27717be4a83cb033dcbfecdea88093 (from guix/guix#4178) where files in /etc, such as /etc/services, would be symlinks. Consequently, the chroot of fixed-output derivations would contain a dangling symlink for /etc/services, leading to name resolution failures in the chroot. This also relates to 82f84f5e7fb34cc719ed6ea538a3d1ca7516f23d. * nix/libstore/build.cc (DerivationGoal::startBuilder): Add call to ‘canonPath’. Change-Id: If34c8e74447ffc03d9fa81a1ea6bc0aef7c4d0b3 Signed-off-by: Ludovic Courtès --- nix/libstore/build.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc index 9bdf0a78ae..7dd630cc5d 100644 --- a/nix/libstore/build.cc +++ b/nix/libstore/build.cc @@ -2805,7 +2805,10 @@ void DerivationGoal::startBuilder() } for (auto & file : files) { if (pathExists(file)) { - ctx.filesInChroot[file] = file; + /* On Guix System, /etc/services is a symlink; likewise, + on systemd-based system, /etc/resolv.conf is a symlink. + Dereference them. */ + ctx.filesInChroot[file] = canonPath(file, true); ctx.readOnlyFilesInChroot.insert(file); } }