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

node-gyp error built on x86 macbook #185

Open
gogoout opened this issue Nov 10, 2021 · 1 comment
Open

node-gyp error built on x86 macbook #185

gogoout opened this issue Nov 10, 2021 · 1 comment
Labels
bug Something isn't working pull request welcome A pull request is welcome

Comments

@gogoout
Copy link

gogoout commented Nov 10, 2021

Error Log:

❯ node-gyp build --verbose
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   '/usr/local/bin/node',
gyp verb cli   '/usr/local/bin/node-gyp',
gyp verb cli   'build',
gyp verb cli   '--verbose'
gyp verb cli ]
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir /var/folders/87/l3prgdy94c7c24twvvzzt7cc0000gn/T/prebuildify/node/8.14.0
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
  cd ..; /Users/gogoout/WebstormProjects/github/rocksdb/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/var/folders/87/l3prgdy94c7c24twvvzzt7cc0000gn/T/prebuildify/node/8.14.0" "-Dnode_gyp_dir=/Users/gogoout/WebstormProjects/github/rocksdb/node_modules/node-gyp" "-Dnode_lib_file=/var/folders/87/l3prgdy94c7c24twvvzzt7cc0000gn/T/prebuildify/node/8.14.0/<(target_arch)/node.lib" "-Dmodule_root_dir=/Users/gogoout/WebstormProjects/github/rocksdb" "-Dnode_engine=v8" "--depth=." "-Goutput_dir=." "--generator-output=build" -I/Users/gogoout/WebstormProjects/github/rocksdb/build/config.gypi -I/Users/gogoout/WebstormProjects/github/rocksdb/node_modules/node-gyp/addon.gypi -I/var/folders/87/l3prgdy94c7c24twvvzzt7cc0000gn/T/prebuildify/node/8.14.0/include/node/common.gypi "--toplevel-dir=." binding.gyp
  clang++ -o Release/obj.target/rocksdb/deps/rocksdb/rocksdb/cache/cache.o ../deps/rocksdb/rocksdb/cache/cache.cc '-DNODE_GYP_MODULE_NAME=rocksdb' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DSNAPPY=1' '-DROCKSDB_PLATFORM_POSIX=1' '-DOS_MACOSX=1' '-DROCKSDB_LIB_IO_POSIX=1' '-DROCKSDB_BACKTRACE=1' -I/var/folders/87/l3prgdy94c7c24twvvzzt7cc0000gn/T/prebuildify/node/8.14.0/include/node -I/var/folders/87/l3prgdy94c7c24twvvzzt7cc0000gn/T/prebuildify/node/8.14.0/src -I/var/folders/87/l3prgdy94c7c24twvvzzt7cc0000gn/T/prebuildify/node/8.14.0/deps/openssl/config -I/var/folders/87/l3prgdy94c7c24twvvzzt7cc0000gn/T/prebuildify/node/8.14.0/deps/openssl/openssl/include -I/var/folders/87/l3prgdy94c7c24twvvzzt7cc0000gn/T/prebuildify/node/8.14.0/deps/uv/include -I/var/folders/87/l3prgdy94c7c24twvvzzt7cc0000gn/T/prebuildify/node/8.14.0/deps/zlib -I/var/folders/87/l3prgdy94c7c24twvvzzt7cc0000gn/T/prebuildify/node/8.14.0/deps/v8/include -I../deps/rocksdb/rocksdb -I../deps/rocksdb/rocksdb/include -I../deps/snappy/mac -I../deps/snappy/snappy-1.1.7  -Os -gdwarf-2 -mmacosx-version-min=10.8 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -Wno-sign-compare -Wno-unused-variable -Wno-unused-function -std=gnu++0x -stdlib=libc++ -fno-threadsafe-statics -mmacosx-version-min=10.8 -std=c++11 -stdlib=libc++ -fno-omit-frame-pointer -momit-leaf-frame-pointer -arch x86_64 -arch arm64 -MMD -MF ./Release/.deps/Release/obj.target/rocksdb/deps/rocksdb/rocksdb/cache/cache.o.d.raw   -c
In file included from ../deps/rocksdb/rocksdb/cache/cache.cc:10:
In file included from ../deps/rocksdb/rocksdb/include/rocksdb/cache.h:25:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/stdint.h:123:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/stdint.h:52:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdint.h:52:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:32:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
#error Unsupported architecture
 ^
