diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2026-03-25 18:58:12 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2026-03-29 22:20:58 +0200 |
| commit | 425aa1bf7c35839f5e500515ff3b5a861a7533d6 (patch) | |
| tree | 2261ffbff7ede0bbba38b0554b88fbd22a180b04 /nix | |
| parent | 3b90fc5b3cc128c1aaaaccc5ea4100c51522abf4 (diff) | |
daemon: Dereference symlinks for /etc/services & co.
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 <ludo@gnu.org>
Diffstat (limited to 'nix')
| -rw-r--r-- | nix/libstore/build.cc | 5 |
1 files changed, 4 insertions, 1 deletions
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); } } |
