-
-
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
Bindmount files instead of hardlinking or copying to chroot #8965
Conversation
267f471
to
26546f2
Compare
26546f2
to
4e63ed3
Compare
Unsure if this diff of
is correct
4a5
> /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.d
43a45,46
> /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ACCESS,ISDIR 5ccllrgswk61a44yl7jcxs20jql1y32b-gnused-4.9
> /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ACCESS,ISDIR 5wspmqhgsfs7dza9gcyrj5yxbyd00q7y-coreutils-9.3
46a50,53
> /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CLOSE_NOWRITE,CLOSE,ISDIR 5ccllrgswk61a44yl7jcxs20jql1y32b-gnused-4.9
> /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CLOSE_NOWRITE,CLOSE,ISDIR 5wspmqhgsfs7dza9gcyrj5yxbyd00q7y-coreutils-9.3
> /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CLOSE_WRITE,CLOSE 5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh
> /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CLOSE_WRITE,CLOSE 6xg259477c90a229xwmb53pdfkn6ig3g-default-builder.sh
49,53d55
< /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CREATE 9n7n6vy7aqncbsdzr3w6bw3bq1a6xm7k-patch-shebangs.sh
< /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CREATE bxsly8a56yb8kyrq03s82a3vyc8fqrb3-multiple-outputs.sh
< /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CREATE cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh
< /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CREATE fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh
< /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CREATE h9lc1dpi14z7is86ffhl3ld569138595-audit-tmpdir.sh
57,65c59,63
< /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CREATE,ISDIR 5ccllr
< /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CREATE kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh
< /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CREATE m54bmrhj6fqz8nds5zcj97w9s9bckc9v-compress-man-pages.sh
< /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CREATE ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh
< /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CREATE pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CREATE pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh
< /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CREATE sgdq3c3lp6qabfwnrq26qzvrxx101hgi-strip.sh
< /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CREATE wgrbkkaldkrlrni33ccvm3b6vbxzb656-make-symlinks-relative.sh
< /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CREATE xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh
---
> /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CREATE,ISDIR 5ccllrgswk61a44yl7jcxs20jql1y32b-gnused-4.9
> /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CREATE,ISDIR 5wspmqhgsfs7dza9gcyrj5yxbyd00q7y-coreutils-9.3
> /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CREATE,ISDIR 7b943a2k4amjmam6dnwnxnj8qbba9lbq-busybox-static-x86_64-unknown-linux-musl-1.35.0
> /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ OPEN 5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh
> /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ OPEN 6xg259477c90a229xwmb53pdfkn6ig3g-default-builder.sh
68a67,68
> /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ OPEN,ISDIR 5ccllrgswk61a44yl7jcxs20jql1y32b-gnused-4.9
> /nix/store/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ OPEN,ISDIR 5wspmqhgsfs7dza9gcyrj5yxbyd00q7y-coreutils-9.3 the nix log shows binding of files full
|
Odd the files mentioned in the diff seem unrelated, but the code looks very good! |
diff of having the chroot on a different filesystem diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
index 16a0b40b7..b1b519288 100644
--- a/src/libstore/build/local-derivation-goal.cc
+++ b/src/libstore/build/local-derivation-goal.cc
@@ -651,7 +651,7 @@ void LocalDerivationGoal::startBuilder()
environment using bind-mounts. We put it in the Nix store
to ensure that we can create hard-links to non-directory
inputs in the fake Nix store in the chroot (see below). */
- chrootRootDir = worker.store.Store::toRealPath(drvPath) + ".chroot";
+ chrootRootDir = canonPath("/data-4TB/test-chroot") + "/" + drvPath.to_string() + ".chroot";
deletePath(chrootRootDir);
/* Clean up the chroot directory automatically. */
diff with 4d3
< /data-4TB/test-chroot/ ACCESS,ISDIR dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot
48d46
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/ ACCESS,ISDIR etc
217,239d214
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ ACCESS,ISDIR
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ ACCESS,ISDIR
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ ACCESS passwd
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ ATTRIB,ISDIR
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ ATTRIB,ISDIR
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ CLOSE_NOWRITE,CLOSE,ISDIR
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ CLOSE_NOWRITE,CLOSE passwd
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ CLOSE_WRITE,CLOSE group
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ CLOSE_WRITE,CLOSE hosts
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ CLOSE_WRITE,CLOSE passwd
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ CREATE hosts
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ CREATE passwd
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ DELETE group
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ DELETE hosts
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ DELETE passwd
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ DELETE_SELF
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ MODIFY group
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ MODIFY hosts
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ MODIFY passwd
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ OPEN hosts
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ OPEN,ISDIR
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ OPEN passwd
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/etc/ OPEN passwd
305,312d279
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ACCESS 5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ACCESS 6xg259477c90a229xwmb53pdfkn6ig3g-default-builder.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ACCESS 6xg259477c90a229xwmb53pdfkn6ig3g-default-builder.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ACCESS 9n7n6vy7aqncbsdzr3w6bw3bq1a6xm7k-patch-shebangs.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ACCESS bxsly8a56yb8kyrq03s82a3vyc8fqrb3-multiple-outputs.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ACCESS cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ACCESS fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ACCESS h9lc1dpi14z7is86ffhl3ld569138595-audit-tmpdir.sh
476,487d442
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ACCESS kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ACCESS m54bmrhj6fqz8nds5zcj97w9s9bckc9v-compress-man-pages.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ACCESS ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ACCESS pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ACCESS pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ACCESS pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ACCESS pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ACCESS pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ACCESS pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ACCESS sgdq3c3lp6qabfwnrq26qzvrxx101hgi-strip.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ACCESS wgrbkkaldkrlrni33ccvm3b6vbxzb656-make-symlinks-relative.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ACCESS xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh
498d452
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ ATTRIB pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh
509,515d462
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CLOSE_NOWRITE,CLOSE 5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CLOSE_NOWRITE,CLOSE 6xg259477c90a229xwmb53pdfkn6ig3g-default-builder.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CLOSE_NOWRITE,CLOSE 9n7n6vy7aqncbsdzr3w6bw3bq1a6xm7k-patch-shebangs.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CLOSE_NOWRITE,CLOSE bxsly8a56yb8kyrq03s82a3vyc8fqrb3-multiple-outputs.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CLOSE_NOWRITE,CLOSE cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CLOSE_NOWRITE,CLOSE fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CLOSE_NOWRITE,CLOSE h9lc1dpi14z7is86ffhl3ld569138595-audit-tmpdir.sh
621,629d567
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CLOSE_NOWRITE,CLOSE kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CLOSE_NOWRITE,CLOSE m54bmrhj6fqz8nds5zcj97w9s9bckc9v-compress-man-pages.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CLOSE_NOWRITE,CLOSE ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CLOSE_NOWRITE,CLOSE pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CLOSE_NOWRITE,CLOSE pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CLOSE_NOWRITE,CLOSE pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CLOSE_NOWRITE,CLOSE sgdq3c3lp6qabfwnrq26qzvrxx101hgi-strip.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CLOSE_NOWRITE,CLOSE wgrbkkaldkrlrni33ccvm3b6vbxzb656-make-symlinks-relative.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ CLOSE_NOWRITE,CLOSE xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh
860,889d797
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY 5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY 6xg259477c90a229xwmb53pdfkn6ig3g-default-builder.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY 9n7n6vy7aqncbsdzr3w6bw3bq1a6xm7k-patch-shebangs.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY bxsly8a56yb8kyrq03s82a3vyc8fqrb3-multiple-outputs.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY h9lc1dpi14z7is86ffhl3ld569138595-audit-tmpdir.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY m54bmrhj6fqz8nds5zcj97w9s9bckc9v-compress-man-pages.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY sgdq3c3lp6qabfwnrq26qzvrxx101hgi-strip.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY wgrbkkaldkrlrni33ccvm3b6vbxzb656-make-symlinks-relative.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ MODIFY xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh
896d803
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ OPEN 5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh
898,899d804
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ OPEN 6xg259477c90a229xwmb53pdfkn6ig3g-default-builder.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ OPEN 9n7n6vy7aqncbsdzr3w6bw3bq1a6xm7k-patch-shebangs.sh
902,903d806
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ OPEN bxsly8a56yb8kyrq03s82a3vyc8fqrb3-multiple-outputs.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ OPEN cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh
906,907d808
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ OPEN fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ OPEN h9lc1dpi14z7is86ffhl3ld569138595-audit-tmpdir.sh
1015,1016d915
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ OPEN kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ OPEN m54bmrhj6fqz8nds5zcj97w9s9bckc9v-compress-man-pages.sh
1019,1020d917
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ OPEN ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ OPEN pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
1022,1023d918
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ OPEN pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ OPEN pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh
1026,1027d920
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ OPEN sgdq3c3lp6qabfwnrq26qzvrxx101hgi-strip.sh
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ OPEN wgrbkkaldkrlrni33ccvm3b6vbxzb656-make-symlinks-relative.sh
1029d921
< /data-4TB/test-chroot/dyzlaidm3j18dqsfdfpixkpiljnclgx4-hello-2.12.1.drv.chroot/nix/store/ OPEN xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh in before
in after
|
I removed the automatic cleaning of the chroot dir by removing
these may not be correct as the fs is zfs with compression
files in both so seems to be working |
2ab5985
to
8dbafb4
Compare
Why do we not want cleanup? Also, what exactly were the inotify logs from outside the sandbox supposed to demonstrate? I've been a bit lost. |
I removed it for testing locally. I thought the inotify logs would have shown something useful like less writes. |
I guess the same amount of file access will happen via the FS. But given that the FS is not backed by a block device, there will be no corresponding writes to a block device. To observe those in a similar manner you'd need something like biosnoop, but it's fairly obvious that if you have a tmpfs that there will be no such writes. Another issue is that writes are delayed until dirty page writeback happens, which can be some time after the filesystem writes happen. |
I'll test it on AFS and CERN EOS today. |
Build and run CERN EOS on LXPULS still cannot run Nix with local chroot store, as cern-eos/eos@e0da166 hasn't been released by cern-eos/eos, and therefore hasn't been deployed onto CERN LXPLUS. |
|
Been using this for a week on https://github.com/Artturin/nix/tree/lazy-trees-mine there were no conflicts when applying |
Been using this for ~2 weeks and no issues |
OK cool so we're not worrying about the inotify logs (which I never was, seems fine) this looks good to me! |
+100 This looks good, and is better than my own version. It fixes a real problem in the wild, so hopefully we can land it soon. 👍 |
typedef map<Path, ChrootPath> DirsInChroot; // maps target path to source path | ||
DirsInChroot dirsInChroot; | ||
typedef map<Path, ChrootPath> FilesAndDirsInChroot; // maps target path to source path | ||
FilesAndDirsInChroot filesAndDirsInChroot; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just "PathsInChroot" to be less verbose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Yes, the chroot is required to be on the same filesystem so that the build outputs can be moved efficiently from the chroot to their final location. |
8dbafb4
to
d393725
Compare
NixOS@16591eb#diff-19f999107b609d37cfb22c58e7f0bc1cf76edf1180e238dd6389e03cc279b604 (2013) added support for files to doBind This is work towards allowing users to change the location of chrootRootDir, to, for example, a tmpfs. inspired by trofi on matrix > It looks like build sandbox created by nix-daemon runs on the same filesystem, as /nix/store including things like /tmp which makes all small temporary files hit the disk. Is it intentional? If it is is there an easy way to redirect chroot's root to be tmpfs? dirsInChroot -> pathsInChroot
d393725
to
b8dfa3d
Compare
I don't think we should force that. E.g. if one is using NFS it is probably much better to do one big move at the end. Synchronizing the state during the build is very counter productive. Ultimately, all the final bytes need to get copied over the network from the builder to the data server, so there is " |
Anyways, this PR doesn't directly change any logic saying what build dirs are or not allowed, so this stuff shouldn't be a blocker merging this. Is anything else needed or can we merge this? |
Yay! |
This causes #9579 |
Bindmount files instead of hardlinking or copying to chroot (cherry picked from commit 622191c) Change-Id: I278ec1baacdfa9044992b58fdec8f14d6d7d09ce
Hide whitespace changes when reviewing
16591eb#diff-19f999107b609d37cfb22c58e7f0bc1cf76edf1180e238dd6389e03cc279b604 (2013) added support for files to doBind
This is work towards allowing users to change the location of chrootRootDir, to, for example, a tmpfs.
inspired by trofi on matrix
CC @ShamrockLee who made #8614
Motivation
Context
Priorities
Add 👍 to pull requests you find important.