fix(tvix): Don't call assertStorePath on BasicDerivation.builder
Upstream doesn't, and for good reason - this might not be a store path, for example if it's /bin/sh Fixes: b/73 Change-Id: If9aa96de2cd8ab941c098a9f122b8b302a92ec38 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2175 Reviewed-by: kanepyork <rikingcoding@gmail.com> Tested-by: BuildkiteCI
This commit is contained in:
parent
c885bd0274
commit
1d22874ab2
3 changed files with 5 additions and 9 deletions
3
third_party/nix/src/libstore/derivations.cc
vendored
3
third_party/nix/src/libstore/derivations.cc
vendored
|
@ -43,11 +43,10 @@ nix::proto::Derivation_DerivationOutput DerivationOutput::to_proto() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
BasicDerivation BasicDerivation::from_proto(
|
BasicDerivation BasicDerivation::from_proto(
|
||||||
const nix::proto::Derivation* proto_derivation, const nix::Store& store) {
|
const nix::proto::Derivation* proto_derivation) {
|
||||||
BasicDerivation result;
|
BasicDerivation result;
|
||||||
result.platform = proto_derivation->platform();
|
result.platform = proto_derivation->platform();
|
||||||
result.builder = proto_derivation->builder().path();
|
result.builder = proto_derivation->builder().path();
|
||||||
store.assertStorePath(result.builder);
|
|
||||||
|
|
||||||
for (auto [k, v] : proto_derivation->outputs()) {
|
for (auto [k, v] : proto_derivation->outputs()) {
|
||||||
result.outputs.emplace(k, v);
|
result.outputs.emplace(k, v);
|
||||||
|
|
5
third_party/nix/src/libstore/derivations.hh
vendored
5
third_party/nix/src/libstore/derivations.hh
vendored
|
@ -58,10 +58,9 @@ struct BasicDerivation {
|
||||||
|
|
||||||
BasicDerivation() = default;
|
BasicDerivation() = default;
|
||||||
|
|
||||||
// Convert the given proto derivation to a BasicDerivation in the given
|
// Convert the given proto derivation to a BasicDerivation
|
||||||
// nix::Store.
|
|
||||||
static BasicDerivation from_proto(
|
static BasicDerivation from_proto(
|
||||||
const nix::proto::Derivation* proto_derivation, const nix::Store& store);
|
const nix::proto::Derivation* proto_derivation);
|
||||||
|
|
||||||
[[nodiscard]] nix::proto::Derivation to_proto() const;
|
[[nodiscard]] nix::proto::Derivation to_proto() const;
|
||||||
|
|
||||||
|
|
|
@ -674,15 +674,13 @@ class WorkerServiceImpl final : public WorkerService::Service {
|
||||||
}
|
}
|
||||||
|
|
||||||
Status BuildDerivation(
|
Status BuildDerivation(
|
||||||
grpc::ServerContext* context,
|
grpc::ServerContext*, const nix::proto::BuildDerivationRequest* request,
|
||||||
const nix::proto::BuildDerivationRequest* request,
|
|
||||||
grpc::ServerWriter<nix::proto::BuildEvent>* writer) override {
|
grpc::ServerWriter<nix::proto::BuildEvent>* writer) override {
|
||||||
return HandleExceptions(
|
return HandleExceptions(
|
||||||
[&]() -> Status {
|
[&]() -> Status {
|
||||||
auto drv_path = request->drv_path().path();
|
auto drv_path = request->drv_path().path();
|
||||||
ASSERT_INPUT_STORE_PATH(drv_path);
|
ASSERT_INPUT_STORE_PATH(drv_path);
|
||||||
auto drv =
|
auto drv = BasicDerivation::from_proto(&request->derivation());
|
||||||
BasicDerivation::from_proto(&request->derivation(), *store_);
|
|
||||||
|
|
||||||
auto build_mode = nix::BuildModeFrom(request->build_mode());
|
auto build_mode = nix::BuildModeFrom(request->build_mode());
|
||||||
if (!build_mode) {
|
if (!build_mode) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue