-
Notifications
You must be signed in to change notification settings - Fork 2
nix flake prefetch-inputs: Skip build-time inputs #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
nix flake prefetch-inputs: Skip build-time inputs #263
Conversation
WalkthroughThe changes add support for skipping build-time inputs in the flake prefetch-inputs command. This includes a guard in the implementation that returns early when buildTime is set, updated documentation explaining recursive behavior and build-time input filtering, and test coverage verifying the feature works correctly. Changes
Sequence DiagramsequenceDiagram
participant prefetch as prefetch-inputs
participant visitor as LockedNode Visitor
participant fetcher as fetchToStore
prefetch->>visitor: visit(lockedNode)
alt buildTime is set
visitor->>visitor: early return
Note over visitor: Skip this input
else buildTime not set
visitor->>fetcher: fetchToStore(...)
fetcher-->>visitor: fetched
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/nix/flake-prefetch-inputs.cc (1)
47-48: Consider adding debug logging for skipped build-time inputs.For better observability, consider logging when build-time inputs are skipped. This would help users understand why certain inputs are not being prefetched.
if (lockedNode->buildTime) + logger->cout(lvlDebug, fmt("skipping build-time input '%s'", lockedNode->lockedRef)); return;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/nix/flake-prefetch-inputs.cc(1 hunks)src/nix/flake-prefetch-inputs.md(1 hunks)tests/functional/flakes/build-time-flake-inputs.sh(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
tests/functional/flakes/build-time-flake-inputs.sh (1)
tests/functional/flakes/common.sh (2)
createGitRepo(127-136)createSimpleGitFlake(42-48)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build_aarch64-darwin / build
- GitHub Check: build_x86_64-linux / build
🔇 Additional comments (2)
src/nix/flake-prefetch-inputs.cc (1)
47-48: LGTM! The guard correctly skips build-time inputs.The early return ensures build-time inputs are not prefetched, which aligns with the PR objective. The placement after the
donecheck and before thefetchToStorecall is appropriate.src/nix/flake-prefetch-inputs.md (1)
15-15: LGTM! Documentation accurately describes the new behavior.The documentation clearly explains that the operation is recursive and that build-time inputs (with
buildTime = true) are skipped. This aligns with the implementation changes.
Motivation
Build-time inputs can already be fetched in parallel, so prefetching them is usually not what you want.
Context
Summary by CodeRabbit
New Features
flake prefetch-inputscommand now skips inputs marked withbuildTime = true.Documentation
flake prefetch-inputsrecursively fetches transitive inputs and explicitly skips build-time inputs.Tests