bufferutil icon indicating copy to clipboard operation
bufferutil copied to clipboard

binding.gyp forces `arm64` on macOS

Open felixrieseberg opened this issue 1 year ago • 1 comments

In binding.gyp, we check whether or not the Clang version is greater than or equal to 12.0.0. This is always true on modern macOS systems. Specifically, anything with macOS 11 or greater would have a version above. macOS 10.15 was released in 2019 and is no longer supported.

The issue is that this line forces arm64 builds, meaning that environments cannot build x64 from source on a modern Mac.

Would you be open to a PR removing this line? This is arguable a bug on modern systems - and anyone still running 10.15 could simply use the existing versions of bufferutil.

https://github.com/websockets/bufferutil/blob/362f677da8445176d63b236534572dff35ab3c2a/binding.gyp#L19-L26

felixrieseberg avatar Oct 18 '24 16:10 felixrieseberg

I'm not sure I understand. On an intel mac it builds a universal binary that works both on x64 and arm64. On a modern mac it builds only an arm64 binary. Is the request to allow building a binary on a modern mac that also work on x64? If so we can always build a universal binary by adding -arch x86_64 . See also https://github.com/websockets/bufferutil/commit/3af337566915e9b306c671671939c88fb5ee0ee7.

lpinca avatar Oct 23 '24 06:10 lpinca

Untested because I only have an intel mac but I think the following command also works

node-gyp rebuild -arch x86_64

lpinca avatar Oct 28 '24 19:10 lpinca

I'm closing this due to inactivity.

lpinca avatar Nov 11 '24 09:11 lpinca

I'm not sure I understand. On an intel mac it builds a universal binary that works both on x64 and arm64. On a modern mac it builds only an arm64 binary. Is the request to allow building a binary on a modern mac that also work on x64? If so we can always build a universal binary by adding -arch x86_64 . See also 3af3375.

This is interesting. On my modern Mac (M3 ARM64), I have a use-case to have my project working within Windows. When my project attempts to install bufferutil, it fails with a complaint:

Error: No native build was found for platform=win32 arch=arm64 runtime=node abi=127 uv=1 armv=8 libc=glibc node=22.13.1
npm error     loaded from: C:\JIRA\ws\rplus-devtools-ci\node_modules\bufferutil

If win32|arm64 isn't supported, then I suppose that I would need to create a prebuild for this setup? Thanks!

m4rtelli avatar Feb 07 '25 17:02 m4rtelli