feat(install): converge to one canonical .sh + .ps1 entry point per platform - #1556
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR relocates the Windows installer to a canonical location under ChangesWindows Installer Relocation and Non-macOS Auto-Selection
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…latform Implements Option A from issue #1555: every user-facing install URL collapses to `libs/cua-driver/scripts/install.{sh,ps1}`. Old `libs/cua-driver-rs/scripts/install.{sh,ps1}` URLs keep working via auto-delegation + redirect shim. - New auto-delegation block: when `uname -s` is anything other than `Darwin`, automatically flip `USE_RUST_BACKEND=1` and route through the existing `--experimental-rust` codepath. Effectively: `curl … cua-driver/scripts/install.sh | bash` now Just Works on Linux — installs the Rust port without the user having to know about the flag. - macOS users: behavior unchanged — Swift driver is still the default; `--experimental-rust` / `--backend=rust` still opts into Rust explicitly. - The post-detection note distinguishes manual opt-in ("installing experimental Rust backend") from auto-selection ("installing cua-driver-rs — canonical on non-macOS"); no "experimental" framing where the Rust port isn't experimental. - Moved verbatim from `libs/cua-driver-rs/scripts/install.ps1`. Same code, same baked-version constant, same behavior. The Swift driver has no Windows installer at all, so this directory's `install.ps1` is now the single Windows entry point for both Swift (N/A) and Rust (the real install). - Replaces the prior 951-line full installer with a 30-line shim that `Invoke-WebRequest`'s the canonical script from `cua-driver/scripts/install.ps1` and `iex`-pipes it. Params (`-Release`, `-AutoStart`), env vars (`$env:CUA_DRIVER_RS_VERSION`), and progress output all flow through unchanged. Prints a deprecation note pointing at the new URL. - Old one-liners (`irm https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver-rs/scripts/install.ps1 | iex`) keep working forever — they just take an extra HTTP hop. No release on the old URL becomes inaccessible. - The "Stage release files" step now copies `install.ps1` from `libs/cua-driver/scripts/install.ps1` (canonical) — `install.sh` continues to come from `libs/cua-driver-rs/scripts/install.sh` until the followup PR inlines the Rust install logic into the Swift script. - Both bake-version `sed` invocations (the in-tree pass + the post-release commit-to-main pass) updated to target the new install.ps1 path. - Release-notes template's Windows install snippet now references the canonical URL `libs/cua-driver/scripts/install.ps1` with a note that the old URL still works via shim. | Platform | Canonical URL | What it installs | |---|---|---| | macOS | `…/libs/cua-driver/scripts/install.sh` (no flag) | Swift cua-driver (today's default; flips when Rust hits parity) | | macOS | `…/libs/cua-driver/scripts/install.sh --experimental-rust` | cua-driver-rs | | Linux | `…/libs/cua-driver/scripts/install.sh` (auto-detected) | cua-driver-rs | | Windows | `…/libs/cua-driver/scripts/install.ps1` | cua-driver-rs | Hermes (`tools/computer_use/cua_backend.py:6` hardcodes `…/libs/cua-driver/scripts/install.sh`) keeps working with no changes. - **Inline merge** of the ~600 LOC of Rust install logic from `libs/cua-driver-rs/scripts/install.sh` into the `--experimental-rust` block of `libs/cua-driver/scripts/install.sh`. Today the Swift script still execs the Rust script when `USE_RUST_BACKEND=1`. The user-facing URL is converged; the internal code path is still two files. The follow-up cleanup is purely an internal dedupe — no URL changes. - **Shim at `libs/cua-driver-rs/scripts/install.sh`**. Deferred until the inline merge so the shim has somewhere to delegate. Today users running that URL directly still get the same standalone Rust installer; nothing breaks. - [ ] macOS: `curl …/libs/cua-driver/scripts/install.sh | bash` (no flags) → Swift install, no Rust-related output (behavior unchanged from main). - [ ] macOS: `curl …/libs/cua-driver/scripts/install.sh | bash -s -- --experimental-rust` → "installing experimental Rust backend" note + cua-driver-rs installed. - [ ] Linux: `curl …/libs/cua-driver/scripts/install.sh | bash` → "detected non-macOS host (Linux)" note + cua-driver-rs installed automatically. - [ ] Windows: `irm …/libs/cua-driver/scripts/install.ps1 | iex` → cua-driver-rs installed at the same locations as before. - [ ] Windows backward compat: `irm …/libs/cua-driver-rs/scripts/install.ps1 | iex` → deprecation note + same end state. Builds on the design in issue #1555.
7a37de6 to
dc08c04
Compare
…cated (#1557) Completes the install-script convergence started in #1556. After this PR, **all** user-facing install URLs and the actual Rust install logic live under `libs/cua-driver/scripts/`. Old `libs/cua-driver-rs/scripts/install.sh` URL keeps working via a redirect shim — Hermes and any other integration that hardcodes it stays valid. ## What changed ### File moves - `libs/cua-driver-rs/scripts/install.sh` → `libs/cua-driver/scripts/_install-rust.sh` (renamed + relocated; git tracks the rename). This is now a **private helper** invoked by the canonical `install.sh` — the leading underscore signals "internal; do not invoke directly". - `libs/cua-driver-rs/scripts/install.sh` recreated as a 45-line backward-compat shim. Prints a deprecation note, then `exec`s the canonical `cua-driver/scripts/install.sh --backend=rust "$@"` (on-disk if available; falls back to `curl | bash` for the legacy `curl … cua-driver-rs/scripts/install.sh | bash` flow). ### Canonical install.sh (`libs/cua-driver/scripts/install.sh`) - `RUST_INSTALLER_URL` updated to point at `cua-driver/scripts/_install-rust.sh` (the new canonical location for the Rust install logic). - On-disk lookup in the `--experimental-rust` block prefers the colocated `_install-rust.sh`; falls back to the legacy `cua-driver-rs/scripts/install.sh` path for trees that haven't been migrated yet (defensive — keeps dev workflows on older checkouts working). - Comments updated throughout to reflect the new layout. ### CD workflow (`.github/workflows/cd-rust-cua-driver.yml`) - Bake-version sed targets `libs/cua-driver/scripts/_install-rust.sh` instead of `libs/cua-driver-rs/scripts/install.sh`. Both the in-tree pass (release artifact) and the post-release push-to-main pass updated. - Stage-release-files step copies `install.sh`, `install.ps1`, and `_install-rust.sh` all from `libs/cua-driver/scripts/`. The `_install-rust.sh` is published as a release asset too so `curl | bash` flows can fetch it independently. - Release-notes template's Linux/macOS install snippet now points at `cua-driver/scripts/install.sh` with a note explaining auto-detect on Linux + `--experimental-rust` opt-in on macOS. ### Other docs / refs - `docs/content/docs/cua-driver/guide/getting-started/installation.mdx`: `--experimental-rust` delegation link points at `_install-rust.sh`; Rust-direct install one-liners now use the canonical `cua-driver/scripts/install.{sh,ps1}` URLs. - `libs/cua-driver-rs/Skills/cua-driver-rs/README.md`: Linux install URL updated to the canonical path. - `libs/cua-driver-rs/crates/cua-driver/src/cli.rs`: `cua-driver update` output's install-suggestion URLs updated to the canonical path. - `libs/cua-driver/scripts/install.ps1`: self-referencing URL in its own header doc updated to the canonical path. ## End state ``` libs/cua-driver/scripts/ install.sh ← canonical user-facing (.sh) installer for ALL platforms install.ps1 ← canonical user-facing (.ps1) installer for Windows _install-rust.sh ← private helper; the actual Rust install logic install-local.sh ← dev-loop Swift installer ... libs/cua-driver-rs/scripts/ install.sh ← backward-compat shim (45 lines; redirects to ../cua-driver/scripts/install.sh --backend=rust) install.ps1 ← backward-compat shim (30 lines; redirects to ../cua-driver/scripts/install.ps1) install-local.{sh,ps1} ← dev-loop Rust installers (build from source; stay here) ``` User-facing URL matrix: | Platform | URL | Backend | |---|---|---| | macOS | `…/libs/cua-driver/scripts/install.sh` | Swift (default); `--experimental-rust` for Rust | | Linux | `…/libs/cua-driver/scripts/install.sh` | Rust (auto-detected) | | Windows | `…/libs/cua-driver/scripts/install.ps1` | Rust | | Any | `…/libs/cua-driver-rs/scripts/install.{sh,ps1}` | Redirect shim → canonical URL | Hermes (`tools/computer_use/cua_backend.py:6`) — unchanged URL, unchanged behavior. ## Test plan - [ ] macOS: `curl …/libs/cua-driver/scripts/install.sh | bash` → Swift install, no Rust output. - [ ] macOS: `curl …/libs/cua-driver/scripts/install.sh | bash -s -- --experimental-rust` → "installing experimental Rust backend" + canonical Rust install (helper called inline). - [ ] Linux: `curl …/libs/cua-driver/scripts/install.sh | bash` → "detected non-macOS host (Linux)" + Rust install via colocated `_install-rust.sh`. - [ ] Linux backward-compat: `curl …/libs/cua-driver-rs/scripts/install.sh | bash` → deprecation note + delegates to canonical script with `--backend=rust` + Rust install. - [ ] Windows: `irm …/libs/cua-driver/scripts/install.ps1 | iex` → cua-driver-rs installed. - [ ] Windows backward-compat: `irm …/libs/cua-driver-rs/scripts/install.ps1 | iex` → deprecation note + canonical install. Closes #1555.
Summary
Implements Phase 1 of Option A from issue #1555: every user-facing install URL collapses to
libs/cua-driver/scripts/install.{sh,ps1}. Old URLs keep working via auto-delegation (.sh) + redirect shim (.ps1).This unblocks the convergence story without doing the risky 600-LOC inline merge of Rust install logic into the Swift script — that's the Phase 2 cleanup which can land separately when macOS testing is convenient.
What this PR does
…/libs/cua-driver/scripts/install.sh→ Swift driver--experimental-rustopts into Rust.…/libs/cua-driver/scripts/install.sh→ errors with "macOS-only"uname -s != Darwin, flipsUSE_RUST_BACKEND=1automatically, delegates to cua-driver-rs install. Printsnote: detected non-macOS host (Linux); auto-selecting the cua-driver-rs Rust backend.…/libs/cua-driver-rs/scripts/install.sh→ standalone Rust installer…/libs/cua-driver-rs/scripts/install.ps1→ Rust installer…/libs/cua-driver/scripts/install.ps1is now the canonical URL. The Rust port is what installs — only the URL moved.…/libs/cua-driver-rs/scripts/install.ps1becomes a 30-line redirect shim thatInvoke-WebRequest's the new URL andiex-pipes it. Params + env vars flow through unchanged.Files
libs/cua-driver/scripts/install.sh— new auto-delegation block ahead of the existing--experimental-rustcodepath. macOS behavior bit-identical to main; non-macOS auto-flips to Rust.libs/cua-driver/scripts/install.ps1— new (moved fromlibs/cua-driver-rs/scripts/install.ps1). Same code; canonical Windows entry point.libs/cua-driver-rs/scripts/install.ps1— replaced with a 30-line shim that fetches + executes the canonical script. Deprecation note prints. Old URL still works..github/workflows/cd-rust-cua-driver.yml— updated to bake versions into the newinstall.ps1path; release-notes template's Windows install snippet now points at the canonical URL.What this PR does NOT do (Phase 2, deferred)
libs/cua-driver/scripts/install.sh --experimental-ruststill execslibs/cua-driver-rs/scripts/install.sh. User-facing URL is converged; internal code path is still two files. Phase 2 collapses them.libs/cua-driver-rs/scripts/install.sh. Deferred until Phase 2 so the shim has a single canonical script to delegate to.These are pure internal cleanups — Phase 2 has no URL changes and is safe to land separately once a macOS box is handy for end-to-end testing the merged script.
Hermes compatibility
Hermes hardcodes
https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.shintools/computer_use/cua_backend.py. This URL keeps working unchanged in every phase. Today: Swift install on macOS (no behavior change). Phase 2-flip-day: Rust install on macOS via the same URL (one-line CD edit). Hermes never needs to update.Test plan
curl …/libs/cua-driver/scripts/install.sh | bash(no flags) → Swift install, no Rust-related output.curl …/libs/cua-driver/scripts/install.sh | bash -s -- --experimental-rust→ "installing experimental Rust backend" note + cua-driver-rs installed.curl …/libs/cua-driver/scripts/install.sh | bash→ "detected non-macOS host (Linux); auto-selecting the cua-driver-rs Rust backend" note + cua-driver-rs installed automatically.irm …/libs/cua-driver/scripts/install.ps1 | iex→ cua-driver-rs installed at the same locations as before.irm …/libs/cua-driver-rs/scripts/install.ps1 | iex→ deprecation note + same end state.Closes part 1 of #1555.
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Chores