Preserve WebRTC linkage in macOS releases - #46
Conversation
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.
| # Override the workflow's Linux-only mold flag. Even an empty RUSTFLAGS | ||
| # overrides .cargo/config.toml, so macOS must repeat -ObjC here or the |
There was a problem hiding this comment.
# 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: >- |
There was a problem hiding this comment.
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:.
There was a problem hiding this comment.
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.
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.
|
Thank @abnormal749 for contributing! |
Summary
Fix the macOS arm64 release crashing during WebRTC initialization when starting an interview:
The release workflow sets
RUSTFLAGSto an empty string on macOS. This overrides the Apple-specific flags in.cargo/config.toml, dropping-ObjCand allowing the linker to omit WebRTC's Objective-C categories.Explicitly set
RUSTFLAGSto-Clink-arg=-ObjCforaarch64-apple-darwinin the release job. The existing Windows and Linux flag values remain unchanged.Fixes #45. The same crash signature is reported in LiveKit #795.
Validation
otoolthat the rebuilt binary includes thestringForAbslStringView:category method.actionlintand 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 clearedRUSTFLAGS, overriding.cargo/config.tomland letting the linker drop WebRTC's Objective-C categories. It now sets-Clink-arg=-ObjCfor Apple targets, and the workflow rejects the binary before packaging if thestringForAbslStringView:category is missing. Windows and Linux flag values are unchanged.Written for commit a2e5c7a. Summary will update on new commits.