--max-jobs 0 should still build drvs with preferLocalBuild according to docs #855

Open
opened 2025-06-10 02:52:11 +00:00 by bacchanalia · 0 comments
Member

Describe the bug

The documentation for max-jobs states:

0 is useful when using remote builders to prevent any local builds (except for preferLocalBuild derivation attribute which executes locally regardless).

but contrary to the docs, derivations with preferLocalBuild set do not get built with --max-jobs 0

Steps To Reproduce

nix build --option substitute false --option builders '' --max-jobs 0 --impure --expr '(import ./. {}).writeText "preferLocalBuildWithMaxJobs0" ""'

Expected behavior

The above command succeeds.

nix --version output

nix (Lix, like Nix) 2.92.0

Additional context

I'm not sure if the documented behavior was ever actually the case, and the language is a but unclear, so I might be reading it wrong, but it would be very useful to have a setting to allow only building derivations with preferLocalBuild set. In some cases it may be desirable to disallow even those, so maybe ideally it should be a separate setting?

## Describe the bug The documentation for [max-jobs](https://docs.lix.systems/manual/lix/2.92/command-ref/conf-file.html?highlight=max-jobs#conf-max-jobs) states: > `0` is useful when using remote builders to prevent any local builds (except for `preferLocalBuild` derivation attribute which executes locally regardless). but contrary to the docs, derivations with `preferLocalBuild` set do not get built with `--max-jobs 0` ## Steps To Reproduce `nix build --option substitute false --option builders '' --max-jobs 0 --impure --expr '(import ./. {}).writeText "preferLocalBuildWithMaxJobs0" ""'` ## Expected behavior The above command succeeds. ## `nix --version` output `nix (Lix, like Nix) 2.92.0` ## Additional context I'm not sure if the documented behavior was ever actually the case, and the language is a but unclear, so I might be reading it wrong, but it would be very useful to have a setting to allow only building derivations with `preferLocalBuild` set. In some cases it may be desirable to disallow even those, so maybe ideally it should be a separate setting?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#855
No description provided.