journeyapps / node-sqlcipher

SQLCipher bindings for Node
https://journeyapps.com
BSD 3-Clause "New" or "Revised" License
207 stars 66 forks source link

can't compile on Intel Mac X64 #89

Closed terry2010 closed 2 years ago

terry2010 commented 3 years ago

after I failed compile Mac M1 version , I tried to compile from source code for Mac X64 version , but I still failed.

how can I compile code on mac , thank you


terry@terrydeMacBook-Pro node-sqlcipher % pwd /Users/terry/Documents/code/node-sqlcipher terry@terrydeMacBook-Pro node-sqlcipher % node -v v14.0.0 terry@terrydeMacBook-Pro node-sqlcipher % openssl version OpenSSL 1.1.1l 24 Aug 2021 terry@terrydeMacBook-Pro node-sqlcipher % echo $LDFLAGS -L/usr/local/opt/openssl@1.1/lib terry@terrydeMacBook-Pro node-sqlcipher % echo $CPPFLAGS -I/usr/local/opt/openssl@1.1/include terry@terrydeMacBook-Pro node-sqlcipher % ls /usr/local/opt/openssl@1.1/ AUTHORS INSTALL_RECEIPT.json NEWS bin lib CHANGES LICENSE README include share


npm install --build-from-source --loglevel verbose
npm info it worked if it ends with ok npm verb cli [ npm verb cli '/usr/local/bin/node', npm verb cli '/usr/local/bin/npm', npm verb cli 'install', npm verb cli '--build-from-source', npm verb cli '--loglevel', npm verb cli 'verbose' npm verb cli ] npm info using npm@6.14.4 npm info using node@v14.0.0 npm verb npm-session 38b9409e2056851e npm info lifecycle @journeyapps/sqlcipher@5.2.0~preinstall: @journeyapps/sqlcipher@5.2.0 npm timing stage:loadCurrentTree Completed in 514ms npm timing stage:loadIdealTree:cloneCurrentTree Completed in 3ms npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it! npm timing stage:loadIdealTree:loadShrinkwrap Completed in 317ms npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 247ms npm timing stage:loadIdealTree Completed in 650ms npm timing stage:generateActionsToTake Completed in 31ms npm verb correctMkdir /Users/terry/.npm/_locks correctMkdir not in flight; initializing npm verb lock using /Users/terry/.npm/_locks/staging-1f8aaa695c38cfe2.lock for /Users/terry/Documents/code/node-sqlcipher/node_modules/.staging npm verb unlock done using /Users/terry/.npm/_locks/staging-1f8aaa695c38cfe2.lock for /Users/terry/Documents/code/node-sqlcipher/node_modules/.staging npm timing stage:executeActions Completed in 45ms npm timing stage:rollbackFailedOptional Completed in 0ms npm info linkStuff @journeyapps/sqlcipher@5.2.0 npm info lifecycle @journeyapps/sqlcipher@5.2.0~install: @journeyapps/sqlcipher@5.2.0

@journeyapps/sqlcipher@5.2.0 install /Users/terry/Documents/code/node-sqlcipher node-pre-gyp install --fallback-to-build

