Skip to content

Validate store dir in gRPC version check#1638

Merged
Ericson2314 merged 1 commit intoNixOS:masterfrom
obsidiansystems:check-store-dir
Apr 4, 2026
Merged

Validate store dir in gRPC version check#1638
Ericson2314 merged 1 commit intoNixOS:masterfrom
obsidiansystems:check-store-dir

Conversation

@Ericson2314
Copy link
Copy Markdown
Member

Builders and the queue-runner must agree on the Nix store directory (typically /nix/store) or else store paths exchanged over the protocol wil be unactionable (store dirs are included in store path hash calcualtion).

The version check handshake already runs before any builds are dispatched, so this is the natural place to catch the mismatch early with a clear error.

Add a store_dir field to VersionCheckRequest in the proto, send it from the builder, and verify it on the queue-runner side — returning failed_precondition on mismatch.

Also tighten up nix_utils::get_store_dir() to return StoreDir directly instead of String, to be more informative.

Builders and the queue-runner must agree on the Nix store directory
(typically `/nix/store`) or else store paths exchanged over the protocol
wil be unactionable (store dirs are included in store path hash
calcualtion).

The version check handshake already runs before any builds are
dispatched, so this is the natural place to catch the mismatch early
with a clear error.

Add a `store_dir` field to `VersionCheckRequest` in the proto, send it
from the builder, and verify it on the queue-runner side — returning
`failed_precondition` on mismatch.

Also tighten up `nix_utils::get_store_dir()` to return `StoreDir`
directly instead of `String`, to be more informative.
@Ericson2314 Ericson2314 enabled auto-merge April 4, 2026 19:54
@Ericson2314 Ericson2314 added this pull request to the merge queue Apr 4, 2026
Merged via the queue into NixOS:master with commit e669190 Apr 4, 2026
2 checks passed
@Ericson2314 Ericson2314 deleted the check-store-dir branch April 4, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant