Git Product home page Git Product logo

cpu-features's People

Contributors

doringeman avatar mscdex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cpu-features's Issues

Issue when deploying project

Hi,

I'm using the following SFTP client module https://github.com/theophilusx/ssh2-sftp-client which seems to have cpu-features as a dependency.
Everything works great locally but when deploying with Github Actions, I'm getting the following error:

ERROR in /github/workspace/node_modules/cpu-features/build/Release/cpufeatures.node 1:0
Module parse failed: Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
 @ /github/workspace/node_modules/cpu-features/lib/index.js 1:16-60
 @ /github/workspace/node_modules/ssh2/lib/protocol/constants.js
 @ /github/workspace/node_modules/ssh2/lib/client.js
 @ /github/workspace/node_modules/ssh2/lib/index.js
 @ /github/workspace/node_modules/ssh2-sftp-client/src/index.js
 @ /github/workspace/src/config/sftp.ts
 @ /github/workspace/src/handlers/main.ts

Any idea how I can fix this issue?
Thanks

Apple Silicon support -- #error \"Including cpuinfo_arm.h from a non-arm target.\"

Trying to install a module that uses cpu-features on Apple Silicon (arm64) and getting the following error. Here are details on my Node and Yarn versions.

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
[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"

No Support for Apple M1 Pro in 0.0.4

cpu-features.js

const features = require('cpu-features')();
console.log(features)

node cpu-features.js
{ arch: 'unknown', flags: {} }

sysctl -n machdep.cpu.brand_string
Apple M1 Pro

Module does not get bundled properly into electron app

While upgrading some build pipeline stuff for M1, I hit an issue where this module was causing our built app to fail Gatekeeper check due to a hanging LC_RPATH for the cpu-features/build/node_gyp_bins/python3 file. Even for x86 builds, while it doesn't have that issue with LC_RPATH, it does still potentially have paths that cause the module to not load properly ever, granted gatekeeper, nor the ssh2 module doesn't seem to care.

For reference, here is the partial outputs of running otool -l over the aforementioned file, just including the load commands that center around files/dylibs.

For x86:

Load command 13
          cmd LC_LOAD_DYLIB
      cmdsize 104
         name /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 1953.1.0
compatibility version 150.0.0
Load command 14
          cmd LC_LOAD_DYLIB
      cmdsize 72
         name /usr/local/opt/gettext/lib/libintl.8.dylib (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 12.0.0
compatibility version 12.0.0
Load command 15
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name /usr/lib/libSystem.B.dylib (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 1319.0.0
compatibility version 1.0.0

For arm64:

Load command 13
          cmd LC_LOAD_DYLIB
      cmdsize 104
         name /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 1953.255.0
compatibility version 150.0.0
Load command 14
          cmd LC_LOAD_DYLIB
      cmdsize 88
         name /Users/distiller/.pyenv/versions/3.11.0/lib/libpython3.11.dylib (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 3.11.0
compatibility version 3.11.0
Load command 15
          cmd LC_LOAD_DYLIB
      cmdsize 72
         name /opt/homebrew/opt/gettext/lib/libintl.8.dylib (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 12.0.0
compatibility version 12.0.0
Load command 16
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name /usr/lib/libSystem.B.dylib (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 1319.0.0
compatibility version 1.0.0
Load command 17
          cmd LC_RPATH
      cmdsize 56
         path /Users/distiller/.pyenv/versions/3.11.0/lib (offset 12)
Load command 18
          cmd LC_RPATH
      cmdsize 32
         path /opt/homebrew/lib (offset 12)
Load command 19
          cmd LC_RPATH
      cmdsize 56
         path /Users/distiller/.pyenv/versions/3.11.0/lib (offset 12)
Load command 20
          cmd LC_RPATH
      cmdsize 32
         path /opt/homebrew/lib (offset 12)
Load command 21
          cmd LC_RPATH
      cmdsize 32
         path /opt/homebrew/lib (offset 12)

As can see, the referenced LC_LOAD_DYLIB and LC_RPATH all seem to be build machine specific, and if the files don't exist on the host, then there's issues. Ideally, cpu-features could bundle all it needs as part of its build process, but that could also just be too much for multiple versions of python onto the host.

Currently, we are avoiding this problem by removing cpu-features in a postinstall hook given that it's optional, and just hoping that it won't provide some cipher or whatever that we might have needed in ssh2 library. I'm totally fine if this issue gets deleted and it only exists purely as documentation to someone else before they waste a day on trying to figure out why their arm64 build of an electron app is failing to run.

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

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 [email protected]
gyp info using [email protected] | 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

I am not able to cpu-features using npm command

I am not able to cpu-features using npm command

Received error :
throw new error unable to detect compiler type.
Please suggest solution

I was trying to execute the module at windows and Linus machine I got the same error.
Also I don't see it has good compatibility with windows machine.

I am unable to install cpu-features using the npm install command.

I am unable to install cpu-features using the npm install command.

Received error :

make: *** [Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_linux_or_android.o] Error 1
make: Leaving directory `/home/root/ik/node_modules/cpu-features/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:311:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 3.10.0-693.el7.x86_64
gyp ERR! command "/usr/local/nvm/versions/node/v12.16.1/bin/node" "/usr/local/nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/root/ik/node_modules/cpu-features
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok

When installing the ssh2-sftp-client or ssh2 modules, I encounter an error while installing cpu-features.

my env :
centos7.4
gcc 4.8.5
python 2.7.5 or python3.8 (The error occurs with both Python 2.7.5 and Python 3.8.)
node v12.16.1.

Please suggest solution.

Can't build on Windows

Windows 10 Enterprise 64 bits 21H1 build 19043.1237
node v14.17.6
npm 6.14.15
cmake 3.21.3
Visual Studio Enterprise 2019 Version 16.11.3

MSVCRT.lib(chandler4gs.obj) : error LNK2019: unresolved external symbol __except_handler4_common referenced in function
__except_handler4 [c:\xxxxxxx\git\sdk\v2\master\node_modules\yyyy\node_modules\cpu-features\build\cpufeatures.
vcxproj]
c:\xxxxxxx\git\sdk\v2\master\node_modules\yyyy\node_modules\cpu-features\build\Release\cpufeatures.node : fatal
error LNK1120: 1 unresolved externals [c:\xxxxxxx\git\sdk\v2\master\node_modules\irpa_core\node_modules\cpu-feature
s\build\cpufeatures.vcxproj]

undefined symbol: node_module_register

Hi there!

I've been using dockerode in my project for a month without any issues, but yesterday an error occurred for no apparent reason. The error message is as follows:

bun: symbol lookup error: /home/mrbye/Documents/GitHub/flow-server/node_modules/cpu-features/build/Release/cpufeatures.node: undefined symbol: node_module_register

Here are the specifications for my environment:

  • Ubuntu 22
  • Node.js 20
  • Bun 1.0.21
  • Gcc 11.4.0

When I run npm ls, I get the following output:

[email protected] /home/mrbye/Documents/GitHub/flow-server
└─┬ [email protected]
  └─┬ [email protected]
    └─┬ [email protected]
      └── [email protected]

I'm using bun in my project, but I also tried building the package using node. Also tried to build project into docker, but the same error. Do you have any ideas on how to resolve this issue?

(I don't updated bun, and used it while month)

Thanks!

GitHub releases tab missing latest release v0.0.9

The GitHub releases tab https://github.com/mscdex/cpu-features/releases shows only release v0.0.2 and this release is shown as Latest.

This is not aligned to the latest release published to npm which is 0.0.9, not 0.0.2.

$ npm view cpu-features dist-tags
{ latest: '0.0.9' }

The intermediate releases '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8' are also missing from the GitHub releases tab:

$ npm view cpu-features versions
[
  '0.0.1', '0.0.2',
  '0.0.3', '0.0.4',
  '0.0.5', '0.0.6',
  '0.0.7', '0.0.8',
  '0.0.9'
]

See also https://www.npmjs.com/package/cpu-features?activeTab=versions

image

Suggestion

It would be very helpful to have the missing releases '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9' added to the GitHub releases tab and for '0.0.9' to be marked as Latest there.

error when building on arm64 MacBook

Note that there exists a fix for building on M1:
google/cpu_features#211

Also, this module is broken. The cause of the breakage (upstream or not) doesn't really matter -- unless you're saying "I never plan on fixing this," keeping the issue open helps the community understand what's going on.

Finally, I predict this will become more of a pressing issue now that Apple has stopped selling x64 MacBook Pros entirely, AND this module is a dependency of the electron installer builders.

Error from checkbuilder.js deps

I got this error when install cpu-feature in Window 11 and nodejs 16.8.0

D:\Nobi\Ecomsea\node_modules\buildcheck\lib\index.js:133
throw new Error('Unable to detect compiler type');
^

Error: Unable to detect compiler type

i dont know why

npm install fails

Due to you closing #3 without releasing a new version on npmjs.com, npm install cpu-features still fails on Windows

Noisy npm installation

  .../node_modules/cpu-features install: gyp info find Python using Python version 3.10.12 found at "/usr/bin/python3"
  .../node_modules/cpu-features install: gyp http GET https://nodejs.org/download/release/v18.17.1/node-v18.17.1-headers.tar.gz
  .../node_modules/cpu-features install: gyp http 200 https://nodejs.org/download/release/v18.17.1/node-v18.17.1-headers.tar.gz
  .../node_modules/cpu-features install: gyp http GET https://nodejs.org/download/release/v18.17.1/SHASUMS256.txt
  .../node_modules/cpu-features install: gyp http 200 https://nodejs.org/download/release/v18.17.1/SHASUMS256.txt
  .../node_modules/cpu-features install: gyp info spawn /usr/bin/python3
  .../node_modules/cpu-features install: gyp info spawn args [
  .../node_modules/cpu-features install: gyp info spawn args   '/home/runner/setup-pnpm/node_modules/.pnpm/[email protected]/node_modules/pnpm/dist/node_modules/node-gyp/gyp/gyp_main.py',
  .../node_modules/cpu-features install: gyp info spawn args   'binding.gyp',
  .../node_modules/cpu-features install: gyp info spawn args   '-f',
  .../node_modules/cpu-features install: gyp info spawn args   'make',
  .../node_modules/cpu-features install: gyp info spawn args   '-I',
  .../node_modules/cpu-features install: gyp info spawn args   '/home/runner/work/rip-technologies/rip-technologies/node_modules/.pnpm/[email protected]/node_modules/cpu-features/build/config.gypi',
  .../node_modules/cpu-features install: gyp info spawn args   '-I',
  .../node_modules/cpu-features install: gyp info spawn args   '/home/runner/setup-pnpm/node_modules/.pnpm/[email protected]/node_modules/pnpm/dist/node_modules/node-gyp/addon.gypi',
  .../node_modules/cpu-features install: gyp info spawn args   '-I',
  .../node_modules/cpu-features install: gyp info spawn args   '/home/runner/.cache/node-gyp/18.17.1/include/node/common.gypi',
  .../node_modules/cpu-features install: gyp info spawn args   '-Dlibrary=shared_library',
  .../node_modules/cpu-features install: gyp info spawn args   '-Dvisibility=default',
  .../node_modules/cpu-features install: gyp info spawn args   '-Dnode_root_dir=/home/runner/.cache/node-gyp/18.17.1',
  .../node_modules/cpu-features install: gyp info spawn args   '-Dnode_gyp_dir=/home/runner/setup-pnpm/node_modules/.pnpm/[email protected]/node_modules/pnpm/dist/node_modules/node-gyp',
  .../node_modules/cpu-features install: gyp info spawn args   '-Dnode_lib_file=/home/runner/.cache/node-gyp/18.17.1/<(target_arch)/node.lib',
  .../node_modules/cpu-features install: gyp info spawn args   '-Dmodule_root_dir=/home/runner/work/rip-technologies/rip-technologies/node_modules/.pnpm/[email protected]/node_modules/cpu-features',
  .../node_modules/cpu-features install: gyp info spawn args   '-Dnode_engine=v8',
  .../node_modules/cpu-features install: gyp info spawn args   '--depth=.',
  .../node_modules/cpu-features install: gyp info spawn args   '--no-parallel',
  .../node_modules/cpu-features install: gyp info spawn args   '--generator-output',
  .../node_modules/cpu-features install: gyp info spawn args   'build',
  .../node_modules/cpu-features install: gyp info spawn args   '-Goutput_dir=.'
  .../node_modules/cpu-features install: gyp info spawn args ]
  .../node_modules/cpu-features install: gyp info spawn make
  .../node_modules/cpu-features install: gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  .../node_modules/cpu-features install: make: Entering directory '/home/runner/work/rip-technologies/rip-technologies/node_modules/.pnpm/[email protected]/node_modules/cpu-features/build'
  .../node_modules/cpu-features install:   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_linux_or_android.o
  .../node_modules/cpu-features install:   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_arm_linux_or_android.o
  .../node_modules/cpu-features install:   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_mips_linux_or_android.o
  .../node_modules/cpu-features install:   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_ppc_linux.o
  .../node_modules/cpu-features install:   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_freebsd.o
  .../node_modules/cpu-features install:   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_linux_or_android.o
  .../node_modules/cpu-features install:   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_macos.o
  .../node_modules/cpu-features install:   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_windows.o
  .../node_modules/cpu-features install:   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/filesystem.o
  .../node_modules/cpu-features install:   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/stack_line_reader.o
  .../node_modules/cpu-features install:   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/string_view.o
  .../node_modules/cpu-features install: rm -f Release/obj.target/deps/cpu_features/cpu_features.a Release/obj.target/deps/cpu_features/cpu_features.a.ar-file-list; mkdir -p `dirname Release/obj.target/deps/cpu_features/cpu_features.a`
  .../node_modules/cpu-features install: ar crs Release/obj.target/deps/cpu_features/cpu_features.a @Release/obj.target/deps/cpu_features/cpu_features.a.ar-file-list
  .../node_modules/cpu-features install:   COPY Release/cpu_features.a
  .../node_modules/cpu-features install:   CXX(target) Release/obj.target/cpufeatures/src/binding.o
  .../node_modules/cpu-features install: In file included from ../src/binding.cc:1:
  .../node_modules/cpu-features install: /home/runner/.cache/node-gyp/18.17.1/include/node/node.h:1014:7: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
  .../node_modules/cpu-features install:  1014 |       (node::addon_register_func) (regfunc),                          \
  .../node_modules/cpu-features install:       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  .../node_modules/cpu-features install: /home/runner/.cache/node-gyp/18.17.1/include/node/node.h:1048:3: note: in expansion of macro ‘NODE_MODULE_X’
  .../node_modules/cpu-features install:  1048 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
  .../node_modules/cpu-features install:       |   ^~~~~~~~~~~~~
  .../node_modules/cpu-features install: ../src/binding.cc:152:1: note: in expansion of macro ‘NODE_MODULE’
  .../node_modules/cpu-features install:   152 | NODE_MODULE(cpufeatures, init)
  .../node_modules/cpu-features install:       | ^~~~~~~~~~~
  .../node_modules/cpu-features install:   SOLINK_MODULE(target) Release/obj.target/cpufeatures.node
  .../node_modules/cpu-features install:   COPY Release/cpufeatures.node
  .../node_modules/cpu-features install: make: Leaving directory '/home/runner/work/rip-technologies/rip-technologies/node_modules/.pnpm/[email protected]/node_modules/cpu-features/build'
  .../node_modules/cpu-features install: gyp info ok 
  1. Warnings in compilation should be fixed
  2. Shouldn't have 63 lines of output in an npm install

Version 0.0.3 installs on M1 Mac (ARM64) but fails at runtime

Hello,

On a M1 Mac (ARM64) previous version of cpu-features (0.0.2) installation was skipped when used as an optional transitive dependency (for instance ssh2 requires cpu-features in an optional way).

This version will apparently build and install on Mac but fail at runtime with a missing symbol:

node                                                                                      134 ↵ alexandre@MacBook-Pro-de-Alexandre
Welcome to Node.js v16.14.2.
Type ".help" for more information.
> const features = require('cpu-features')()
dyld[55550]: missing symbol called
[1]    55550 abort      node

Using Dyld debugging variables

<lots of dyld logs>
Welcome to Node.js v16.14.2.
Type ".help" for more information.
> const features = require('cpu-features')()
dyld[56358]: dlopen("/Users/alexandre/Dev/Alteia/astack-docker1/astack/node_modules/cpu-features/build/Release/cpufeatures.node", 0x00000001)
dyld[56358]: <C9995410-EAD7-38CF-86EF-5112F33D26E5> /Users/alexandre/Dev/Alteia/astack-docker1/astack/node_modules/cpu-features/build/Release/cpufeatures.node
dyld[56358]:       dlopen(cpufeatures.node) => 0x20e4e5800
dyld[56358]: missing symbol called

Can not build with Node 22 on Apple Silicon

Can not build with Node 22 on Apple Silicon, while it was working fine with Node 20

gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
..
..
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_linux_or_android.o
  CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_arm_linux_or_android.o
  CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_mips_linux_or_android.o
  CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_ppc_linux.o
  CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_freebsd.o
  CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_linux_or_android.o
  CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_macos.o
  CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_windows.o
  CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/filesystem.o
  CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/stack_line_reader.o
  CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/string_view.o
  CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/hwcaps.o
  LIBTOOL-STATIC Release/cpu_features.a
  CXX(target) Release/obj.target/cpufeatures/src/binding.o
In file included from ../src/binding.cc:3:
../../nan/nan.h:2546:8: error: no matching member function for call to 'SetAccessor'
  tpl->SetAccessor(
  ~~~~~^~~~~~~~~~~
/Users/nazar/Library/Caches/node-gyp/22.0.0/include/node/v8-template.h:1055:8: note: candidate function not viable: no known conversion from 'v8::AccessControl' to 'PropertyAttribute' for 5th argument
  void SetAccessor(
       ^
/Users/nazar/Library/Caches/node-gyp/22.0.0/include/node/v8-template.h:1049:8: note: candidate function not viable: no known conversion from 'imp::NativeGetter' (aka 'void (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value> &)') to 'AccessorGetterCallback' (aka 'void (*)(Local<String>, const PropertyCallbackInfo<Value> &)') for 2nd argument
  void SetAccessor(
       ^
In file included from ../src/binding.cc:3:
../../nan/nan.h:2592:8: error: no matching member function for call to 'SetAccessor'
  tpl->SetAccessor(
  ~~~~~^~~~~~~~~~~
/Users/nazar/Library/Caches/node-gyp/22.0.0/include/node/v8-template.h:1055:8: note: candidate function not viable: no known conversion from 'v8::AccessControl' to 'PropertyAttribute' for 5th argument
  void SetAccessor(
       ^
/Users/nazar/Library/Caches/node-gyp/22.0.0/include/node/v8-template.h:1049:8: note: candidate function not viable: no known conversion from 'imp::NativeGetter' (aka 'void (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value> &)') to 'AccessorGetterCallback' (aka 'void (*)(Local<String>, const PropertyCallbackInfo<Value> &)') for 2nd argument
  void SetAccessor(
       ^
In file included from ../src/binding.cc:1:
In file included from /Users/nazar/Library/Caches/node-gyp/22.0.0/include/node/node.h:73:
In file included from /Users/nazar/Library/Caches/node-gyp/22.0.0/include/node/v8.h:24:
In file included from /Users/nazar/Library/Caches/node-gyp/22.0.0/include/node/v8-array-buffer.h:12:
/Users/nazar/Library/Caches/node-gyp/22.0.0/include/node/v8-local-handle.h:269:5: error: static assertion failed due to requirement 'std::is_base_of<v8::Value, v8::Data>::value': type check
    static_assert(std::is_base_of<T, S>::value, \"type check\");
    ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../nan/nan_callbacks_12_inl.h:175:20: note: in instantiation of function template specialization 'v8::Local<v8::Value>::Local<v8::Data>' requested here
      cbinfo(info, obj->GetInternalField(kDataIndex));
                   ^
3 errors generated.
make: *** [Release/obj.target/cpufeatures/src/binding.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.<anonymous> (/Users/nazar/Hub/project/node_modules/node-gyp/lib/build.js:209:23)
gyp ERR! System Darwin 23.4.0
gyp ERR! command \"/Users/nazar/.asdf/installs/nodejs/22.0.0/bin/node\" \"/Users/nazar/Hub/project/node_modules/.bin/node-gyp\" \"rebuild\"
gyp ERR! cwd /Users/nazar/Hub/project/node_modules/cpu-features

Yarn install error

Recently started receiving errors from yarn while installing. It seems to come from ssh2 -> cpu-features. The error seems to be triggered by node-gyp.

The only way it seems to get around it is to yarn install --ignore-optional, which isn't ideal.

warning Error running install script for optional dependency: "/Users/jasonseminara/projects/dev/portal/node_modules/cpu-features: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /Users/jasonseminara/projects/dev/portal/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 | x64
gyp info find Python using Python version 2.7.16 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/jasonseminara/projects/dev/portal/node_modules/@npmcli/run-script/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/jasonseminara/projects/dev/portal/node_modules/cpu-features/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/jasonseminara/projects/dev/portal/node_modules/@npmcli/run-script/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/jasonseminara/Library/Caches/node-gyp/12.22.3/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/jasonseminara/Library/Caches/node-gyp/12.22.3',
gyp info spawn args   '-Dnode_gyp_dir=/Users/jasonseminara/projects/dev/portal/node_modules/@npmcli/run-script/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/jasonseminara/Library/Caches/node-gyp/12.22.3/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/jasonseminara/projects/dev/portal/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/jasonseminara/projects/dev/portal/node_modules/cpu-features/deps/cpu_features/build/Makefile
/bin/sh: cmake: command not found
make: *** [/Users/jasonseminara/projects/dev/portal/node_modules/cpu-features/deps/cpu_features/build/Makefile] Error 127
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/jasonseminara/projects/dev/portal/node_modules/@npmcli/run-script/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 20.5.0
gyp ERR! command \"/usr/local/Cellar/nvm/0.38.0/versions/node/v12.22.3/bin/node\" \"/Users/jasonseminara/projects/dev/portal/node_modules/.bin/node-gyp\" \"rebuild\"
gyp ERR! cwd /Users/jasonseminara/projects/dev/portal/node_modules/cpu-features

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.