Skip to content

Preserve WebRTC linkage in macOS releases - #46

Merged
jserv merged 2 commits into
sysprog21:mainfrom
abnormal749:fix/macos-webrtc-release-linkage
Sep 16, 2026
Merged

jserv merged 2 commits into
sysprog21:mainfrom
abnormal749:fix/macos-webrtc-release-linkage

Conversation

@abnormal749

@abnormal749 abnormal749 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix the macOS arm64 release crashing during WebRTC initialization when starting an interview:

+[NSString stringForAbslStringView:]: unrecognized selector

The release workflow sets RUSTFLAGS to an empty string on macOS. This overrides the Apple-specific flags in .cargo/config.toml, dropping -ObjC and allowing the linker to omit WebRTC's Objective-C categories.

Explicitly set RUSTFLAGS to -Clink-arg=-ObjC for aarch64-apple-darwin in the release job. The existing Windows and Linux flag values remain unchanged.

Fixes #45. The same crash signature is reported in LiveKit #795.

Validation

  • Reproduced the crash with the published macOS binary.
  • Built the fixed macOS release successfully:
    RUSTFLAGS=-Clink-arg=-ObjC cargo build --release --locked --target aarch64-apple-darwin
  • Passed the same native initialization check with the rebuilt binary: WebRTC reached a local mock LiveKit endpoint and handled its HTTP 401 response without aborting.
  • Confirmed with otool that the rebuilt binary includes the stringForAbslStringView: category method.
  • Passed actionlint and verified the workflow expression's flag values for all three release targets.

Windows and Linux binaries were not built locally.


Summary by cubic

Fixes macOS arm64 release crashes during WebRTC initialization with +[NSString stringForAbslStringView:]: unrecognized selector. The release job previously cleared RUSTFLAGS, overriding .cargo/config.toml and letting the linker drop WebRTC's Objective-C categories. It now sets -Clink-arg=-ObjC for Apple targets, and the workflow rejects the binary before packaging if the stringForAbslStringView: category is missing. Windows and Linux flag values are unchanged.

Written for commit a2e5c7a. Summary will update on new commits.

Review in cubic

The release job's empty RUSTFLAGS hides the Apple target settings,
dropping Objective-C categories that WebRTC resolves at runtime. Keep
-ObjC for macOS while preserving the Linux and Windows flags.
cubic-dev-ai[bot]

This comment was marked as resolved.

Comment thread .github/workflows/check.yml Outdated
Comment on lines +561 to +562
# Override the workflow's Linux-only mold flag. Even an empty RUSTFLAGS
# overrides .cargo/config.toml, so macOS must repeat -ObjC here or the

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

      # Override the workflow-wide Linux-only mold flag with the
      # platform-specific flags required by each release target.
      # Even an empty RUSTFLAGS...

Nit: This might make the comment more completely describe what it actually does.

# Override the workflow's Linux-only mold flag. Even an empty RUSTFLAGS
# overrides .cargo/config.toml, so macOS must repeat -ObjC here or the
# linker omits WebRTC's NSString categories and the first room aborts.
RUSTFLAGS: >-

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.

Nothing in this workflow proves the flag reached the linker. A build without -ObjC still links cleanly, so the next edit to this expression republishes a macOS binary that aborts at the first room, and the build job is skipped on pull requests (it ran as skipping here), so the regression surfaces in a user's download rather than in CI. Worth a follow-up next to the Linux floor checks that already guard that leg: a macOS-only step before packaging that greps otool -oV on the built binary for stringForAbslStringView:.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing this out. I added the check to the macOS build before packaging and tested it against both binaries.
The old binary still contains the selector reference, so a plain grep would pass it too. The check matches the method entry in otool output, which catches the old crashing release and lets the fixed one through.

Comment thread .github/workflows/check.yml Outdated
Comment thread .github/workflows/check.yml Outdated
A successful release build can still omit WebRTC's Objective-C
categories. Keep the Apple target coverage aligned with Cargo and reject
that binary before packaging; selector references are insufficient
because they survive even when the category is missing.

@ColtenOuO ColtenOuO left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. Let's wait for CI to be approved and turn green.

@jserv
jserv merged commit 3ea58c3 into sysprog21:main Sep 16, 2026
6 checks passed
@jserv

jserv commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Thank @abnormal749 for contributing!

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.

LiveKit runner crashes on macOS 26.2 arm64

3 participants