tup
tup copied to clipboard
full_deps doesn't seem to work well with NixOS
In NixOS, tup often rebuilds the whole project when updater.full_deps
is enabled. I tried various command line arguments, but tup doesn't seem to explain in the output why the rebuilding is needed.
I may have some idea why the rebuilding happens, and wonder whether the issue is fixable on the tup side. In NixOS gcc
and other binaries live in a path like /run/current-system/sw/bin/gcc
, and /run/current-system
is a symlink, which mtime changes on every reboot
I think you can use nix-shell with --pure. /run/current-system will not be in $PATH so you won't see any changes. even on a reboot. PATH should just contain the dependencies in /nix/store you specify via nix-shell or a shell.nix file. Testing it myself now.
Actually when using --pure, fusermount doesn't have the setuid bit so it will not be able to unmount the tup FUSE mount. The setuid wrappers are in /run/wrappers/bin but those are just like /run/current-system.
In this case, the remaining issue is that fusermount/fusermount3 is looked up via PATH while PATH, if I understand, is used to calculate rebuilding. https://github.com/gittup/tup/blob/d33fd69c6ce0ca48644f49b9191a5c14dc4db097/src/tup/server/fuse_server.c#L109-L113
@sheenobu Thanks for this idea! I think one would want to use nix-shell --pure
for greater build reproducibility anyway.
Added a wiki entry for NixOS so that users have a place to go to for figuring out the weird edge cases for nixos. The two now are this one and pkg-config:
https://nixos.wiki/wiki/Tup
I think this has been dealt with now? The fusermount problem was fixed and we've documented the workarounds on our wiki.