2023-08-08 Nixpkgs Architecture Team Meeting #42

Agenda/Notes

RFC 140

Packages Modules WG

Nixpkgs CLI working group search: Nixpkgs CLI Working Group Member Search

  • 3 people are interested.
  • Let’s leave it up to the people in the thread to start it

pkg.drvPath string context / DrvDeep

Inquiry by @roberth. Nix team proposes to change the semantics of .drvPath not in Nix but in Nixpkgs. Nix team believes it is a strange behavior and should be changed as far as users are concerned.

Current semantics:

  • String context of drvPath contains the .drv file and referenced .drv files transitively and the outputs and the outputs of all build dependencies transitively.
    Proposed semantics:
  • String context of drvPath contains the .drv file and referenced .drv files transitively.

We can not change this in Nix builtins.derivation{,Strict} because that would break old expressions.
Hence the proposal to use the Nixpkgs pin to make the change.

Proposed change in Nixpkgs:

  • Change mkDerivation to apply builtins.unsafeDiscardOutputDependency, which is not unsafe but applies exactly the proposed change in semantics.
    • For input-addressed derivations it is possible to extract output paths without context, but we believe this does not defy anyone’s expectations.
  • Check usages of .drvPath in Nixpkgs itself

Impact mitigations:

  • Allow users to revert their pin of Nixpkgs while they track down the effect of the change. (grep -F .drvPath, nix-diff?)
    • We expect most usages to be in “advanced functions” which we expect to be comparatively rare outside nixpkgs.
  • Add builtins.addDrvOutputDependencies to recover the old semantics where users need it.

Discussion

2 Likes