Skip to content

Add builtins.addDrvOutputDependencies#9216

Merged
Ericson2314 merged 1 commit intoNixOS:masterfrom
obsidiansystems:addDrvOutputDependencies-pre
Oct 23, 2023
Merged

Add builtins.addDrvOutputDependencies#9216
Ericson2314 merged 1 commit intoNixOS:masterfrom
obsidiansystems:addDrvOutputDependencies-pre

Conversation

@Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Oct 23, 2023

Motivation

End goal: make (mkDerivation x).drvPath behave like a non-DrvDeep context.
Problem: users won't be able to recover the DrvDeep behavior when nixpkgs makes this change.
Solution: add this primop.

The new primop is fairly simple, and is supposed to complement other existing ones (builtins.storePath, builtins.outputOf) so there are simple ways to construct strings with every type of string context element.

(It allows nothing we couldn't already do with builtins.getContext and builtins.appendContext, which is also true of those other two primops.)

Context

This was originally in #8595, but then it was proposed to land some doc changes separately. So now the code changes proper is just moved to this, and the doc will be done in that.

Progress towards #7910.

Priorities

Add 👍 to pull requests you find important.

@Ericson2314 Ericson2314 requested a review from edolstra as a code owner October 23, 2023 15:56
@github-actions github-actions bot added the with-tests Issues related to testing. PRs with tests have some priority label Oct 23, 2023
@Ericson2314 Ericson2314 mentioned this pull request Oct 23, 2023
8 tasks
@Ericson2314 Ericson2314 force-pushed the addDrvOutputDependencies-pre branch from 0917a49 to 845c771 Compare October 23, 2023 16:00
Copy link
Member

@roberth roberth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

The finished part of #8595, which I see you've already re-titled to be about the (prosaic) docs.

(Just need to remove some links for now)

End goal: make `(mkDerivation x).drvPath` behave like a non-DrvDeep
context.

Problem: users won't be able to recover the DrvDeep behavior when
nixpkgs makes this change.

Solution: add this primop.

The new primop is fairly simple, and is supposed to complement other
existing ones (`builtins.storePath`, `builtins.outputOf`) so there are
simple ways to construct strings with every type of string context
element.

(It allows nothing we couldn't already do with `builtins.getContext` and `builtins.appendContext`, which is also true of those other two primops.)

This was originally in NixOS#8595, but then it was proposed to land some doc
changes separately. So now the code changes proper is just moved to
this, and the doc will be done in that.

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.nore
github.com>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io
@Ericson2314 Ericson2314 force-pushed the addDrvOutputDependencies-pre branch from 845c771 to 765436e Compare October 23, 2023 16:49
@Ericson2314 Ericson2314 enabled auto-merge October 23, 2023 16:50
@Ericson2314 Ericson2314 merged commit a58d7f1 into NixOS:master Oct 23, 2023
tebowy pushed a commit to tebowy/nix that referenced this pull request Jul 11, 2024
…encies-pre

Add `builtins.addDrvOutputDependencies`

(cherry picked from commit a58d7f1)
Change-Id: Ia5a1790bf29dfaf29287cc35cdae6b6d650e7a83
@Ericson2314 Ericson2314 deleted the addDrvOutputDependencies-pre branch August 14, 2025 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

with-tests Issues related to testing. PRs with tests have some priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants