-
Notifications
You must be signed in to change notification settings - Fork 0
fix(preflight): the sol-shell probe takes a GC root for the closure it realises #324
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
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: rainlanguage/issue-pr-cron
Length of output: 5884
🌐 Web query:
Nix 2.31 manual keep-outputs keep-derivations garbage collector semantics💡 Result:
In Nix 2.31, the garbage collector (GC) behavior is determined by the
keep-derivationsandkeep-outputsconfiguration settings [1][2]. These options control which files in the Nix store are considered "live" and thus preserved during collection [1][2]. keep-derivations (default: true) When enabled, this option ensures that all derivations (.drv files) that are build-time dependencies of your GC roots are preserved [1][3]. Because build-time dependencies are required to rebuild a package, keeping them prevents unnecessary re-downloading or re-building of dependencies [1][3]. keep-outputs (default: false) When enabled, this option instructs the GC to consider the output paths of any "live" derivation as live themselves [1][4]. Ordinarily, Nix tracks runtime dependencies (what a program needs to run); keep-outputs essentially expands the set of protected files to include all outputs of derivations that are currently reachable via GC roots [1][4]. Summary of Semantics - The default configuration (keep-derivations=true, keep-outputs=false) keeps the derivations (build recipes) necessary to reconstruct your roots and the runtime dependencies of those roots [1][3]. - Enabling both (keep-derivations=true, keep-outputs=true) is often used during development [1][3]. It creates a broader preservation set, ensuring that even if a path is not a direct runtime dependency, it will not be deleted if it is an output of a derivation that is still referenced [1][4]. This helps maintain quick rebuild times by keeping intermediate build artifacts in the store [1][3]. You can verify which paths would be affected by the GC by using the --print-dead or --print-live flags with nix-store --gc [1][5][6].Citations:
🏁 Script executed:
Repository: rainlanguage/issue-pr-cron
Length of output: 515
🌐 Web query:
site:releases.nixos.org/nix/nix-2.31.3/manual keep-derivations outputs reachable GC roots💡 Result:
There is no configuration option named keep-derivations in the official Nix 2.31.3 documentation. Nix manages garbage collection (GC) by identifying reachable store objects via GC roots, which are primarily established through profiles (such as those managed by nix-env) or by explicitly registering paths using the --add-root flag with commands like nix-store --realise or nix-build [1][2][3][4]. While the documentation discusses keep-going and keep-failed as options to manage build behavior during failures, none of these options establish persistent GC roots for derivations [1][3][5]. If you are looking to prevent the garbage collector from removing derivations or their outputs, you must ensure they are reachable from a GC root, such as by including them in a profile or using --add-root to create a symlink to them in a location monitored by the garbage collector [2][4][6].
Citations:
🏁 Script executed:
Repository: rainlanguage/issue-pr-cron
Length of output: 13085
🌐 Web query:
Nix manual keep-outputs keep-derivations "reachable" "GC roots"💡 Result:
In Nix, garbage collection (GC) works by removing all paths in the Nix store that are not reachable from a set of defined "GC roots" [1][2]. GC roots are paths (usually symlinks) that point to store paths, effectively marking them and their dependencies as "live" [1][2]. The configuration options keep-outputs and keep-derivations influence how the garbage collector treats paths during this process [3][4][5]. keep-derivations - Default: true [3][4][6] - Function: When true, the garbage collector will keep the derivation files (.drv) used to build any store path that is currently being kept (i.e., not garbage) [3][4]. - Benefit: This provides better traceability and allows you to query how a path was built, including its build-time dependencies [3][4]. - Note: Setting this to false can save disk space by removing the derivation files themselves [3][4]. keep-outputs - Default: false [3][4][6] - Function: When true, the garbage collector will keep all outputs of any derivation that is currently being kept [3][4]. - Benefit: This is often useful for development. Even if an output is not explicitly registered as a GC root or reachable from one, it will be preserved if the corresponding derivation is still kept [3][4]. It also helps prevent the removal of build-time dependencies that are otherwise not part of the runtime closure [3][4]. - Note: When false (the default), only outputs that are GC roots (or reachable from them) are preserved [3][4]. In summary, the default configuration (keep-derivations=true, keep-outputs=false) ensures that build-time information (derivations) is retained for all kept paths, while only strictly necessary outputs (those reachable from roots) are preserved [5]. Enabling keep-outputs=true effectively extends the "live" set to include all outputs of all kept derivations, which can simplify development workflows at the cost of higher disk usage [3][5].
Citations:
Correct the GC-retention explanation.
keep-outputsandkeep-derivationsdo not create a GC root. They only retain outputs or derivations associated with non-garbage paths. Without a GC root, the realized shell is not guaranteed to remain available.🤖 Prompt for AI Agents