Skip to content

setup: detect release-bundled components as present (follows #230) - #231

Merged
caomengxuan666 merged 2 commits into
masterfrom
feat/setup-detect-bundled
Oct 9, 2026
Merged

caomengxuan666 merged 2 commits into
masterfrom
feat/setup-detect-bundled

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Follow-up to #230 (and the leftover point 3 of #209): the release bundle now ships gawk/niugit/ripgrep/fd via scripts/release/preinstall.json, but the setup wizard and niu doctor still probed only PATH, so bundled components could be reported as missing or re-recommended for install.

What changed

  • Bundled detection (setup_wizard.rs): over the discovered winuxcmd installation root, a component counts as present when its opt/<pkg> payload or any usr/bin shim (winuxcmd.exe hardlink) exists — fail-open, so an arm64 leg that skipped niugit/gawk simply stays undetected.
  • EnvProbe source annotation: bundled tool names satisfy the tool probes (conditional aliases expand, nothing is flagged missing); the environment summary labels them rg (bundled) and adds a bundle row naming the packages actually shipped (shipped with the release / none).
  • niu-git question: skipped entirely (and recorded as installed in wizard-answers.toml) when the bundle already ships niu-git — never re-offer installing what is already there. Without the bundle, behavior is unchanged (plain skip writes no lasting answer).
  • niu doctor: new advisory row bundled tools ... with the honest source label (shipped with the release, not system installs), or none when the install ships nothing.

Tests

  • detection: opt payload counts, shim-only counts, empty root / no root detect nothing;
  • probe satisfaction with bundled source, and no re-annotation when the tool also resolves on PATH;
  • niu-git question skipped + recorded when bundled; still offerable without the bundle;
  • doctor row truth (both branches);
  • verified on a live install: niu doctor reports bundled tools gawk niugit fd from the real opt/ + usr/bin layout, correctly omitting the absent ripgrep.

Pre-existing unrelated failures in plugins::distros tests (network git clone) reproduce on the base commit and are untouched by this PR.

Closes #230's follow-up scope; does not modify the manifest itself.

caomengxuan666 and others added 2 commits October 9, 2026 20:58
#209)

Extend the #189 manifest-driven pre-install to the #209 must-install
bundle: niugit (so 'niu setup' full distro no longer 5-fails on a
gitless machine), ripgrep and fd, alongside gawk. Manifest-only change
- the workflow's install/shim/verify plumbing is already generic and
manifest-driven. No archive formats, no symlinks (hardlink shims only),
no runtime downloads: assembly stays in CI.

- scripts/release/preinstall.json: add niugit/ripgrep/fd entries with
  purposes, update the architecture note (ripgrep/fd carry arm64
  artifacts and pre-install on both legs; niugit/gawk are x64-only)
- tests/preinstall_manifest.rs: pin the four-package must-install
  bundle as a contract
- release.yml: release body + step comment now disclose the bundle and
  the per-leg arm64 caveat

CI artifact verification (usr/bin/git.exe, rg.exe, fd.exe in the
staged package, --version smoke) is enforced by the existing verify
step and lands with the next release run.
The release bundle (scripts/release/preinstall.json, #230/#209) ships
gawk, niugit, ripgrep and fd into the winuxcmd tree as opt/<pkg>
payloads plus usr/bin winuxcmd.exe shims. The setup wizard and doctor
now count an existing payload or shim as present, so a bundled
component is never reported missing, never re-recommended for install,
and its aliases still expand:

- bundled detection over the winuxcmd installation root (opt payload
  OR usr/bin shim, fail-open); EnvProbe annotates tool sources, and
  the environment summary labels bundled tools '(...)' plus a bundle
  row naming the packages actually shipped;
- the Windows-only niu-git question is skipped and recorded as
  'installed' when opt/niugit or the git shim is already there;
- 'niu doctor' gains an advisory 'bundled tools' row with the honest
  source label (bundled vs system, none when the leg shipped without).

Tests: payload/shim/missing/None detection, probe satisfaction and
label non-shadowing, niu-git skip vs. still-offered, doctor row truth.
@caomengxuan666
caomengxuan666 merged commit 3a77891 into master Oct 9, 2026
3 of 9 checks passed
@caomengxuan666
caomengxuan666 deleted the feat/setup-detect-bundled branch October 9, 2026 13:14
caomengxuan666 added a commit that referenced this pull request Oct 10, 2026
- Delete docs/eco-harvest-resume-wt97b.md: point-in-time lane resume/handoff snapshot; the harvest/test line now runs on GitHub Actions (eco-harvest-ci.yml) and the diagnosis lives in git history.
- CHANGELOG: add Unreleased entries for strip (#228), setup help/non-tty banner (#229), bundled niugit/ripgrep/fd + setup detection (#230/#231), PROMPT_COMMAND exit jump (#232), PS0 stderr (#233), bracketed paste (#234).

Co-authored-by: docs-audit <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant