Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: provide prebuilt binaries for ARM64 macOS #41

Closed
Munter opened this issue Sep 13, 2022 · 6 comments
Closed

Enhancement: provide prebuilt binaries for ARM64 macOS #41

Munter opened this issue Sep 13, 2022 · 6 comments

Comments

@Munter
Copy link

Munter commented Sep 13, 2022

After being forced to install the latest XCode on my mac, farmhash installation started failing in the gyp build step:

error /Users/munter/bucket/bucket-ingest/node_modules/farmhash: Command failed.
Exit code: 1
Command: prebuild-install || node-gyp rebuild
Arguments:
Directory: /Users/munter/bucket/bucket-ingest/node_modules/farmhash
Output:
prebuild-install WARN install No prebuilt binaries found (target=3 runtime=napi arch=arm64 libc= platform=darwin)
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info find Python using Python version 3.9.6 found at "/Applications/Xcode.app/Contents/Developer/usr/bin/python3"
(node:65594) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
(Use `node --trace-deprecation ...` to show where the warning was created)
gyp info spawn /Applications/Xcode.app/Contents/Developer/usr/bin/python3
gyp info spawn args [
gyp info spawn args   '/Users/munter/.nvm/versions/node/v16.6.2/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/munter/bucket/bucket-ingest/node_modules/farmhash/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/munter/.nvm/versions/node/v16.6.2/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/munter/Library/Caches/node-gyp/16.6.2/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/munter/Library/Caches/node-gyp/16.6.2',
gyp info spawn args   '-Dnode_gyp_dir=/Users/munter/.nvm/versions/node/v16.6.2/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/munter/Library/Caches/node-gyp/16.6.2/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/munter/bucket/bucket-ingest/node_modules/farmhash',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
  LIBTOOL-STATIC Release/nothing.a
env: python: No such file or directory
make: *** [Release/nothing.a] Error 127
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/munter/.nvm/versions/node/v16.6.2/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Darwin 21.6.0
gyp ERR! command "/Users/munter/.nvm/versions/node/v16.6.2/bin/node" "/Users/munter/.nvm/versions/node/v16.6.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/munter/bucket/bucket-ingest/node_modules/farmhash

The same error happens if I use npm instead of yarn.

Recreated with farmhash versions 3.2.1 and 3.2.2.

@Munter
Copy link
Author

Munter commented Sep 13, 2022

Uprading to a newer node 16 (16.17.0) with a more recent version of node-gyp (9.1.0) seems to solve to problem.

We have a version locked 16.6.2 in our repositories though. Any insights about why this suddenly started breaking?

@lovell
Copy link
Owner

lovell commented Sep 13, 2022

gyp info find Python using Python version 3.9.6 found at "/Applications/Xcode.app/Contents/Developer/usr/bin/python3"

env: python: No such file or directory

My best guess would be to do with Python version 2 vs 3 detection in node-gyp. If there are multiple versions installed you might need to tell npm which one to use, see https://github.com/nodejs/node-gyp#configuring-python-dependency

A better solution would be to provide prebuilt binaries for ARM64 macOS. I have an M1 set up for GitHub Actions that we should be able to use for this, leave it with me.

@lovell lovell changed the title Gyp build error Enhancement: provide prebuilt binaries for ARM64 macOS Apr 17, 2024
@lovell
Copy link
Owner

lovell commented Apr 17, 2024

Prebuilt binaries for darwin-arm64 available from v3.3.1.

@busybox11
Copy link

Hi!
I'm having a similar issue on regular Linux ARM servers. Claims Python is not installed.
This is being used in a Docker image build process, installing Python is doable obviously but it would be great if prebuilt binaries were also available for those systems, as they are getting more and more popular and also more affordable and capable for servers!

Thanks for everything anyway. The Apple Silicon binaries are really helpful, appreciate it.

@lovell
Copy link
Owner

lovell commented Apr 25, 2024

@busybox11 #48

@busybox11
Copy link

Awesome! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants