Make nix flake metadata|update|lock lazy#12432
Open
edolstra wants to merge 7 commits intoNixOS:masterfrom
Open
Make nix flake metadata|update|lock lazy#12432edolstra wants to merge 7 commits intoNixOS:masterfrom
nix flake metadata|update|lock lazy#12432edolstra wants to merge 7 commits intoNixOS:masterfrom
Conversation
Member
|
👍
This could still be done by hashing without copying, but that behavior is still slower than ideal, so it should be removed (as you did) or be put behind a flag perhaps if it is needed. I feel like it's not "metadata" though. |
roberth
reviewed
Feb 7, 2025
Member
roberth
left a comment
There was a problem hiding this comment.
This introduces some new code paths for which it would have been nice to remove the old, strict / copying ones, but that'd be too soon. Looks ok.
|
🎉 All dependencies have been resolved ! |
These don't need to evaluate anything (except for the flake metadata in flake.nix) so we can make these commands operate on lazy trees without risk of any semantic change in the evaluator. However, `nix flake metadata` now no longer prints the store path, which is a breaking change (but unavoidable if we want lazy trees).
For the top-level flake, we don't need a NAR hash. But for inputs, we do. Also, add a test for the lazy behaviour of `nix flake metadata|lock`.
a15123a to
2890a2e
Compare
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Open
Contributor
|
Still seems useful if we want to make progress on lazy paths. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
These don't need to evaluate anything (except for the flake metadata in
flake.nix) so we can make these commands operate on lazy trees (i.e. without having to copy the inputs to the store) without risk of any semantic change in the evaluator.However, as a result,
nix flake metadatanow no longer prints the store path, which is a breaking change (but unavoidable if we want lazy trees). So calls likenix flake metadata --json | jq .pathshould be replaced bynix flake prefetch --json | jq .storePath.Depends on #12421.
TODO: add release note.
Context
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.