Skip to content

feat: add Rust as an SDK option#72

Merged
BrettKinny merged 1 commit into
mainfrom
claude/brave-rosalind
Apr 17, 2026
Merged

feat: add Rust as an SDK option#72
BrettKinny merged 1 commit into
mainfrom
claude/brave-rosalind

Conversation

@BrettKinny
Copy link
Copy Markdown
Collaborator

Summary

  • Adds Rust to the SDK picker in setup.sh via rustup (default toolchain: stable; --no-modify-path so squarebox owns PATH)
  • Follows the existing Python/Go/.NET pattern: install inline, PATH appended to ~/.squarebox-sdk-paths, binary verified at $HOME/.cargo/bin/rustc
  • Updates MOTD version readout, demo source script, and every docs/help enumeration of the SDK list

Test plan

  • Rebuild image, first-run setup shows Rust as a fifth option in the gum picker and numbered menu
  • Selecting Rust installs rustup; rustc, cargo, rustfmt, and cargo clippy all run after source ~/.squarebox-sdk-paths
  • Selection persists at /workspace/.squarebox/sdks and survives docker start -ai
  • sqrbx-setup --list shows rust in the SDKs line; sqrbx-setup sdks re-prompts with Rust pre-selected
  • MOTD shows Rust <ver> on login when installed
  • Non-interactive all expands to node,python,go,dotnet,rust

Notes

  • The demo gif (demo/squarebox-setup.gif) still needs re-recording via vhs demo/demo.tape on the demo branch — the source script is updated here.

🤖 Generated with Claude Code

Adds Rust to the SDK picker in setup.sh alongside Node.js, Python, Go,
and .NET. Install goes through rustup with the default toolchain
(stable) and --no-modify-path so squarebox manages PATH via
~/.squarebox-sdk-paths, matching the other SDKs. The default rustup
profile pulls in rustc, cargo, rustfmt, clippy, rust-std, and rust-docs.

- setup.sh: Rust wired into interactive gum picker, numbered
  non-interactive menu, "all" expansion, and dispatch; adds
  _install_rust_inner / install_rust modelled on _install_python_inner
- motd.sh: show rustc version when Rust is installed
- demo/setup-demo.sh: mirror new option in the recorded demo source
  (the gif still needs re-recording on the demo branch)
- README, CLAUDE.md, SECURITY.md, sqrbx-setup --help,
  regenerate-demo.md: update SDK enumerations

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 17, 2026 07:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Rust as a first-class SDK option across squarebox’s setup flow (install, selection UI, and documentation), using rustup and integrating with the existing persisted PATH mechanism.

Changes:

  • Extends setup.sh SDK selection (gum + numbered menu) to include Rust and installs it via rustup while appending ~/.cargo/bin to ~/.squarebox-sdk-paths.
  • Updates MOTD SDK version detection to display Rust when selected/installed.
  • Updates CLI help text, demo script, and docs enumerations to include Rust.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
setup.sh Adds Rust to SDK picker and implements rustup-based installation + PATH persistence.
scripts/squarebox-setup.sh Updates sqrbx-setup --help SDK list to include rust.
motd.sh Adds Rust version detection/display in MOTD.
demo/setup-demo.sh Updates demo SDK picker/options and simulated install messaging to include Rust.
SECURITY.md Documents rustup as a third-party installer in the security/trust model table and narrative.
README.md Adds Rust→rustup entry to the SDK table.
CLAUDE.md Updates setup wizard documentation to include Rust in SDK options.
.claude/commands/regenerate-demo.md Updates demo re-recording checklist to include Rust in SDK selection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread setup.sh
Comment on lines +1289 to +1309
_install_rust_inner() {
# Trust boundary: the rustup install script manages its own binary
# fetching and verification. We rely on HTTPS for script integrity.
# --no-modify-path: squarebox manages PATH via ~/.squarebox-sdk-paths.
curl --proto '=https' --tlsv1.2 -fsSL https://sh.rustup.rs \
| sh -s -- -y --default-toolchain stable --no-modify-path &>/dev/null
if ! grep -q '\.cargo/bin' ~/.squarebox-sdk-paths 2>/dev/null; then
cat <<'PATHS' >> ~/.squarebox-sdk-paths
export PATH="$HOME/.cargo/bin:$PATH"
PATHS
fi
}

install_rust() {
if [ -x "${HOME}/.cargo/bin/rustc" ]; then echo "Rust already installed, skipping."; return 0; fi
run_with_spinner "Installing Rust (via rustup)..." _install_rust_inner
if [ ! -x "${HOME}/.cargo/bin/rustc" ]; then
echo "Error: rustc binary not found after installation" >&2
return 1
fi
}
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rust SDK installation was added here, but the repo’s existing e2e coverage for the SDK section (see scripts/e2e-test.sh suite_setup_editors which currently seeds node,go) doesn’t exercise the new rust path. Add an e2e case that pre-seeds rust in /workspace/.squarebox/sdks and asserts rustc/cargo (and any expected components like rustfmt/clippy, if required) work after sourcing ~/.squarebox-sdk-paths to prevent regressions.

Copilot uses AI. Check for mistakes.
@BrettKinny BrettKinny merged commit 93f4be8 into main Apr 17, 2026
5 checks passed
@BrettKinny BrettKinny deleted the claude/brave-rosalind branch April 17, 2026 08:34
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.

2 participants