Skip to content

Conversation

@ssaakaash
Copy link
Contributor

Problem

The webrtc-sys build script was using Command::new("clang") to discover compiler library paths. On a system with Homebrew's llvm package installed, this command could resolve to /usr/local/bin/clang instead of the required Xcode toolchain compiler.

This caused the script to pass incorrect library search paths to the linker, resulting in errors like:

ld: warning: search path '/usr/local/lib/clang/22/lib/darwin' not found
ld: library 'clang_rt.osx' not found

Solution

The fix is to change Command::new("clang") to Command::new("cc") within the configure_darwin_sysroot function in build.rs.

On macOS, cc is the system's default compiler alias and is guaranteed to respect the toolchain set by xcode-select. This ensures that even if other versions of clang are in the PATH, the build script will always get the correct search paths from the active Xcode toolchain.

This makes the build process more robust and resilient to variations in the user's local environment.

@CLAassistant
Copy link

CLAassistant commented Aug 31, 2025

CLA assistant check
All committers have signed the CLA.

@davidzhao
Copy link
Member

it would appear this change would break the build script, could you take a look?

@ssaakaash
Copy link
Contributor Author

Don't know why the tests failed in the workflow, it doesn't break the current build script.

@ladvoc ladvoc self-requested a review October 3, 2025 09:37
Copy link
Contributor

@ladvoc ladvoc left a comment

Choose a reason for hiding this comment

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

Tests pass now, LGTM ✅

@ladvoc ladvoc merged commit 14787ce into livekit:main Oct 5, 2025
6 of 9 checks passed
@github-actions github-actions bot mentioned this pull request Oct 5, 2025
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.

4 participants