In file included from ../deps/rocksdb/rocksdb/cache/cache.cc:10:
In file included from ../deps/rocksdb/rocksdb/include/rocksdb/cache.h:25:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/stdint.h:123:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/stdint.h:52:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdint.h:52:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:33:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
#error architecture not supported
 ^
In file included from ../deps/rocksdb/rocksdb/cache/cache.cc:10:
In file included from ../deps/rocksdb/rocksdb/include/rocksdb/cache.h:25:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/stdint.h:123:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/stdint.h:52:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdint.h:52:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t'
typedef __int64_t       __darwin_blkcnt_t;      /* total blocks */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:56:9: error: unknown type name '__int32_t'
typedef __int32_t       __darwin_blksize_t;     /* preferred block size */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:57:9: error: unknown type name '__int32_t'
typedef __int32_t       __darwin_dev_t;         /* dev_t */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:60:9: error: unknown type name '__uint32_t'
typedef __uint32_t      __darwin_gid_t;         /* [???] process and group IDs */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:61:9: error: unknown type name '__uint32_t'
typedef __uint32_t      __darwin_id_t;          /* [XSI] pid_t, uid_t, or gid_t*/
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:62:9: error: unknown type name '__uint64_t'; did you mean 'uint64_t'?
typedef __uint64_t      __darwin_ino64_t;       /* [???] Used for 64 bit inodes */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_types/_uint64_t.h:31:28: note: 'uint64_t' declared here
typedef unsigned long long uint64_t;
                           ^
In file included from ../deps/rocksdb/rocksdb/cache/cache.cc:10:
In file included from ../deps/rocksdb/rocksdb/include/rocksdb/cache.h:25:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/stdint.h:123:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/stdint.h:52:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdint.h:52:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t'
typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:70:9: error: unknown type name '__uint16_t'
typedef __uint16_t      __darwin_mode_t;        /* [???] Some file attributes */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:71:9: error: unknown type name '__int64_t'
typedef __int64_t       __darwin_off_t;         /* [???] Used for file sizes */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:72:9: error: unknown type name '__int32_t'
typedef __int32_t       __darwin_pid_t;         /* [???] process and group IDs */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:73:9: error: unknown type name '__uint32_t'
typedef __uint32_t      __darwin_sigset_t;      /* [???] signal set */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:74:9: error: unknown type name '__int32_t'
typedef __int32_t       __darwin_suseconds_t;   /* [???] microseconds */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:75:9: error: unknown type name '__uint32_t'
typedef __uint32_t      __darwin_uid_t;         /* [???] user IDs */
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'
typedef __uint32_t      __darwin_useconds_t;    /* [???] microseconds */
        ^
In file included from ../deps/rocksdb/rocksdb/cache/cache.cc:10:
In file included from ../deps/rocksdb/rocksdb/include/rocksdb/cache.h:25:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/stdint.h:123:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/stdint.h:52:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdint.h:53:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types/_intptr_t.h:30:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/types.h:37:2: error: architecture not supported
#error architecture not supported
 ^
In file included from ../deps/rocksdb/rocksdb/cache/cache.cc:10:
In file included from ../deps/rocksdb/rocksdb/include/rocksdb/cache.h:25:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/stdint.h:123:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/stdint.h:52:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdint.h:53:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types/_intptr_t.h:32:9: error: unknown type name '__darwin_intptr_t'
typedef __darwin_intptr_t       intptr_t;
        ^
In file included from ../deps/rocksdb/rocksdb/cache/cache.cc:10:
In file included from ../deps/rocksdb/rocksdb/include/rocksdb/cache.h:26:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:653:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/typeinfo:60:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/exception:81:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cstdlib:85:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/stdlib.h:97:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdlib.h:64:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_types.h:43:9: error: unknown type name '__uint32_t'
typedef __uint32_t      __darwin_wctype_t;
        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

Seems manually remove '-arch arm64' in rocksdb.gyp snappy.gyp binding.gyp works for me. But I do aware the CI of Github Actions seems running fine. Not sure if this is just my machine.

@vweevers
Copy link
Member

I think we need to make the -arch arm64 flag conditional, by mac or xtools version. Skip it on mac < 11.

PR is welcome

@vweevers vweevers added bug Something isn't working help wanted Extra attention is needed labels Nov 10, 2021
@vweevers vweevers added pull request welcome A pull request is welcome and removed help wanted Extra attention is needed labels Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pull request welcome A pull request is welcome
Projects
None yet
Development

No branches or pull requests

2 participants