NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.86k stars 1.52k forks source link

BasicDerivation: Add applyRewrites() method #11912

Closed edolstra closed 1 day ago

edolstra commented 2 days ago

Motivation

This is the first part of rewriteDerivation() factored out into its own method. It's not used anywhere else at the moment, but it's useful on lazy-trees for rewriting virtual paths.

Cherry-picked from the lazy-trees branch.

Context

Priorities and Process

Add :+1: to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

Ericson2314 commented 2 days ago

I think the fact that hashPlaceholder moved is making the diff harder to read. This "churn" wasn't intentional, was it? :)

Ericson2314 commented 2 days ago

I would also consider just inlining the rest of rewriteDerivation as it has to do with resolving, not rewriting, anyways.

edolstra commented 2 days ago

@Ericson2314 You mean get rid of rewriteDerivation() by inlining it into tryResolve()?

Ericson2314 commented 1 day ago

@edolstra Yes, but I am fine if that happens later.