Repository navigation
docs: point Rust adopters at the Rust pack instead of a bare compiler - #1838
Merged
Merged
Conversation
gerchowl
force-pushed
the
feature/1831-rust-pack-adopter-docs
branch
from
October 5, 2026 19:13
e08770d to
85398ce
Compare
This was referenced Oct 5, 2026
gerchowl
force-pushed
the
feature/1831-rust-pack-adopter-docs
branch
from
October 5, 2026 19:32
85398ce to
b2fb0ab
Compare
Contributor
Author
|
Review follow-up: the notice's |
gerchowl
force-pushed
the
feature/1831-rust-pack-adopter-docs
branch
from
October 5, 2026 19:41
b2fb0ab to
9683956
Compare
…-pack notice Refs: #1831
gerchowl
added a commit
that referenced
this pull request
Oct 5, 2026
… ignore (#1839) ## Description The `install.sh --force` preflight refused **any** untracked file. A repo that had just gained a language, such as a Rust repo with `cargo build` output in `target/`, therefore could not take the very upgrade that adds the `.gitignore` fragment ignoring it. The workaround was to move the build directory aside. Same for `node_modules/`, `.venv/` and Nix `result` links. **Stack 5/6** for #1833. Base: #1838 (`feature/1831-rust-pack-adopter-docs`). ## Type of Change - [x] `fix` -- Bug fix - [x] `test` -- Adding or updating tests ## Changes Made The judgement moves to where the knowledge is. The host doesn't know the gitignore fragments or the detected languages; the image does. - **`install.sh`** (host): tracked changes still refuse, unchanged. Untracked paths (`git ls-files --others --exclude-standard --directory`) are no longer refused host-side. They are forwarded to the container as `DEVKIT_PREFLIGHT_UNTRACKED`. New `--allow-untracked` flag skips that check: it names the paths it leaves out, and tracked changes still refuse. - **`assets/init-workspace.sh`** (container): `preflight_untracked_guard` runs right after language detection, before any file is written. It assembles the root `.gitignore` this run will write (template base + the detected languages' `gitignore.d` fragments + `.gitignore.project`, the same parts `render_gitignore` uses) and matches each path with git's own matcher (`check-ignore --no-index`) in a scratch repo, because the workspace's `.git` may be an unmounted worktree pointer. Covered paths are named and left in place. Any other path refuses by name and hints `--allow-untracked` / `--skip-preflight`. - Build output of a language that **isn't detected** is not excused (`node_modules/` without a `package.json`), because its fragment won't be in the upgraded `.gitignore`. - `docs/MIGRATION.md` "Upgrade preflight guard and preview" documents the rule and the flag. ## Changelog Entry ### Fixed - **Untracked build output no longer blocks the upgrade that ignores it** ([#1826](#1826)) - The `install.sh --force` preflight refused any untracked file, so a repo that had just gained a language (a Rust repo with `target/`) could not take the very upgrade that adds its `.gitignore` fragment. Untracked paths are now matched against the `.gitignore` the upgrade will write; covered ones are named and left in place, any other one still refuses, by name - New `--allow-untracked` flag runs the upgrade with untracked files present; tracked changes still refuse ## Testing - [x] `install.bats` (5 new, 1 rewritten): untracked paths are forwarded rather than refused; a tracked change still refuses alongside `target/`; `--allow-untracked` proceeds and forwards nothing; `--allow-untracked` doesn't excuse a tracked change; a clean tree forwards nothing. All 30 `preflight` tests pass. - [x] `init-workspace.bats` (4 new): a Rust repo's `target/` passes while an untracked `Cargo.toml` is named; an uncovered path refuses **before `.vig-os` or `justfile` exist**; `node_modules/` without `package.json` refuses; `.gitignore.project` entries count as covered. - The issue's repro (neutral scaffold, then `Cargo.toml` + `cargo build`, then `install.sh --force`) is the first init-workspace test. ## Checklist - [x] My code follows the project's style guidelines - [x] I have performed a self-review of my code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have updated the documentation accordingly - [x] I have updated `CHANGELOG.md` in the `[Unreleased]` section (and pasted the entry above) - [x] I have added tests that prove my fix is effective or that my feature works Refs: #1826, #1833
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.
Description
The adopter docs never led a Rust consumer to the Rust pack, and
docs/MIGRATION.mdactively steered them away from it: it calledrustan unshipped candidate and recommendedextraPackages = [ pkgs.cargo pkgs.rustc ]. This PR fixes both passages, adds a Rust section the scaffold can link to, and has the scaffold print that link when a Rust repo's preserved files bypass the pack.Stack 4/6 for #1833. Base: #1837 (
feature/1496-rust-cold-adoption-entry).Type of Change
docs-- Documentation onlyfeat-- New feature (the scaffold notice)test-- Adding or updating testsChanges Made
docs/MIGRATION.mdnative. TheextraPackagesexample keeps only genuinely ad-hoc tools.native,node,docs,guardrails,rust), withrustused throughmkRustProject.nix flake init -t #rust, theninstall.sh) and what gets seeded; porting a repo scaffolded before it was Rust (pointers toassets/flake.d/rust.flake.nixand the cargo recipes);toolchainHashpinning;sandboxExcludes(mkRustProject: per-test exclusion seam for tests the Nix sandbox cannot run (PTY, signals, process groups) #1834); the base tool configs and advisories outside the sandbox.README.md(viadocs/templates/README.md.j2+just docs) anddocs/SOLO_ADOPTION.mdlink to the section.assets/init-workspace.sh:notice_rust_pack_bypass. In a Rust repo, it prints a notice when a preservedflake.nixdoesn't usemkRustProject, or a preservedjustfile.projectnever runs cargo. Each notice names the gap and links the MIGRATION section. It stays silent on a fresh scaffold, where Rust pack: L1/L4/L7 never shipped — the pack cannot be adopted cold #1496's seeds already landed. This is the issue's "print a notice whenDEVKIT_LANGUAGESgainsrust", scoped to the case that still needs it now that Rust pack: L1/L4/L7 never shipped — the pack cannot be adopted cold #1496 seeds automatically.Changelog Entry
Changed
docs/MIGRATION.mdno longer callsrustan unshipped candidate module or recommendsextraPackages = [ pkgs.cargo pkgs.rustc ]; a new "Rust projects: the Rust pack" section covers the new-repo path, porting a repo scaffolded before it was Rust, toolchain pinning,sandboxExcludesand the base tool configs.README.mdanddocs/SOLO_ADOPTION.mdlink to itflake.nixthat does not usemkRustProject, or ajustfile.projectthat never runs cargo, naming the doc section that fixes itTesting
test_bypass_notice_links_to_a_real_migration_heading: everydocs/MIGRATION.md#…anchor ininit-workspace.shresolves to a real heading. It failed until the section existed.#1496|#1831bats tests pass locally.Checklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Refs: #1831, #1833