tup icon indicating copy to clipboard operation
tup copied to clipboard

full_deps doesn't seem to work well with NixOS

Open ChengCat opened this issue 4 years ago • 5 comments

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

ChengCat avatar Jun 13 '20 14:06 ChengCat

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.

sheenobu avatar Dec 24 '20 02:12 sheenobu

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 avatar Dec 24 '20 02:12 sheenobu

@sheenobu Thanks for this idea! I think one would want to use nix-shell --pure for greater build reproducibility anyway.

ChengCat avatar Dec 24 '20 06:12 ChengCat

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

sheenobu avatar Jan 25 '21 01:01 sheenobu

I think this has been dealt with now? The fusermount problem was fixed and we've documented the workarounds on our wiki.

ehmry avatar Nov 26 '22 20:11 ehmry