-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix adding symlink to the sandbox paths #10456
Conversation
Regression test for #9579
…o a symlink out of the store Bind-mounting symlinks is apparently not possible, which is why the thing was failing. Fortunately, symlinks are small, so we can fallback to copy them at no cost. Fix #9579 Co-authored-by: Artturin <[email protected]>
Doesn't change much, but brings a bit more consistency to the code
e477ce7
to
ae47372
Compare
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.18-maintenance
git worktree add -d .worktree/backport-10456-to-2.18-maintenance origin/2.18-maintenance
cd .worktree/backport-10456-to-2.18-maintenance
git switch --create backport-10456-to-2.18-maintenance
git cherry-pick -x 872d93eb13f22e8705e03903b65c7eba8b26a99b 913db9f7385b8717d9eaf6269e9f319e78e4c564 ae4737294e91ab93526612b17950e1bc4f0b47f0 |
Successfully created backport PR for |
This comment was marked as resolved.
This comment was marked as resolved.
Successfully created backport PR for |
This comment was marked as resolved.
This comment was marked as resolved.
Successfully created backport PR for |
Git push to origin failed for 2.21-maintenance with exitcode 1 |
Thanks @thufschmitt for picking this up, I am sorry I let the last one stagnate. |
NixOS#10456 fixed the addition of symlink store paths to the sandbox, but also made it so that the hardcoded sandbox paths (like `/etc/hosts`) were now bind-mounted without following the possible symlinks. This made these files unreadable if there were symlinks (because the sandbox would now contain a symlink to an unreachable file rather than the underlying file). In particular, this broke FOD derivations on NixOS as `/etc/hosts` is a symlink there. Fix that by canonicalizing all these hardcoded sandbox paths before adding them to the sandbox.
Fix adding symlink to the sandbox paths (cherry-picked from commit da1e977) Change-Id: I221c85a38180800ec6552d2e86a88df48398fad8
The upstream issue appears to be fixed by NixOS/nix#10456.
#10456 fixed the addition of symlink store paths to the sandbox, but also made it so that the hardcoded sandbox paths (like `/etc/hosts`) were now bind-mounted without following the possible symlinks. This made these files unreadable if there were symlinks (because the sandbox would now contain a symlink to an unreachable file rather than the underlying file). In particular, this broke FOD derivations on NixOS as `/etc/hosts` is a symlink there. Fix that by canonicalizing all these hardcoded sandbox paths before adding them to the sandbox. (cherry picked from commit acbb152)
#10456 fixed the addition of symlink store paths to the sandbox, but also made it so that the hardcoded sandbox paths (like `/etc/hosts`) were now bind-mounted without following the possible symlinks. This made these files unreadable if there were symlinks (because the sandbox would now contain a symlink to an unreachable file rather than the underlying file). In particular, this broke FOD derivations on NixOS as `/etc/hosts` is a symlink there. Fix that by canonicalizing all these hardcoded sandbox paths before adding them to the sandbox. (cherry picked from commit acbb152)
#10456 fixed the addition of symlink store paths to the sandbox, but also made it so that the hardcoded sandbox paths (like `/etc/hosts`) were now bind-mounted without following the possible symlinks. This made these files unreadable if there were symlinks (because the sandbox would now contain a symlink to an unreachable file rather than the underlying file). In particular, this broke FOD derivations on NixOS as `/etc/hosts` is a symlink there. Fix that by canonicalizing all these hardcoded sandbox paths before adding them to the sandbox. (cherry picked from commit acbb152) (cherry picked from commit 1cc79f1) # Conflicts: # tests/functional/linux-sandbox.sh
Bind-mounting symlinks is apparently not possible, which is why the
thing was failing.
Fortunately, symlinks are small, so we can fallback to copy them at no cost.
Fix #9579
Priorities and Process
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.