Backport nix-eval-jobs --no-instantiate #987

Closed
opened 2025-09-05 18:24:11 +00:00 by wolfgangwalther · 4 comments

Using nix-eval-jobs for pure Eval often has a bottleneck with writing .drv files to disk. This considerably slows down the whole thing. This was the main reason why nix-eval-jobs wasn't used in GitHub Actions as a replacement for OfBorg, but why we ended up with the current "chunked evaluation" strategy.

nix-eval-jobs introduced a --no-instantiate flag recently in https://github.com/nix-community/nix-eval-jobs/pull/379 and the follow up https://github.com/nix-community/nix-eval-jobs/pull/380. My tests in https://github.com/nix-community/nix-eval-jobs/pull/379#issuecomment-3244806892 show that this can even speed up current Evaluation in Nixpkgs.

In https://github.com/NixOS/nixpkgs/pull/433057#issuecomment-3180220683 I outlined a plan to run both Lix and Nix for Eval in Nixpkgs on each PR without needing more resources. To be able to use nix-eval-jobs, this would need to be supported by both.

Describe the solution you'd like

Please backport the two PRs mentioned above / add the same feature to Lix' nix-eval-jobs.

Describe alternatives you've considered

Keeping two different Eval mechanisms around in Nixpkgs forever and not being able to run Lix in the Merge Queue.

Additional context

Introducing nix-eval-jobs to Nixpkgs CI also has additional benefits on top of performance: It will allow us to catch evaluation errors much better, because these are streamed as json output as well, from what I can tell. That means we can treat some of these as "expected", for example "broken", "unsupported", "unfree" etc. - but still report others like failing asserts etc. as actual eval failures. This is currently not consistently possibly in Nixpkgs, not with a lot of work and introducing more complex logic than we'd want in a lot of places (my first step towards that was in https://github.com/NixOS/nixpkgs/pull/426629, but that's only a fraction of what's needed with the current nix-env based approach).

## Is your feature request related to a problem? Please describe. Using `nix-eval-jobs` for pure Eval often has a bottleneck with writing `.drv` files to disk. This considerably slows down the whole thing. This was the main reason why `nix-eval-jobs` wasn't used in GitHub Actions as a replacement for OfBorg, but why we ended up with the current "chunked evaluation" strategy. `nix-eval-jobs` introduced a `--no-instantiate` flag recently in https://github.com/nix-community/nix-eval-jobs/pull/379 and the follow up https://github.com/nix-community/nix-eval-jobs/pull/380. My tests in https://github.com/nix-community/nix-eval-jobs/pull/379#issuecomment-3244806892 show that this can even speed up current Evaluation in Nixpkgs. In https://github.com/NixOS/nixpkgs/pull/433057#issuecomment-3180220683 I outlined a plan to run both Lix and Nix for Eval in Nixpkgs on each PR without needing more resources. To be able to use `nix-eval-jobs`, this would need to be supported by both. ## Describe the solution you'd like Please backport the two PRs mentioned above / add the same feature to Lix' `nix-eval-jobs`. ## Describe alternatives you've considered Keeping two different Eval mechanisms around in Nixpkgs forever and not being able to run Lix in the Merge Queue. ## Additional context Introducing `nix-eval-jobs` to Nixpkgs CI also has additional benefits on top of performance: It will allow us to catch evaluation errors much better, because these are streamed as json output as well, from what I can tell. That means we can treat some of these as "expected", for example "broken", "unsupported", "unfree" etc. - but *still* report others like failing asserts etc. as actual eval failures. This is currently not consistently possibly in Nixpkgs, not with a lot of work and introducing more complex logic than we'd want in a lot of places (my first step towards that was in https://github.com/NixOS/nixpkgs/pull/426629, but that's only a fraction of what's needed with the current `nix-env` based approach).
Owner

@ma27 Can you work on a port of this?

@ma27 Can you work on a port of this?
ma27 self-assigned this 2025-09-08 19:56:47 +00:00
Member

Sure.

Sure.
Member

This issue was mentioned on Gerrit on the following CLs:

  • commit message in cl/4163 ("nix-eval-jobs: add --no-instantiate flag")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/4163", "number": 4163, "kind": "commit message"}], "cl_meta": {"4163": {"change_title": "nix-eval-jobs: add `--no-instantiate` flag"}}} --> This issue was mentioned on Gerrit on the following CLs: * commit message in [cl/4163](https://gerrit.lix.systems/c/lix/+/4163) ("nix-eval-jobs: add `--no-instantiate` flag")

Thank you for the very quick turn-around, much appreciated. I will make sure to test this very soon!

Thank you for the very quick turn-around, much appreciated. I will make sure to test this very soon!
Sign in to join this conversation.
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lix-project/lix#987
No description provided.