serokell / deploy-rs

A simple multi-profile Nix-flake deploy tool.
Other
1.22k stars 100 forks source link

fix nix-build invocation in non-flake builds #272

Closed stuebinm closed 3 weeks ago

stuebinm commented 1 month ago

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.

PhilTaken commented 1 month ago

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

stuebinm commented 1 month ago

@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 commented 3 weeks ago

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.

rvem commented 3 weeks ago

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:)