Brooooooklyn / canvas

High performance skia binding to Node.js. Zero system dependencies and pure npm packages without any postinstall scripts nor node-gyp.
https://vercel.skia.rs
MIT License
1.78k stars 76 forks source link

fix: build macos with xcode llvm #905

Closed Julusian closed 1 month ago

Julusian commented 2 months ago

Closes #896

Read my comments in the issue for more step by step details on what was happening. The TLDR is that this library current uses the symbol __ZTTNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE which was introduced in macos 12, even though compiling was telling it to target 10.13. After quite some digging and debugging to figure out why, I have concluded that its the different config of brew llvm compared to system llvm, causing llvm to ignore the requested target.

This resolves that by simply using the system llvm instead.

I am not certain that the changes in build-skia.js are needed, but they match the setup done for aarch64-apple-darwin

I have verified this on an old mac I have which is running 10.13, after rerunning the skia compile step, and producing the new skia.darwin-x64.node from that it is now loadable on 10.13