Skip to content

Document Rust requirement for macOS development setup#3227

Merged
silamon merged 1 commit into
home-assistant:masterfrom
tzahari:macos-rust-setup-note
Jul 10, 2026
Merged

Document Rust requirement for macOS development setup#3227
silamon merged 1 commit into
home-assistant:masterfrom
tzahari:macos-rust-setup-note

Conversation

@tzahari

@tzahari tzahari commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Proposed change

The macOS setup instructions list the Homebrew packages needed for local development, but script/setup can fail if no Rust toolchain is installed: several Python dependencies of Home Assistant (such as cryptography, orjson, and pydantic-core) contain Rust extensions, and pip needs rustc/cargo to build them from source whenever no prebuilt wheel is available for the current Python version and platform.

This adds a short note to the "Developing on macOS" section explaining when Rust is needed and how to install it via Homebrew.

Type of change

  • Document existing features within Home Assistant
  • Document new or changing features which there is an existing pull request elsewhere
  • Spelling or grammatical corrections, or rewording for improved clarity
  • Changes to the backend of this documentation
  • Remove stale or deprecated documentation

Checklist

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Updated macOS development setup instructions to include an extra Rust installation step.
    • Clarified what to do if setup fails because rustc or cargo are missing.
    • Added guidance for installing Rust with Homebrew when required by native dependency builds.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR adds documentation to development_environment.mdx explaining that some Home Assistant Python dependencies compile native Rust extensions from source, and instructs macOS users to install Rust via Homebrew if script/setup fails due to missing rustc/cargo.

Changes

Documentation update

Layer / File(s) Summary
Add Rust setup instructions
docs/development_environment.mdx
Adds macOS instructions explaining when Rust is required to build Python dependencies from source and how to install Rust via Homebrew if script/setup fails.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Estimated code review effort

1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: documenting the Rust requirement for macOS development setup.
Description check ✅ Passed The description covers the proposed change, type of change, and checklist, with only the optional additional information section omitted.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@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.

🧹 Nitpick comments (1)
docs/development_environment.mdx (1)

169-169: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Front the goal before the conditional clause.

The instructional sentence places the action ("install Rust as well") after the condition. Per path instructions, front the goal.

✏️ Suggested rewording
-Some Python dependencies of Home Assistant, such as `cryptography` and `orjson`, contain extensions written in Rust. If no prebuilt wheel is available for your Python version and platform, pip builds them from source, which requires a [Rust toolchain](https://www.rust-lang.org/tools/install). If the `script/setup` script below fails because `rustc` or `cargo` is missing, install Rust as well:
+Some Python dependencies of Home Assistant, such as `cryptography` and `orjson`, contain extensions written in Rust. If no prebuilt wheel is available for your Python version and platform, pip builds them from source, which requires a [Rust toolchain](https://www.rust-lang.org/tools/install). Install Rust as well if the `script/setup` script below fails because `rustc` or `cargo` is missing:

As per path instructions, "In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence."

🤖 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 `@docs/development_environment.mdx` at line 169, Reword the instructional
sentence in the documentation so the goal comes first: place “install Rust as
well” before the conditional clause about `script/setup` failing due to missing
`rustc` or `cargo`. Keep the rest of the sentence structure intact and preserve
the references to `script/setup`, `rustc`, and `cargo` so the guidance reads as
a fronted goal followed by the condition.

Source: Path instructions

🤖 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.

Nitpick comments:
In `@docs/development_environment.mdx`:
- Line 169: Reword the instructional sentence in the documentation so the goal
comes first: place “install Rust as well” before the conditional clause about
`script/setup` failing due to missing `rustc` or `cargo`. Keep the rest of the
sentence structure intact and preserve the references to `script/setup`,
`rustc`, and `cargo` so the guidance reads as a fronted goal followed by the
condition.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ab629aa9-4ca1-42cb-bb0c-12345e8c2ec2

📥 Commits

Reviewing files that changed from the base of the PR and between 151f4d9 and 4f48d12.

📒 Files selected for processing (1)
  • docs/development_environment.mdx

@silamon
silamon merged commit 977ba3b into home-assistant:master Jul 10, 2026
5 checks passed
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