Skip to content

fix(cli): avoid duplicate objc dylib on macOS - #1027

Merged
zackees merged 1 commit into
mainfrom
fix/1024-macos-duplicate-dylib
Jul 13, 2026
Merged

fix(cli): avoid duplicate objc dylib on macOS#1027
zackees merged 1 commit into
mainfrom
fix/1024-macos-duplicate-dylib

Conversation

@zackees

@zackees zackees commented Jul 13, 2026

Copy link
Copy Markdown
Member

Closes #1024.

Summary

  • replace the CLI's ctrlc dependency with Tokio's cross-platform ctrl_c signal driver
  • remove the ctrlc -> dispatch2 -> objc2 dependency chain and its explicit Objective-C runtime link
  • preserve exit code 130 and the existing interruption warning

Validation

  • soldr cargo check -p fbuild-cli --offline
  • soldr cargo clippy -p fbuild-cli --all-targets --offline -- -D warnings
  • soldr cargo fmt --all -- --check
  • soldr cargo tree --target aarch64-apple-darwin -p fbuild-cli no longer contains ctrlc, dispatch2, or objc2

The local Windows host cannot perform the final Apple link because its cross-build environment lacks cc; the release macOS lanes provide the authoritative Mach-O validation.

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of Ctrl+C interruptions during command execution.
    • Displays an interruption warning and exits with the standard interrupt status code.

Replace ctrlc with Tokio's cross-platform signal handler so macOS release binaries do not pull objc2 through dispatch2.\n\nCloses #1024.
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The CLI replaces the ctrlc crate handler with a Tokio task awaiting tokio::signal::ctrl_c(). SIGINT still emits the "Interrupted" warning and exits with status 130. The unused dependency is removed from the crate manifest.

Changes

Ctrl+C handling

Layer / File(s) Summary
Async signal shutdown
crates/fbuild-cli/Cargo.toml, crates/fbuild-cli/src/cli/dispatch.rs
Removes the ctrlc dependency and changes CLI interruption handling to an asynchronous Tokio signal watcher that warns and exits with status 130 on SIGINT.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main fix: removing the macOS duplicate objc dylib linkage.
Linked Issues check ✅ Passed The changes replace ctrlc with Tokio signal handling and remove the objc2/Objective-C link chain, addressing issue #1024.
Out of Scope Changes check ✅ Passed The diff stays focused on the macOS dylib duplication fix and does not add unrelated changes.
✨ 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 fix/1024-macos-duplicate-dylib

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

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 `@crates/fbuild-cli/src/cli/dispatch.rs`:
- Around line 55-60: Update the Ctrl+C handler task around
tokio::signal::ctrl_c() to explicitly handle both Result outcomes: retain the
existing interruption warning and exit code 130 on success, and log the setup
error with output::warn or the established diagnostic mechanism before exiting
or propagating the failure when setup fails.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 677ecf9e-c07c-4bbc-bc02-c98ddb1d63fa

📥 Commits

Reviewing files that changed from the base of the PR and between d998a83 and 855642f.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • crates/fbuild-cli/Cargo.toml
  • crates/fbuild-cli/src/cli/dispatch.rs
💤 Files with no reviewable changes (1)
  • crates/fbuild-cli/Cargo.toml

Comment on lines +55 to +60
tokio::spawn(async {
if tokio::signal::ctrl_c().await.is_ok() {
output::warn("Interrupted");
std::process::exit(130);
}
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail
soldr cargo tree --offline -p fbuild-cli -e features | rg 'tokio|signal'

Repository: FastLED/fbuild

Length of output: 191


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

git ls-files 'crates/fbuild-cli/src/cli/dispatch.rs' 'crates/fbuild-cli/Cargo.toml'
echo '--- dispatch.rs ---'
sed -n '1,140p' crates/fbuild-cli/src/cli/dispatch.rs
echo '--- Cargo.toml ---'
sed -n '1,220p' crates/fbuild-cli/Cargo.toml

Repository: FastLED/fbuild

Length of output: 6495


Handle Ctrl+C setup errors instead of ignoring them.

tokio::signal::ctrl_c().await returns a Result; is_ok() drops the error path, so if the signal handler cannot be installed the CLI keeps running without Ctrl+C handling or diagnostics. Log the error and exit (or propagate it) instead.

🤖 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 `@crates/fbuild-cli/src/cli/dispatch.rs` around lines 55 - 60, Update the
Ctrl+C handler task around tokio::signal::ctrl_c() to explicitly handle both
Result outcomes: retain the existing interruption warning and exit code 130 on
success, and log the setup error with output::warn or the established diagnostic
mechanism before exiting or propagating the failure when setup fails.

@zackees

zackees commented Jul 13, 2026

Copy link
Copy Markdown
Member Author

CI is currently blocked before compilation: every hosted job fails in setup-soldr because zackees/setup-soldr requests the nonexistent zackees/soldr v0.8.9 release (HTTP 404). Local validation passed: soldr cargo check/clippy/format for fbuild-cli. Proceeding with admin merge due shared CI infrastructure failure.

@zackees
zackees merged commit c1ef689 into main Jul 13, 2026
6 of 93 checks passed
@zackees
zackees deleted the fix/1024-macos-duplicate-dylib branch July 13, 2026 10:15
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

fbuild is failing on MacOS 26.5.2 with a duplicate linked dylib

1 participant