fix(build): use Homebrew clang for wasm32 C build on macOS#77
Merged
Conversation
When CC is set (e.g. ccache cc), the wasm32 C/C++ build can use Apple Clang, which does not support wasm32-unknown-unknown, so the datadog-js-zstd WASM build failed. Set CC_wasm32_unknown_unknown and CXX_wasm32_unknown_unknown to Homebrew's clang so crates like zstd-sys always use a wasm32-capable compiler. Add DEVELOPMENT.md with Rust/rustup, macOS LLVM, and yarn setup steps, and move the build/test notes from README into DEVELOPMENT.md.
Overall package sizeSelf size: 37.28 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------|🤖 This report was automatically generated by heaviest-objects-in-the-universe |
szegedi
approved these changes
Mar 3, 2026
Contributor
szegedi
left a comment
There was a problem hiding this comment.
LGTM, I have one small suggestion.
tlhunter
pushed a commit
that referenced
this pull request
Mar 19, 2026
When CC is set (e.g. ccache cc), the wasm32 C/C++ build can use Apple Clang, which does not support wasm32-unknown-unknown, so the datadog-js-zstd WASM build failed. Set CC_wasm32_unknown_unknown and CXX_wasm32_unknown_unknown to Homebrew's clang so crates like zstd-sys always use a wasm32-capable compiler. Add DEVELOPMENT.md with Rust/rustup, macOS LLVM, and yarn setup steps, and move the build/test notes from README into DEVELOPMENT.md.
tlhunter
pushed a commit
that referenced
this pull request
Mar 20, 2026
When CC is set (e.g. ccache cc), the wasm32 C/C++ build can use Apple Clang, which does not support wasm32-unknown-unknown, so the datadog-js-zstd WASM build failed. Set CC_wasm32_unknown_unknown and CXX_wasm32_unknown_unknown to Homebrew's clang so crates like zstd-sys always use a wasm32-capable compiler. Add DEVELOPMENT.md with Rust/rustup, macOS LLVM, and yarn setup steps, and move the build/test notes from README into DEVELOPMENT.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Fixes the full
yarn buildon macOS when a customCC(e.g.ccache cc) is set, and adds a single place for development setup and build instructions.Changes
WASM build on macOS — The
datadog-js-zstdWASM crate useszstd-sys, which compiles C code forwasm32-unknown-unknown. IfCCpoints at Apple Clang or a wrapper likeccache cc, that compiler doesn’t support the wasm32 triple and the build fails with "No available targets are compatible with triple 'wasm32-unknown-unknown'". Inscripts/build-wasm.js, we now setCC_wasm32_unknown_unknownandCXX_wasm32_unknown_unknownto Homebrew’s clang so the wasm32 C/C++ build always uses a supported compiler, without changing behavior on Linux or for people who already rely on PATH.Docs — Added
DEVELOPMENT.mdwith step-by-step setup (rustup, PATH,wasm32-unknown-unknown, macOSbrew install llvm,yarn install) and the build/test commands. Removed the duplicate build section fromREADME.mdand pointed toDEVELOPMENT.mdfor contributing/setup.