glfwJS icon indicating copy to clipboard operation
glfwJS copied to clipboard

Cannot use on M1 Macs

Open eagerestwolf opened this issue 4 years ago • 3 comments
trafficstars

Minor issue, but since the library is hardcoded to use the prebuilt libraries, I feel that I should raise this issue. If a user on an M1 Mac downloads this package because there is no arm64 binary included, node-gyp nukes the build directory and starts from scratch. As a result of this, when the package tries to pull the prebuilt binary it fails because the prebuilt binary doesn't exist because node-gyp never creates the darwin folder (for whatever reason). This is the resulting directory structure on an M1 Mac.

Screen Shot 2021-03-07 at 9 47 23 PM

I'm not entirely sure how this could be handled...unless I were to send you my arm64 compiled node file and you could create say a darwin-arm64 folder...I'm not very good with native addons.

It should be noted, this was the result whether I installed the library directly from NPM, or from the master branch.

eagerestwolf avatar Mar 08 '21 02:03 eagerestwolf

@eagerestwolf yeah, it's true, could you make PR or send me your compiled folder? Also could you print it from your terminal node -e 'console.log(process.platform)' ?

Reon90 avatar Mar 15 '21 06:03 Reon90

Sorry, been busy with my day job. Anyhow, my process.platform still reports as Darwin. The issue is process.arch reports as arm64 not x86_64, so that's why node-gyp wants to build a package resulting in the incorrect directory structure. Currently, as far as I am aware node-gyp doesn't provide a way to specify an output directory (although I'm not an expert), but one of the sqlite libraries copies binaries after they've been built [link], maybe that would be of help here?

Screen Shot 2021-03-24 at 8 47 45 PM

eagerestwolf avatar Mar 25 '21 00:03 eagerestwolf

In the meantime, here is my build artifacts if they are of help.

Release.zip

eagerestwolf avatar Mar 25 '21 00:03 eagerestwolf