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

fix nix-build invocation in non-flake builds

Open stuebinm opened this issue 9 months ago • 2 comments

The drvpath^out syntax is only part of nix build, not nix-build. The latter still behaves as before Nix 2.15 and produces the outPath, but produces an error if one attempts to call it the same way as nix build.

stuebinm avatar May 07 '24 10:05 stuebinm

I wonder if we could set up some nixos tests to make sure there are no regressions. Would you mind looking into it?

PhilTaken avatar May 14 '24 15:05 PhilTaken

@PhilTaken I've attempted to write a test for this (changing the existing test setup slightly to allow for non-flake-enabled nix inside the vms & their configuration, and adding a flake-compat shim).

However, it seems to hang on the deploy step for me for an unreasonable amount of time. I'm unsure if this is an actual issue in the test — the existing tests using flakes likewise take very long, although they do eventually succeed.

I might have another look at this later, when I have access to more powerful hardware than my laptop.

stuebinm avatar May 15 '24 21:05 stuebinm

ah i forgot about doing this back then. so here we go:

the problem with the test seems to be that nix uses a surprising amount of memory to evaluate anything inside the vm (and more so without flakes); with the limit given in nix/tests/common.nix it becomes very slow and eventually either runs out of memory or into the default timeout of client.succeed() and then aborts. With an increased memory limit for the client vm, running the test takes a reasonable time (and the test succeeds).

I've also been using this patch locally for over a month now to deploy a couple of my own machines.

stuebinm avatar Jun 11 '24 17:06 stuebinm

With an increased memory limit for the client vm, running the test takes a reasonable time (and the test succeeds).

Sounds like a good enough way to resolve the issue:)

rvem avatar Jun 12 '24 09:06 rvem