deploy-rs icon indicating copy to clipboard operation
deploy-rs copied to clipboard

Allow setting temp path for remote build

Open jficz opened this issue 1 year ago • 1 comments

It's getting quite common lately that builds take up a lot of space in /tmp which is also rather often a tmpfs.

Some of my target machines don't have enough RAM to accommodate for such builds. Previously I just set $TMPDIR to something else before building but that can't be done when building on the remote machine with deploy-rs.

There's --temp-path arg but that's used for something else. Something like --temp-build-path or even using --temp-path for builds, too, would be nice.

jficz avatar Jul 11 '24 13:07 jficz

Somehow even when I set remoteBuild to false and export TMPDIR=/tmp2, I still end up with out of space errors from /tmp/... when building a machine which happens to be the localhost. Not sure if this is a deploy issue or nix issue. See #283

jficz avatar Jul 11 '24 15:07 jficz

Hey, I don't think this can be done for remote builds. The command being invoked to build remotely is nix --experimental-features "nix-command' build <drv> --eval-store auto --store "ssh-ng://...". Thus, we are utilizing a remote store and build therefore on the remote host. From reading the docs I don't see an option to set the TMPDIR for the remote host.

weriomat avatar Jun 12 '25 11:06 weriomat

that's... unfortunate. I'll open an issue in upstream for this, unless one already exists. Guess this one can be closed until upstream allows the settings.

jficz avatar Jun 14 '25 16:06 jficz

just fyi, I tried a workaround:

--ssh-opts "-o SetEnv=TMPDIR=/tmp/test"  # with the server's AcceptEnv counterpart set

but it didn't have any visible effect

jficz avatar Jun 14 '25 17:06 jficz