Allow substituting paths when building remotely using `ssh-ng://`
Until now, it was not possible to substitute missing paths from e.g. `https://cache.nixos.org` on a remote server when building on it using the new `ssh-ng` protocol. This is because every store implementation except legacy `ssh://` ignores the substitution flag passed to `Store::queryValidPaths` while the `legacy-ssh-store` substitutes the remote store using `cmdQueryValidPaths` when the remote store is opened with `nix-store --serve`. This patch slightly modifies the daemon protocol to allow passing an integer value suggesting whether to substitute missing paths during `wopQueryValidPaths`. To implement this on the daemon-side, the substitution logic from `nix-store --serve` has been moved into a protected method named `Store::substitutePaths` which gets currently called from `LocalStore::queryValidPaths` and `Store::queryValidPaths` if `maybeSubstitute` is `true`. Fixes #2770
Showing
- flake.nix 2 additions, 1 deletionflake.nix
- src/libstore/daemon.cc 10 additions, 1 deletionsrc/libstore/daemon.cc
- src/libstore/remote-store.cc 3 additions, 0 deletionssrc/libstore/remote-store.cc
- src/libstore/store-api.cc 22 additions, 0 deletionssrc/libstore/store-api.cc
- src/libstore/store-api.hh 5 additions, 0 deletionssrc/libstore/store-api.hh
- src/libstore/worker-protocol.hh 1 addition, 1 deletionsrc/libstore/worker-protocol.hh
- src/nix-store/nix-store.cc 1 addition, 22 deletionssrc/nix-store/nix-store.cc
Loading
Please register or sign in to comment