node-pre-gyp info it worked if it ends with ok node-pre-gyp verb cli [ node-pre-gyp verb cli '/usr/local/bin/node', node-pre-gyp verb cli '/Users/terry/Documents/code/node-sqlcipher/node_modules/.bin/node-pre-gyp', node-pre-gyp verb cli 'install', node-pre-gyp verb cli '--fallback-to-build' node-pre-gyp verb cli ] node-pre-gyp info using node-pre-gyp@1.0.0 node-pre-gyp info using node@14.0.0 | darwin | x64 node-pre-gyp verb command install [ 'napi_build_version=6' ] node-pre-gyp info build requesting source compile node-pre-gyp verb command build [ 'rebuild', 'napi_build_version=6' ] gyp info it worked if it ends with ok gyp verb cli [ gyp verb cli '/usr/local/bin/node', gyp verb cli '/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js', gyp verb cli 'clean' gyp verb cli ] gyp info using node-gyp@5.1.0 gyp info using node@14.0.0 | darwin | x64 gyp verb command clean [] gyp verb clean removing "build" directory gyp info ok gyp info it worked if it ends with ok gyp verb cli [ gyp verb cli '/usr/local/bin/node', gyp verb cli '/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js', gyp verb cli 'configure', gyp verb cli '--fallback-to-build', gyp verb cli '--module=/Users/terry/Documents/code/node-sqlcipher/lib/binding/napi-v6-darwin-x64/node_sqlite3.node', gyp verb cli '--module_name=node_sqlite3', gyp verb cli '--module_path=/Users/terry/Documents/code/node-sqlcipher/lib/binding/napi-v6-darwin-x64', gyp verb cli '--napi_version=6', gyp verb cli '--node_abi_napi=napi', gyp verb cli '--napi_build_version=6', gyp verb cli '--node_napi_label=napi-v6' gyp verb cli ] gyp info using node-gyp@5.1.0 gyp info using node@14.0.0 | darwin | x64 gyp verb command configure [] gyp verb find Python Python is not set from command line or npm configuration gyp verb find Python Python is not set from environment variable PYTHON gyp verb find Python checking if "python" can be used gyp verb find Python - executing "python" to get executable path gyp verb find Python - executable path is "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python" gyp verb find Python - executing "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python" to get version gyp verb find Python - version is "2.7.16" 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 verb get node dir no --target version specified, falling back to host node version: 14.0.0 gyp verb command install [ '14.0.0' ] gyp verb install input version string "14.0.0" gyp verb install installing version: 14.0.0 gyp verb install --ensure was passed, so won't reinstall if already installed gyp verb install version is already installed, need to check "installVersion" gyp verb got "installVersion" 9 gyp verb needs "installVersion" 9 gyp verb install version is good gyp verb get node dir target node version installed: 14.0.0 gyp verb build dir attempting to create "build" dir: /Users/terry/Documents/code/node-sqlcipher/build gyp verb build dir "build" dir needed to be created? /Users/terry/Documents/code/node-sqlcipher/build gyp verb build/config.gypi creating config file gyp verb build/config.gypi writing out config file: /Users/terry/Documents/code/node-sqlcipher/build/config.gypi gyp verb config.gypi checking for gypi file: /Users/terry/Documents/code/node-sqlcipher/config.gypi gyp verb common.gypi checking for gypi file: /Users/terry/Documents/code/node-sqlcipher/common.gypi gyp verb gyp gyp format was not specified; forcing "make" 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 '/usr/local/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/terry/Documents/code/node-sqlcipher/build/config.gypi', gyp info spawn args '-I', gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', gyp info spawn args '-I', gyp info spawn args '/Users/terry/Library/Caches/node-gyp/14.0.0/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/terry/Library/Caches/node-gyp/14.0.0', gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp', gyp info spawn args '-Dnode_lib_file=/Users/terry/Library/Caches/node-gyp/14.0.0/<(target_arch)/node.lib', gyp info spawn args '-Dmodule_root_dir=/Users/terry/Documents/code/node-sqlcipher', 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 ok gyp info it worked if it ends with ok gyp verb cli [ gyp verb cli '/usr/local/bin/node', gyp verb cli '/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js', gyp verb cli 'build', gyp verb cli '--fallback-to-build', gyp verb cli '--module=/Users/terry/Documents/code/node-sqlcipher/lib/binding/napi-v6-darwin-x64/node_sqlite3.node', gyp verb cli '--module_name=node_sqlite3', gyp verb cli '--module_path=/Users/terry/Documents/code/node-sqlcipher/lib/binding/napi-v6-darwin-x64', gyp verb cli '--napi_version=6', gyp verb cli '--node_abi_napi=napi', gyp verb cli '--napi_build_version=6', gyp verb cli '--node_napi_label=napi-v6' gyp verb cli ] gyp info using node-gyp@5.1.0 gyp info using node@14.0.0 | darwin | x64 gyp verb command build [] gyp verb build type Release gyp verb architecture x64 gyp verb node dev dir /Users/terry/Library/Caches/node-gyp/14.0.0 gyp verb which succeeded for make /usr/bin/make gyp info spawn make gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ] cc '-DNODE_GYP_MODULE_NAME=nothing' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' -I/Users/terry/Library/Caches/node-gyp/14.0.0/include/node -I/Users/terry/Library/Caches/node-gyp/14.0.0/src -I/Users/terry/Library/Caches/node-gyp/14.0.0/deps/openssl/config -I/Users/terry/Library/Caches/node-gyp/14.0.0/deps/openssl/openssl/include -I/Users/terry/Library/Caches/node-gyp/14.0.0/deps/uv/include -I/Users/terry/Library/Caches/node-gyp/14.0.0/deps/zlib -I/Users/terry/Library/Caches/node-gyp/14.0.0/deps/v8/include -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/nothing/node_modules/node-addon-api/nothing.o.d.raw -I/usr/local/opt/openssl@1.1/include -c -o Release/obj.target/nothing/node_modules/node-addon-api/nothing.o ../node_modules/node-addon-api/nothing.c rm -f Release/nothing.a && ./gyp-mac-tool filter-libtool libtool -static -o Release/nothing.a Release/obj.target/nothing/node_modules/node-addon-api/nothing.o warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols) LD_LIBRARY_PATH=/Users/terry/Documents/code/node-sqlcipher/build/Release/lib.host:/Users/terry/Documents/code/node-sqlcipher/build/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps; mkdir -p /Users/terry/Documents/code/node-sqlcipher/build/Release/obj/gen/sqlcipher-amalgamation-3033000; python2 ./extract.py ./sqlcipher-amalgamation-3033000.tar.gz "/Users/terry/Documents/code/node-sqlcipher/build/Release/obj/gen" Traceback (most recent call last): File "./extract.py", line 7, in tfile = tarfile.open(tarball,'r:gz'); File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 1693, in open return func(name, filemode, fileobj, **kwargs) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 1751, in gzopen raise ReadError("not a gzip file") tarfile.ReadError: not a gzip file make: *** [Release/obj/gen/sqlcipher-amalgamation-3033000/sqlite3.c] Error 1 gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12) gyp ERR! System Darwin 20.6.0 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/terry/Documents/code/node-sqlcipher/lib/binding/napi-v6-darwin-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/Users/terry/Documents/code/node-sqlcipher/lib/binding/napi-v6-darwin-x64" "--napi_version=6" "--node_abi_napi=napi" "--napi_build_version=6" "--node_napi_label=napi-v6" gyp ERR! cwd /Users/terry/Documents/code/node-sqlcipher gyp ERR! node -v v14.0.0 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/terry/Documents/code/node-sqlcipher/lib/binding/napi-v6-darwin-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Users/terry/Documents/code/node-sqlcipher/lib/binding/napi-v6-darwin-x64 --napi_version=6 --node_abi_napi=napi --napi_build_version=6 --node_napi_label=napi-v6' (1) node-pre-gyp ERR! stack at ChildProcess. (/Users/terry/Documents/code/node-sqlcipher/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:315:20) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1051:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) node-pre-gyp ERR! System Darwin 20.6.0 node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/terry/Documents/code/node-sqlcipher/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /Users/terry/Documents/code/node-sqlcipher node-pre-gyp ERR! node -v v14.0.0 node-pre-gyp ERR! node-pre-gyp -v v1.0.0 node-pre-gyp ERR! not ok Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/terry/Documents/code/node-sqlcipher/lib/binding/napi-v6-darwin-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Users/terry/Documents/code/node-sqlcipher/lib/binding/napi-v6-darwin-x64 --napi_version=6 --node_abi_napi=napi --napi_build_version=6 --node_napi_label=napi-v6' (1) npm verb lifecycle @journeyapps/sqlcipher@5.2.0~install: unsafe-perm in lifecycle true npm verb lifecycle @journeyapps/sqlcipher@5.2.0~install: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/terry/Documents/code/node-sqlcipher/node_modules/.bin:/usr/local/opt/openssl@1.1/bin:/usr/local/opt/openssl@3/bin:/usr/local/opt/openssl@1.1/bin:/usr/local/opt/openjdk/bin:/usr/local/opt/gnu-getopt/bin:/usr/local/opt/tcl-tk/bin:/usr/local/opt/icu4c/sbin:/usr/local/sbin:/usr/local/bin:/usr/local/opt/openjdk/bin:/usr/local/opt/gnu-getopt/bin:/usr/local/opt/tcl-tk/bin:/usr/local/opt/icu4c/sbin:/usr/local/sbin:/usr/local/bin:/usr/local/opt/openjdk/bin:/usr/local/opt/gnu-getopt/bin:/usr/local/opt/tcl-tk/bin:/usr/local/opt/icu4c/sbin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/opt/X11/bin:/Library/Apple/usr/bin npm verb lifecycle @journeyapps/sqlcipher@5.2.0~install: CWD: /Users/terry/Documents/code/node-sqlcipher npm timing audit submit Completed in 1299ms npm http fetch POST 200 https://mirrors.cloud.tencent.com/npm/-/npm/v1/security/audits/quick 1311ms npm timing audit body Completed in 12ms npm info lifecycle @journeyapps/sqlcipher@5.2.0~install: Failed to exec install script npm verb stack Error: @journeyapps/sqlcipher@5.2.0 install: node-pre-gyp install --fallback-to-build npm verb stack Exit status 1 npm verb stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16) npm verb stack at EventEmitter.emit (events.js:315:20) npm verb stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) npm verb stack at ChildProcess.emit (events.js:315:20) npm verb stack at maybeClose (internal/child_process.js:1051:16) npm verb stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) npm verb pkgid @journeyapps/sqlcipher@5.2.0 npm verb cwd /Users/terry/Documents/code/node-sqlcipher npm verb Darwin 20.6.0 npm verb argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--build-from-source" "--loglevel" "verbose" npm verb node v14.0.0 npm verb npm v6.14.4 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @journeyapps/sqlcipher@5.2.0 install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @journeyapps/sqlcipher@5.2.0 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm verb exit [ 1, true ] npm timing npm Completed in 5488ms

npm ERR! A complete log of this run can be found in: npm ERR! /Users/terry/.npm/_logs/2021-11-26T10_10_19_162Z-debug.l 2021-11-26T10_10_19_162Z-debug.log og

rkistner commented 2 years ago

This is an error with extracting the .tar.gz file. Most likely cause is not having git-lfs configured.