Skip to content

Split Locks: Use dedicated lock files for builds which will use build hooks for building#15856

Draft
MaxHearnden wants to merge 1 commit into
NixOS:masterfrom
MaxHearnden:split-locks
Draft

Split Locks: Use dedicated lock files for builds which will use build hooks for building#15856
MaxHearnden wants to merge 1 commit into
NixOS:masterfrom
MaxHearnden:split-locks

Conversation

@MaxHearnden
Copy link
Copy Markdown
Contributor

@MaxHearnden MaxHearnden commented May 14, 2026

Motivation

This PR adds new remote only locks and a new local only build mode selectable through a new parameter in the builder option which avoids the current build hook decline logic.

Context

Fixes #2029
Fixes #2589 (allows local to be a builder)
Fixes #10740 (the force local builder option allows for otherwise recursive setups)

The bmLocal build mode is like bmNormal except for the fact that it forces local builds so that the builder doesn't even attempt to hold the remote (build hook) lock.

Due to the lock split, build hooks will now need to hold the local lock when copying derivation outputs if avoid-local is set.

I had considered having the local mode be a worker option however I wasn't sure how to pass the option to the remote builder.

The option name avoid-local could be changed if there's a better suggestion, however I don't think that disabling local builds should be the default option, unless local becomes a default builder.


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@github-actions github-actions Bot added documentation new-cli Relating to the "nix" command labels May 14, 2026
@MaxHearnden MaxHearnden marked this pull request as draft May 14, 2026 20:44
@MaxHearnden MaxHearnden force-pushed the split-locks branch 5 times, most recently from ea05f38 to 9d91c10 Compare May 15, 2026 17:33
@MaxHearnden MaxHearnden changed the title Use dedicated lock files for builds which will use build hooks for building split locks: Use dedicated lock files for builds which will use build hooks for building May 15, 2026
@MaxHearnden MaxHearnden changed the title split locks: Use dedicated lock files for builds which will use build hooks for building Split Locks: Use dedicated lock files for builds which will use build hooks for building May 15, 2026
@MaxHearnden MaxHearnden force-pushed the split-locks branch 2 times, most recently from 9d9f10d to e9e41f8 Compare May 16, 2026 23:24
building

This allows the build hook to use the local store.

In order for the split locks to be used, derivations must either only
use the build hook (avoid-local) or only be built locally
(forceLocal/bmLocal).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation new-cli Relating to the "nix" command

Projects

None yet

1 participant