Skip to content

chore(cua-driver-rs)(install): make Rust the default backend - #1768

Merged
f-trycua merged 1 commit into
mainfrom
chore/cua-driver-rs-default-backend-rust
May 30, 2026
Merged

chore(cua-driver-rs)(install): make Rust the default backend#1768
f-trycua merged 1 commit into
mainfrom
chore/cua-driver-rs-default-backend-rust

Conversation

@f-trycua

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

Copy link
Copy Markdown
Collaborator

What

Flip the install.sh backend dispatcher default from the Swift macOS implementation to the cross-platform Rust implementation.

  • USE_RUST_BACKEND now defaults to 1, so a plain curl … | bash installs the Rust backend on every platform.
  • Swift becomes opt-in via --backend=swift (macOS only).
  • The existing non-macOS guard is retained: an explicit --backend=swift on a non-macOS host still transparently falls back to Rust.
  • Header / usage / inline comments updated to match; --backend=rust is now the explicit-default no-op.

Why

Switches the default install back to the Rust driver, which is the actively-developed, cross-platform implementation.

Notes

  • bash -n syntax check passes.
  • PowerShell installer (install.ps1) is unaffected — Windows is Rust-only and has no Swift default.
  • No docs change: no cua-driver docs page references the backend default or the --backend flags.

Separate PR

Filed on its own, separate from the agent-cursor registry fix (#1769), per request.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Installation script now defaults to the Rust backend instead of Swift. Users can explicitly select Swift on macOS, with automatic fallback to Rust on non-macOS systems.

Review Change Stack

Flip the install.sh dispatcher default from the Swift macOS implementation
to the cross-platform Rust implementation: USE_RUST_BACKEND now defaults to
1, so a plain `curl … | bash` installs the Rust backend on every platform.

Swift becomes opt-in via --backend=swift (macOS only). The existing
non-macOS guard is retained — an explicit --backend=swift on a non-macOS
host still transparently falls back to Rust. Header/usage/inline comments
updated to match; --backend=rust is now the explicit-default no-op.

No docs change: no cua-driver docs page references the backend default or
the --backend flags.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented May 30, 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 30, 2026 4:38am

Request Review

@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The installation script shifts its default backend from Swift to Rust, upgrades --backend=swift to an explicit macOS-only opt-in, and adds early OS detection to automatically fall back to Rust when Swift is selected on non-macOS hosts.

Changes

Backend selection and fallback logic

Layer / File(s) Summary
Default backend and Swift opt-in flag
libs/cua-driver/scripts/install.sh
Default backend is changed to Rust (USE_RUST_BACKEND=1) with clarified comments; --backend=swift flag now explicitly signals macOS-only Swift opt-in instead of overriding the default.
OS-aware Swift-to-Rust fallback
libs/cua-driver/scripts/install.sh
OS detection logic is inserted early: when Swift is explicitly selected (USE_RUST_BACKEND=0) on a non-Darwin host, the script forces USE_RUST_BACKEND=1 and prints a note; delegation comments updated to reflect when each install path is reachable.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • trycua/cua#1762: Directly modifies the same install script backend-selection logic (default flip and non-macOS Swift fallback).
  • trycua/cua#1538: Modifies libs/cua-driver/scripts/install.sh backend delegation to Rust via --experimental-rust flag; main PR extends this pattern with new default and fallback behavior.
  • trycua/cua#1707: Adjusts cua-driver install script backend-selection so Rust becomes default and Swift requires explicit selection with non-macOS handling.

Poem

🐰 A rabbit hops through backends bright,
Rust now takes the default flight,
Swift says "macOS only, please!"
With fallback logic for ease,
Installation just got right! 🚀

🚥 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 'chore(cua-driver-rs)(install): make Rust the default backend' directly and clearly summarizes the main change: switching the install.sh script to use Rust as the default backend instead of Swift.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/cua-driver-rs-default-backend-rust

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@libs/cua-driver/scripts/install.sh`:
- Around line 65-67: Update the outdated comments in the install.sh script to
reflect that USE_RUST_BACKEND=1 makes the Rust backend the default;
specifically, change the earlier block that currently states Swift is the
default (Lines 15-21) to say Rust is the default and Swift/macOS is opt-in via
--backend=swift, and also change the later block (Lines 57-59) which implies
Rust only runs after --backend=rust to instead explain that Rust is used by
default and that --backend=rust is redundant on non-macOS while --backend=swift
forces the Swift backend on macOS; reference the USE_RUST_BACKEND variable and
the CLI flags --backend=swift / --backend=rust when updating the wording.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 75598018-4c69-4b53-95fb-18b949ae2de4

📥 Commits

Reviewing files that changed from the base of the PR and between be8ecec and 04621cf.

📒 Files selected for processing (1)
  • libs/cua-driver/scripts/install.sh

Comment on lines +65 to +67
# Default backend is the cross-platform Rust implementation. The Swift macOS
# implementation is opt-in via --backend=swift, and only runs on macOS.
USE_RUST_BACKEND=1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update the remaining script comments to match the new default.

With USE_RUST_BACKEND=1 here, Lines 15-21 and Lines 57-59 are now stale: they still describe Swift as the default and say Rust delegation only happens after --backend=rust or on non-macOS. That leaves the file with conflicting instructions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@libs/cua-driver/scripts/install.sh` around lines 65 - 67, Update the outdated
comments in the install.sh script to reflect that USE_RUST_BACKEND=1 makes the
Rust backend the default; specifically, change the earlier block that currently
states Swift is the default (Lines 15-21) to say Rust is the default and
Swift/macOS is opt-in via --backend=swift, and also change the later block
(Lines 57-59) which implies Rust only runs after --backend=rust to instead
explain that Rust is used by default and that --backend=rust is redundant on
non-macOS while --backend=swift forces the Swift backend on macOS; reference the
USE_RUST_BACKEND variable and the CLI flags --backend=swift / --backend=rust
when updating the wording.

@f-trycua
f-trycua merged commit 9e42569 into main May 30, 2026
7 checks passed
@f-trycua
f-trycua deleted the chore/cua-driver-rs-default-backend-rust branch May 30, 2026 05:03
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