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

cpu-features: Apple Silicon not supported #761

Open
1 of 3 tasks
nodesocket opened this issue Nov 1, 2021 · 10 comments
Open
1 of 3 tasks

cpu-features: Apple Silicon not supported #761

nodesocket opened this issue Nov 1, 2021 · 10 comments

Comments

@nodesocket
Copy link

nodesocket commented Nov 1, 2021

I'm submitting a...

  • Bug report
  • Feature request
  • Question

Summary

When installing on Apple Silicon (arm64) with yarn I get the following error. Is this something that can safely be ignored, or do you actually need the cpu-features package?

[1/2] ⠂ cpu-features
warning Error running install script for optional dependency: "/Users/justin/Sites/foo/server/node_modules/cpu-features: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: /Users/justin/Sites/foo/server/node_modules/cpu-features
Output:
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 2.7.18 found at \"/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python\"
gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
gyp info spawn args [
gyp info spawn args   '/Users/justin/.nvm/versions/node/v14.17.6/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/justin/Sites/foo/server/node_modules/cpu-features/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/justin/.nvm/versions/node/v14.17.6/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/justin/Library/Caches/node-gyp/14.17.6/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/justin/Library/Caches/node-gyp/14.17.6',
gyp info spawn args   '-Dnode_gyp_dir=/Users/justin/.nvm/versions/node/v14.17.6/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/justin/Library/Caches/node-gyp/14.17.6/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/justin/Sites/foo/server/node_modules/cpu-features',
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' ]
  ACTION Configuring dependencies /Users/justin/Sites/foo/server/node_modules/cpu-features/deps/cpu_features/build/Makefile
-- The C compiler identification is AppleClang 13.0.0.13000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for getauxval
-- Looking for getauxval - not found
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/justin/Sites/foo/server/node_modules/cpu-features/deps/cpu_features/build
  TOUCH Release/obj.target/config_deps.stamp
  ACTION Building dependencies /Users/justin/Sites/foo/server/node_modules/cpu-features/deps/cpu_features/build/libcpu_features.a
[ 11%] Building C object CMakeFiles/utils.dir/src/filesystem.c.o
[ 22%] Building C object CMakeFiles/utils.dir/src/stack_line_reader.c.o
[ 33%] Building C object CMakeFiles/utils.dir/src/string_view.c.o
[ 33%] Built target utils
[ 44%] Building C object CMakeFiles/unix_based_hardware_detection.dir/src/hwcaps.c.o
[ 55%] Building C object CMakeFiles/unix_based_hardware_detection.dir/src/unix_features_aggregator.c.o
[ 55%] Built target unix_based_hardware_detection
[ 66%] Building C object CMakeFiles/cpu_features.dir/src/cpuinfo_arm.c.o
In file included from /Users/justin/Sites/foo/server/node_modules/cpu-features/deps/cpu_features/src/cpuinfo_arm.c:15:
/Users/justin/Sites/foo/server/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_arm.h:118:2: error: \"Including cpuinfo_arm.h from a non-arm target.\"
#error \"Including cpuinfo_arm.h from a non-arm target.\"
 ^
1 error generated.
make[3]: *** [CMakeFiles/cpu_features.dir/src/cpuinfo_arm.c.o] Error 1
make[2]: *** [CMakeFiles/cpu_features.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [/Users/justin/Sites/foo/server/node_modules/cpu-features/deps/cpu_features/build/libcpu_features.a] Error 2
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/justin/.nvm/versions/node/v14.17.6/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 21.1.0
gyp ERR! command \"/Users/justin/.nvm/versions/node/v14.17.6/bin/node\" \"/Users/justin/.nvm/versions/node/v14.17.6/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\"
gyp ERR! cwd /Users/justin/Sites/foo/server/node_modules/cpu-features
gyp ERR! node -v v14.17.6
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok"

Environment / Setup

MacBook-Pro ➜  server git:(worker) ✗ node --version
v14.17.6

MacBook-Pro ➜  server git:(worker) ✗ which node
/Users/justin/.nvm/versions/node/v14.17.6/bin/node

MacBook-Pro ➜  server git:(worker) ✗ file /Users/justin/.nvm/versions/node/v14.17.6/bin/node
/Users/justin/.nvm/versions/node/v14.17.6/bin/node: Mach-O 64-bit executable arm64

MacBook-Pro ➜  server git:(worker) ✗ yarn --version
1.22.15

MacBook-Pro ➜  server git:(worker) ✗ which yarn
/Users/justin/.yarn/bin/yarn

db-migrate version: 0.11.12
plugins with versions: "db-migrate-pg": "1.2.2"
@wzrdtales
Copy link
Member

npm ls cpu-features
[email protected] /home/tobi/serious_projects/db-migrate/test
└─┬ [email protected]
  └─┬ [email protected]
    └─┬ [email protected]
      └── [email protected]

It is a dependency of ssh2. So no ssh tunneling for you :/ . You're in bad luck with your apple hardware right now, I know it is a pain in the ass which is why in all projects we're working on we officially banned m1 hardware completely (after it cost us many many hours of trying). So this means I also don't have any such hardware available, and wont have, so you're on your own if you want to fix this issue. The SSH Tunnel feature is especially important in enterprise environments with tight security constraints, so you might or might not need it.

If you want this fixed, please go upstream to tunnel-ssh, ssh2 and https://github.com/mscdex/cpu-features and see if they either already fixed that issue (kindly report me if this is the case then we can give it a bump) or open tickets there respectively.

@ryanb
Copy link

ryanb commented Mar 4, 2022

I ran into the same gyp error on my Intel MacBook Pro. Perhaps the ssh tunneling features could be moved into a separate package so those that don't need it have a simpler set of dependencies?

@andy-isoc
Copy link

Same issue as above. Maybe ssh could be made an optional or peer dependency?

@LMS007
Copy link

LMS007 commented Mar 30, 2022

Also have the issue, +1 for optional peer dep.

@wzrdtales
Copy link
Member

I understand you feel pain, but you must realize that this is a massively used package and not a wish palace. We won't make this an optional peer dependency because this would be a breaking change. A breaking change only for a minority group is not acceptable.

I repeat what I wrote already earlier. Check with the upstream module to get it working with m1, and then we will happily bump the package. Unfortunately, it is what you buy in when you buy an m1, an incomplete ecosystem, this is something you have to deal with, not everyone else. So no +1 in this issue will ever help it get resolved, only your brainpower can help and would be very appreciated, by us, by the maintainer of the packages mentioned and the open source community.

@ryanb
Copy link

ryanb commented Mar 31, 2022

We won't make this an optional peer dependency because this would be a breaking change.

Another option is to extract a core npm package without the dependency which this package uses. That wouldn't be a breaking change. I can understand it's more work to maintain two packages so not ideal.

I repeat what I wrote already earlier. Check with the upstream module to get it working with m1, and then we will happily bump the package. Unfortunately, it is what you buy in when you buy an m1, an incomplete ecosystem, this is something you have to deal with, not everyone else. So no +1 in this issue will ever help it get resolved, only your brainpower can help and would be very appreciated, by us, by the maintainer of the packages mentioned and the open source community.

I'm on an Intel Mackbook Pro and ran into this error. It's not specific to M1.

Thanks for your time considering this issue.

@wzrdtales
Copy link
Member

well then you placed your answer in the wrong issue, this issue is about m1 only @ryanb . please file a new issue and try to point down the issue so that can be solved independently.

@Diluka
Copy link

Diluka commented Apr 28, 2022

As far as I see, macOS(intel), Windows, docker image node:14 neither support to install.

@wzrdtales
Copy link
Member

nah that is wrong. works on intel just fine, works on docker image node:14 just fine (never use alpine and slim images, they can't work when native addons are implied, if you need it slim in total put together a proper build pipeline). windows was never on the supported so not sure.

@db-migrate db-migrate locked as off-topic and limited conversation to collaborators Apr 28, 2022
@wzrdtales
Copy link
Member

i locked this issue, since every new comment is about non apple silicon problems. please open a separate ticket and properly 100% reproducible document the issue

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

No branches or pull requests

6 participants