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

Error: cpu-features Command failed when installing db-migrate #16

Closed
dschinkel opened this issue Aug 16, 2023 · 5 comments
Closed

Error: cpu-features Command failed when installing db-migrate #16

dschinkel opened this issue Aug 16, 2023 · 5 comments

Comments

@dschinkel
Copy link

dschinkel commented Aug 16, 2023

Wtf? I get this when I run yarn and it tries to install the node-db-migrate package now all of a sudden.

I'm on a M1 Mac
OSX: Ventura Version 13.4.1

package.json
"db-migrate": "^0.11.12",
"db-migrate-pg": "^1.2.2",

warning Error running install script for optional dependency: "/Users/daveschinkel/code/projects/we-do-tdd/node_modules/cpu-features: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /Users/daveschinkel/code/projects/we-do-tdd/node_modules/cpu-features
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@9.4.0
gyp info using node@20.5.1 | darwin | arm64
gyp info find Python using Python version 3.11.4 found at \"/usr/local/bin/python3\"
gyp info spawn /usr/local/bin/python3
gyp info spawn args [
gyp info spawn args   '/Users/daveschinkel/.config/yarn/global/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/daveschinkel/code/projects/we-do-tdd/node_modules/cpu-features/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/daveschinkel/.config/yarn/global/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/daveschinkel/Library/Caches/node-gyp/20.5.1/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/daveschinkel/Library/Caches/node-gyp/20.5.1',
gyp info spawn args   '-Dnode_gyp_dir=/Users/daveschinkel/.config/yarn/global/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/daveschinkel/Library/Caches/node-gyp/20.5.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/daveschinkel/code/projects/we-do-tdd/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/daveschinkel/code/projects/we-do-tdd/node_modules/cpu-features/deps/cpu_features/build/Makefile
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is AppleClang 14.0.3.14030022
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/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 (0.4s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/daveschinkel/code/projects/we-do-tdd/node_modules/cpu-features/deps/cpu_features/build
  TOUCH Release/obj.target/config_deps.stamp
  ACTION Building dependencies /Users/daveschinkel/code/projects/we-do-tdd/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/daveschinkel/code/projects/we-do-tdd/node_modules/cpu-features/deps/cpu_features/src/cpuinfo_arm.c:15:
/Users/daveschinkel/code/projects/we-do-tdd/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/daveschinkel/code/projects/we-do-tdd/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/daveschinkel/.config/yarn/global/node_modules/node-gyp/lib/build.js:203:23)
gyp ERR! stack     at ChildProcess.emit (node:events:514:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
gyp ERR! System Darwin 22.5.0
gyp ERR! command \"/Users/daveschinkel/.nvm/versions/node/v20.5.1/bin/node\" \"/opt/homebrew/bin/node-gyp\" \"rebuild\"
gyp ERR! cwd /Users/daveschinkel/code/projects/we-do-tdd/node_modules/cpu-features
gyp ERR! node -v v20.5.1
gyp ERR! node-gyp -v v9.4.0
gyp ERR! not ok"
info This module is OPTIONAL, you can safely ignore this error
@mscdex
Copy link
Owner

mscdex commented Aug 16, 2023

The important part is the last line:

This module is OPTIONAL, you can safely ignore this error

As far as M1 support goes, that's still an upstream cpu_features issue, so whenever they add support for that platform, this addon will have it.

@mscdex
Copy link
Owner

mscdex commented Aug 16, 2023

Alternatively, you can try out the patch here and let me know if it compiles successfully for you on your M1 (make sure you check out this repository directly as it seems the version you're currently using is still relying on cmake).

@dschinkel
Copy link
Author

dschinkel commented Aug 16, 2023

so whenever they add support

who is "they"? and support for what specifically?

https://github.com/google/cpu_features

I definitely don't want to just see this error and have that kind of output every time I run yarn and just ignore it. But this link above also seems like a bad nightmare. Hack. I'm not using cpu-features directly, an npm package I use is, so I'm not sure what you're saying here. What exactly are you asking me to do with that patch and how?

@mscdex
Copy link
Owner

mscdex commented Aug 16, 2023

who is "they"?

They = upstream = the maintainers of https://github.com/google/cpu_features

and support for what specifically?

Apple Silicon CPUs

I definitely don't want to just see this error and have that kind of output every time I run yarn and just ignore it

You're complaining to the wrong person. You should be contacting the yarn developers as they would generally be the ones involved with showing/hiding optional dependency installation output.

What exactly are you asking me to do with that patch and how?

I was thinking you might possibly be interested in resolving the non-fatal error, even if you're not using it directly, by helping to test a patch that could potentially fix the error. That would require fetching/cloning the repo, applying a patch, and building locally to see if the error then is gone. I do not have Apple Silicon-based hardware to test with.

However, one other user with an Apple M1 has now confirmed the patch to be working, so at this point it's less vital for someone to test the patch. For now the error will be resolved once I land the changes and whatever dependency that is using cpu-features picks up those changes.

@dschinkel
Copy link
Author

thank you!

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

No branches or pull requests

2 participants