fetchTree: Return a path instead of a store path#10225
Draft
edolstra wants to merge 7 commits intoNixOS:masterfrom
Draft
fetchTree: Return a path instead of a store path#10225edolstra wants to merge 7 commits intoNixOS:masterfrom
edolstra wants to merge 7 commits intoNixOS:masterfrom
Conversation
4 tasks
This picks a number of changes from the lazy-trees branch. As it is hand picked, and does not include some other necessary changes, it does not build. Subsequent commits will fix that. I have added a couple of comments of my own as well. Co-authored-by: Eelco Dolstra <[email protected]>
This fixes the double copy problem and improves performance
for expressions that don't force the whole source to be added to the
store.
Rules for fast expressions:
- Use path literals where possible
- import ./foo.nix
- Use + operator with slash in string
- src = fetchTree foo + "/src";
- Use source filtering, lib.fileset
- AVOID toString
- If possible, AVOID interpolations ("${./.}")
- If possible, move slashes into the interpolation to add less to the store
- "${./src}/foo" -> "${./src/foo}"
toString may be improved later as part of lazy-trees, so these
recommendations are a snapshot. Path values are quite nice though.
This allows clever editors/IDEs to discern the path more easily for Ctrl+Click navigate to functionality, e.g. when building .?ref=HEAD
This showPath is getting a little too ad hoc, but it works for now.
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
Fixes #10115.
Context
Priorities and Process
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.