Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
  • Loading branch information
Ericson2314 and roberth authored Jul 14, 2023
1 parent 3438db9 commit 38040f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libexpr/primops/context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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
});
Expand Down
1 change: 1 addition & 0 deletions tests/config.nix.in
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down

0 comments on commit 38040f8

Please sign in to comment.