Skip to content

feat(install): converge to one canonical .sh + .ps1 entry point per platform - #1556

Merged
f-trycua merged 1 commit into
mainfrom
feat/cua-driver-install-convergence
May 18, 2026
Merged

feat(install): converge to one canonical .sh + .ps1 entry point per platform#1556
f-trycua merged 1 commit into
mainfrom
feat/cua-driver-install-convergence

Conversation

@f-trycua

@f-trycua f-trycua commented May 18, 2026

Copy link
Copy Markdown
Collaborator

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

Before After
macOS …/libs/cua-driver/scripts/install.sh → Swift driver Unchanged. Swift default; --experimental-rust opts into Rust.
Linux …/libs/cua-driver/scripts/install.sh → errors with "macOS-only" Auto-detects uname -s != Darwin, flips USE_RUST_BACKEND=1 automatically, delegates to cua-driver-rs install. Prints note: detected non-macOS host (Linux); auto-selecting the cua-driver-rs Rust backend.
Linux backward-compat …/libs/cua-driver-rs/scripts/install.sh → standalone Rust installer Unchanged in this PR (Phase 2 inlines the logic + shims the rs URL).
Windows …/libs/cua-driver-rs/scripts/install.ps1 → Rust installer …/libs/cua-driver/scripts/install.ps1 is now the canonical URL. The Rust port is what installs — only the URL moved.
Windows backward-compat (the only URL) …/libs/cua-driver-rs/scripts/install.ps1 becomes a 30-line redirect shim that Invoke-WebRequest's the new URL and iex-pipes it. Params + env vars flow through unchanged.

Files

  • libs/cua-driver/scripts/install.sh — new auto-delegation block ahead of the existing --experimental-rust codepath. macOS behavior bit-identical to main; non-macOS auto-flips to Rust.
  • libs/cua-driver/scripts/install.ps1new (moved from libs/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 new install.ps1 path; release-notes template's Windows install snippet now points at the canonical URL.

What this PR does NOT do (Phase 2, deferred)

  • Inline merge of Rust install logic into the Swift script. Today libs/cua-driver/scripts/install.sh --experimental-rust still execs libs/cua-driver-rs/scripts/install.sh. User-facing URL is converged; internal code path is still two files. Phase 2 collapses them.
  • Shim at 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.sh in tools/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

  • macOS: curl …/libs/cua-driver/scripts/install.sh | bash (no flags) → Swift install, no Rust-related output.
  • 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); auto-selecting the cua-driver-rs Rust backend" 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.

Closes part 1 of #1555.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Automatic Rust backend selection on non-macOS systems for streamlined installation.
  • Chores

    • Reorganized installer distribution pipeline with canonical locations for Windows installers.
    • Legacy installer paths now serve as deprecation redirects to new canonical locations.
    • Updated release workflow to stage and reference canonical installer paths.

Review Change Stack

@vercel

vercel Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview May 18, 2026 0:48am

Request Review

@coderabbitai

coderabbitai Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 392e8e4c-4ee8-4a57-993c-1e0df5d778fa

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR relocates the Windows installer to a canonical location under libs/cua-driver/scripts/install.ps1, replaces the old Rust-path location with a deprecation shim, updates the CD workflow and release process to reflect the change, and enables automatic Rust backend selection on non-macOS hosts.

Changes

Windows Installer Relocation and Non-macOS Auto-Selection

Layer / File(s) Summary
Canonical Windows Installer Implementation
libs/cua-driver/scripts/install.ps1
944-line comprehensive PowerShell installer that downloads cua-driver.exe from GitHub Releases, installs into versioned directories under the user's home, manages concurrent installs via lockfile serialization, wires NTFS directory junctions for atomic upgrades, prunes stale releases, supports optional auto-start registration, validates user PATH, and sends telemetry pings.
Deprecation Shim and CI/CD Integration
libs/cua-driver-rs/scripts/install.ps1, .github/workflows/cd-rust-cua-driver.yml
Replaces the old Rust-path installer with a lightweight shim that downloads and executes the canonical script; updates the CD workflow to bake the version into the canonical path, stage it in releases, update release notes with a deprecation warning, and commit the new location.
Shell Script Non-macOS Auto-Selection
libs/cua-driver/scripts/install.sh
Detects non-macOS hosts and automatically sets USE_RUST_BACKEND=1 without requiring explicit flags; updates delegation messaging to distinguish auto-selection from manual opt-in.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

  • trycua/cua#1555: The PR directly implements the Windows installer path convergence and backward-compatibility shim strategy described in the issue.

Possibly related PRs

  • trycua/cua#1540: Introduced the original comprehensive Windows installer and initial workflow wiring; this PR relocates that installer and adds the deprecation shim.
  • trycua/cua#1538: Modified install.sh to route to the Rust backend via explicit flags; this PR extends that by adding automatic non-macOS detection.
  • trycua/cua#1550: Introduced the cua-driver autostart {enable|disable|status|kick} CLI verbs that the canonical installer now delegates to for auto-start registration.

Poem

🐰 The Windows path finds its home,
While old roads shimmer into foam,
On Linux toes, the Rust takes flight,
No flags required—just get it right!
One script to rule them, dark and light. 🌙

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: converging to canonical install entry points (.sh and .ps1) per platform, which aligns with the substantial refactoring across multiple installer scripts and workflow configurations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cua-driver-install-convergence

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…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.
@f-trycua
f-trycua force-pushed the feat/cua-driver-install-convergence branch from 7a37de6 to dc08c04 Compare May 18, 2026 12:48
@f-trycua
f-trycua merged commit fe8a570 into main May 18, 2026
6 checks passed
@f-trycua
f-trycua deleted the feat/cua-driver-install-convergence branch May 18, 2026 12:49
f-trycua added a commit that referenced this pull request May 18, 2026
…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.
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