From 38040f843dcea44b28bc59c55b57a03cbe4196f9 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 14 Jul 2023 12:00:06 -0400 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Robert Hensing --- src/libexpr/primops/context.cc | 4 ++-- tests/config.nix.in | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libexpr/primops/context.cc b/src/libexpr/primops/context.cc index 8868dbf611e..0b5edfa3c76 100644 --- a/src/libexpr/primops/context.cc +++ b/src/libexpr/primops/context.cc @@ -65,7 +65,7 @@ static RegisterPrimOp primop_unsafeDiscardOutputDependency({ TODO! Old comment is not good. Sometimes we want to pass a derivation path (i.e. `pkg.drvPath`) to a builder without causing the derivation to be built - (for instance, in the derivation that builds NARs in nix-push, when doing source-only deployment). + (for instance, when building a deployment script that builds already-instantiated derivations on the deployment target; a source based deployment that's independent of fetcher configuration among other things). This primop marks the string context so that `builtins.derivation` adds the path to `drv.inputSrcs` rather than `drv.inputDrvs`. Opposite of [`builtins.addDrvOutputDependencies`](#builtins-addDrvOutputDependencies). @@ -100,7 +100,7 @@ static RegisterPrimOp primop_addDrvOutputDependencies({ .doc = R"( TODO! - Opposite of [`builtins.addDrvOutputDependencies`](#builtins-addDrvOutputDependencies). + Opposite of [`builtins.unsafeDiscardOutputDependency`](#builtins-addDrvOutputDependencies). )", .fun = prim_addDrvOutputDependencies }); diff --git a/tests/config.nix.in b/tests/config.nix.in index 99655552e48..76f0736712b 100644 --- a/tests/config.nix.in +++ b/tests/config.nix.in @@ -27,6 +27,7 @@ rec { fixUp = value: value // outputsMap // { # Not unsafe, and we will add back if we need it. + # Nixpkgs should do this too, when `addDrvOutputDependencies` makes it into the NixOS stable release. drvPath = (builtins.unsafeDiscardOutputDependency value.drvPath); };