Skip to content

Conversation

@lcovar
Copy link
Contributor

@lcovar lcovar commented Dec 18, 2025

Apple's Clang doesn't support the wasm32-unknown-unknown target, causing secp256k1-sys compilation to fail on Mac. This change automatically detects Mac and uses Homebrew's LLVM which has proper WASM support.

Changes:

  • Makefile: Auto-detect Mac and set CC/AR to use Homebrew LLVM
  • Makefile: Remove trailing slashes from target declarations for
    compatibility with both old (Mac 3.81) and new (Linux 4.x) Make
  • package.json: Fix Make target names to match Makefile
  • scripts/wasm-pack-test.sh: Wrapper script to set correct compiler
    for wasm-pack tests on Mac
  • README.md: Update build instructions for Mac

This allows Mac users to build with 'npm run build' without Docker, while maintaining full compatibility with Linux CI builds.

Tested on Mac (Apple Silicon)
Requires: brew install llvm"

Ticket: BTC-0

@lcovar lcovar requested a review from a team as a code owner December 18, 2025 00:39
@lcovar lcovar force-pushed the BTC-0-mac.build branch 2 times, most recently from dd4f08b to dad5bf6 Compare December 18, 2025 00:50
Apple's Clang doesn't support the wasm32-unknown-unknown target,
causing secp256k1-sys compilation to fail on Mac. This change
automatically detects Mac and uses Homebrew's LLVM which has
proper WASM support.

Changes:
- Makefile: Auto-detect Mac and set CC/AR to use Homebrew LLVM
- Makefile: Remove trailing slashes from target declarations for
  compatibility with both old (Mac 3.81) and new (Linux 4.x) Make
- package.json: Fix Make target names to match Makefile
- scripts/wasm-pack-test.sh: Wrapper script to set correct compiler
  for wasm-pack tests on Mac
- README.md: Update build instructions for Mac

This allows Mac users to build with 'npm run build' without Docker,
while maintaining full compatibility with Linux CI builds.

Tested on Mac (Apple Silicon)
Requires: brew install llvm"

Ticket: BTC-0
@OttoAllmendinger OttoAllmendinger merged commit 94cf7f5 into master Dec 18, 2025
1 check passed
@OttoAllmendinger OttoAllmendinger deleted the BTC-0-mac.build branch December 18, 2025 09:22
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.

3 participants