You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Previously-present output not removed before rebuilding multiple-output derivation #122
Suppose you have a multiple-output derivation, and one of its output is already present in the store.
When re-building the derivation, the already-present output is not present.
This leads to an assertion failure at "assert(!S_ISDIR(st.st_mode));" in canonicalisePathMetaData_ because the owner of the already-present output is `root', not the build user.
A possible fix would be to remove any already-present outputs before rebuilding the derivation.
IMO this fails before computeClosure is even called. The derivation would try to install into a path to which it has no permissions. Either you are able to garbage-collect the obstructing path, or I don't see there could be a good way to fix this problem (except for switching to intensional store, but that would be a really big change).
IMO this fails before computeClosure is even called. The derivation would try to install into a path to which it has no permissions. Either you are able to garbage-collect the obstructing path, or I don't see there could be a good way to fix this problem (except for switching to intensional store, but that would be a really big change).
The patch I posted has been tested and fixes the problem AFAICS.
@vcunat That's not a problem because Nix either performs the build in a chroot (where the obstructing paths are not present) or performs magic hash rewriting.
@civodul I've committed a different fix, namely to let computeClosure() skip paths that were already valid. If I'm not mistaken, your fix has a security hole in that it would allow a build that does "ln /etc/shadow $out" (on systems without hard link restrictions). (There actually is a similar security bug in hash rewriting, see cd49ee0.)
Yes, it's used when chroots are disabled/unsupported. You can see it in action if you build a multiple-output derivation, garbage-collect one of the outputs, and then build the derivation again.
Activity
edolstra commentedon May 23, 2013
Already-present outputs cannot be removed in general because they might be live.
We should simply not canonicalize outputs that were already valid.
civodul commentedon Jun 8, 2013
OK to apply the patch at http://lists.gnu.org/archive/html/bug-guix/2013-06/msg00045.html?
vcunat commentedon Jun 13, 2013
IMO this fails before computeClosure is even called. The derivation would try to install into a path to which it has no permissions. Either you are able to garbage-collect the obstructing path, or I don't see there could be a good way to fix this problem (except for switching to intensional store, but that would be a really big change).
civodul commentedon Jun 13, 2013
Vladimír Čunát [email protected] skribis:
The patch I posted has been tested and fixes the problem AFAICS.
Ludo’.
edolstra commentedon Jun 13, 2013
@vcunat That's not a problem because Nix either performs the build in a chroot (where the obstructing paths are not present) or performs magic hash rewriting.
computeFSClosure: Only process the missing/corrupt paths
Fix assertion failure in canonicalisePathMetaData() after hash rewriting
edolstra commentedon Jun 13, 2013
@civodul I've committed a different fix, namely to let computeClosure() skip paths that were already valid. If I'm not mistaken, your fix has a security hole in that it would allow a build that does "ln /etc/shadow $out" (on systems without hard link restrictions). (There actually is a similar security bug in hash rewriting, see cd49ee0.)
vcunat commentedon Jun 13, 2013
@edolstra: Ah, I forgot chroots. Is hash rewriting used somewhere (or some analogue of intensional store from your thesis)?
edolstra commentedon Jun 13, 2013
Yes, it's used when chroots are disabled/unsupported. You can see it in action if you build a multiple-output derivation, garbage-collect one of the outputs, and then build the derivation again.
civodul commentedon Jun 13, 2013
Wonderful, thanks!
Merge pull request NixOS#122 from nix-dot-dev/dependabot/pip/sphinx-3…
Fixes NixOS#122 - Do not take renames from disabled dependencies
doc/inventory: consolidate four-pass review into the catalog
doc/inventory: 2026-05 adversarial audit — corrections, NixOS#241-Nix…