Skip to content

Make NixStringContextElem::DrvDeep opt-in, and maybe deprecate it #7910

@Ericson2314

Description

@Ericson2314

Currently, drvPath attributes have a very weird DrvDeep nix string context elem. This string context element makes refer to

all the outputs of all the derivations in the the closure of the path.

The "all the outputs part" is really weird! builtins.unsafeDiscardOutputDependency turns this back to a regular string context, but it is unfortunate to have to use an "unsafe" function to get back to the more normal behavior.

Instead, it would be nice if drvPath had a regular Opaque string context, and instead there was a primop to do the opposite: turn a string with a single such opaque string context elem to one with a single drv-deep string context elem.

See also #7330

TODO
  • Add a builtins.addDrvOutputDependencies primop
  • Wait for Nix on NixOS stable to support it
  • Add builtins.unsafeDiscardOutputDependency to Nixpkgs mkDerivation's drvPath.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions