Skip to content

fix(init): expose freshly-installed rustup to the same dot init run#113

Merged
UtkarshBhardwaj007 merged 1 commit into
mainfrom
fix/init-rustup-path
May 4, 2026
Merged

fix(init): expose freshly-installed rustup to the same dot init run#113
UtkarshBhardwaj007 merged 1 commit into
mainfrom
fix/init-rustup-path

Conversation

@UtkarshBhardwaj007

@UtkarshBhardwaj007 UtkarshBhardwaj007 commented May 4, 2026

Copy link
Copy Markdown
Member

Summary

  • On a clean macOS/Linux machine dot init shows rustup ✓ followed immediately by Rust nightly ✕ and rust-src ✕ with bash: rustup: command not found. The rustup installer drops rustup in $CARGO_HOME/bin (default ~/.cargo/bin) and only updates PATH via ~/.zshrc / ~/.bashrc / ~/.profile. Those edits never reach the running dot process — runShell spawns bash -c … which is non-interactive non-login, so it doesn't source the rc files, and inherits the parent's untouched PATH.
  • Fix: after the rustup install step succeeds, prepend $CARGO_HOME/bin to process.env.PATH so the very next steps in the same dot init run can resolve rustup. Logic lives in a new exported prependPath() helper in src/utils/toolchain.ts.
  • Adds src/utils/toolchain.test.ts covering prependPath (idempotent on duplicates, handles empty/unset PATH, prepends when missing). Includes a patch changeset.

Test plan

  • pnpm test — 454/454 pass, including 4 new prependPath cases
  • pnpm format:check clean
  • tsc --noEmit clean
  • On a clean macOS box: curl -fsSL https://raw.githubusercontent.com/paritytech/playground-cli/<this-branch>/install.sh | bash and confirm Rust nightly and rust-src come up ✓ on first run

The rustup installer drops binaries in $CARGO_HOME/bin and edits shell rc
files, neither of which reaches the running dot process. The next two
steps (Rust nightly, rust-src) then fail with `rustup: command not found`
on a clean machine. Prepend $CARGO_HOME/bin to process.env.PATH after
rustup install so the rest of `dot init` can resolve rustup immediately.
@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Dev build ready — try this branch:

curl -fsSL https://raw.githubusercontent.com/paritytech/playground-cli/main/install.sh | VERSION=dev/fix/init-rustup-path bash

@UtkarshBhardwaj007 UtkarshBhardwaj007 merged commit 3882020 into main May 4, 2026
16 checks passed
@UtkarshBhardwaj007 UtkarshBhardwaj007 deleted the fix/init-rustup-path branch May 4, 2026 11:25
@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

E2E Test Pass · ✅ PASS

Tag: e2e-ci-pr · Branch: fix/init-rustup-path · Commit: 5f8b61f · Run logs

Cell Result Time
pr-deploy-frontend ✅ PASS 6m07s
pr-deploy-foundry ✅ PASS 1m36s
pr-mod ✅ PASS 2m12s
pr-preflight ✅ PASS 3m08s
pr-init-session ✅ PASS 2m05s
pr-install ✅ PASS 0m47s
${{ matrix.cell }} ⏭️ SKIP 0m00s
${{ matrix.cell }} ⏭️ SKIP 0m00s

Sentry traces: view spans for this run

ottovlotto added a commit that referenced this pull request May 4, 2026
Bring in 19 commits of e2e infrastructure work that landed since this
branch was forked, including:

- PR #68: dynamic registry contract address resolution at runtime
- PR #78: e2e fixture fix to use the same live address (otherwise our
  registry-state assertions would query the snapshot contract while
  deploys write to the live one)
- PR #113: rustup post-install path patching — the actual fix for the
  paritytech/playground-app#118 bug our cold-start smoke job was added
  to catch
- Phase 5/6/7/8 e2e workflow restructuring (matrix-based cells,
  surface-failure helpers, post-release smoke, sticky PR comments)

Conflict resolution notes:

- e2e/cli/deploy.test.ts: kept main's runContractDeployTest helper +
  the new full-pipeline contract describes (foundry/hardhat/multi).
  Re-applied my QA tightening to the preflight tests (mainnet exact
  text + exit code, contracts-detected use the 'Checking availability'
  checkpoint, --contracts-no-project asserts exit code, availability-
  before-build verifies temporal ordering). Added registry-state
  verification to the frontend-only and re-deploy tests via the new
  getApp() fixture. DROPPED my 'already registered' tightening on the
  domain-taken test — in dev mode the availability check defers
  ownership to bulletin-deploy's preflight, so the rejection comes
  from the registry contract revert (Revive.ContractReverted), not
  the friendly availability message. Main's loose regex catches both
  paths correctly.

- e2e/cli/mod.test.ts: kept main's split into 'dot mod — clone' and
  'dot mod — registry miss' describes. Re-applied my exact-text
  tightening to both tests.

- .github/workflows/e2e.yml: kept main's matrix-cell structure
  entirely, appended my init-cold-smoke job at the end (still daily
  cron + workflow_dispatch only).
ottovlotto added a commit that referenced this pull request May 5, 2026
Bring in 19 commits of e2e infrastructure work that landed since this
branch was forked, including:

- PR #68: dynamic registry contract address resolution at runtime
- PR #78: e2e fixture fix to use the same live address (otherwise our
  registry-state assertions would query the snapshot contract while
  deploys write to the live one)
- PR #113: rustup post-install path patching — the actual fix for the
  paritytech/playground-app#118 bug our cold-start smoke job was added
  to catch
- Phase 5/6/7/8 e2e workflow restructuring (matrix-based cells,
  surface-failure helpers, post-release smoke, sticky PR comments)

Conflict resolution notes:

- e2e/cli/deploy.test.ts: kept main's runContractDeployTest helper +
  the new full-pipeline contract describes (foundry/hardhat/multi).
  Re-applied my QA tightening to the preflight tests (mainnet exact
  text + exit code, contracts-detected use the 'Checking availability'
  checkpoint, --contracts-no-project asserts exit code, availability-
  before-build verifies temporal ordering). Added registry-state
  verification to the frontend-only and re-deploy tests via the new
  getApp() fixture. DROPPED my 'already registered' tightening on the
  domain-taken test — in dev mode the availability check defers
  ownership to bulletin-deploy's preflight, so the rejection comes
  from the registry contract revert (Revive.ContractReverted), not
  the friendly availability message. Main's loose regex catches both
  paths correctly.

- e2e/cli/mod.test.ts: kept main's split into 'dot mod — clone' and
  'dot mod — registry miss' describes. Re-applied my exact-text
  tightening to both tests.

- .github/workflows/e2e.yml: kept main's matrix-cell structure
  entirely, appended my init-cold-smoke job at the end (still daily
  cron + workflow_dispatch only).
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