We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
How to build for windows on mac?
I'm mimicking the build process of node-sqlite3 in my project to bundle this minimal example, a now() function.
now()
Node-sqlite3 build output works correctly on windows even if it's generated on mac. But my program won't. What am I missing?
Here's my code
// main.js const binary = require('@mapbox/node-pre-gyp'); const path = require('path'); const binding_path = binary.find(path.resolve(path.join(__dirname,'./package.json'))); console.log('binding_path', binding_path); const binding = require(binding_path); module.exports = exports = binding;
// binding.gyp { "targets": [ { "target_name": "<(module_name)", "sources": [ "native-rt.cc" ], "conditions":[ ["OS=='linux'", { "sources": [ "native-rt_linux.cc" ] }], ["OS=='mac'", { "sources": [ "native-rt_mac.cc" ] }], ["OS=='win'", { "sources": [ "native-rt_win.cc" ] }] ], "include_dirs" : [ "<!(node -e \"require('nan')\")" ], "defines": [ "NAPI_VERSION=<(napi_build_version)", "NAPI_DISABLE_CPP_EXCEPTIONS=1" ] }, { "target_name": "action_after_build", "type": "none", "dependencies": [ "<(module_name)" ], "copies": [ { "files": [ "<(PRODUCT_DIR)/<(module_name).node" ], "destination": "<(module_path)" } ] } ] }
Binding path correctly outputs binding_path C:Users\....\lib\binding\napi-v6-win32-unknown-x64\pyembed.node
binding_path C:Users\....\lib\binding\napi-v6-win32-unknown-x64\pyembed.node
However the execution says xxxx.tmp.node is not a valid win32 application? What am I missing compared to node-sqlite3?
Here's the log of a successful sqlite3 fallback rebuild. It's triggered by electron-builder It works correctly on windows even if it's built on mac.
The module_path has win32, but I don't see any other flags related to platform. I don't see "target_platform=win32" either.
• rebuilding native dependency name=sqlite3 version=5.0.10 • execute command command=/path/to/user/.nvm/versions/node/v16.16.0/bin/node /path/to/user/.nvm/versions/node/v16.16.0/lib/node_modules/yarn/bin/yarn.js run install workingDirectory=/path/to/user/hacking/union/node_modules/sqlite3 • command executed executable=/path/to/user/.nvm/versions/node/v16.16.0/bin/node out=$ node-pre-gyp install --fallback-to-build --verbose cc -o Release/obj.target/nothing/../node-addon-api/nothing.o ../../node-addon-api/nothing.c '-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_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DV8_COMPRESS_POINTERS' '-DV8_COMPRESS_POINTERS_IN_ISOLATE_CAGE' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-DV8_REVERSE_JSARGS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' -I/path/to/user/.electron-gyp/19.0.9/include/node -I/path/to/user/.electron-gyp/19.0.9/src -I/path/to/user/.electron-gyp/19.0.9/deps/openssl/config -I/path/to/user/.electron-gyp/19.0.9/deps/openssl/openssl/include -I/path/to/user/.electron-gyp/19.0.9/deps/uv/include -I/path/to/user/.electron-gyp/19.0.9/deps/zlib -I/path/to/user/.electron-gyp/19.0.9/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-addon-api/nothing.o.d.raw -c rm -f Release/nothing.a && ./gyp-mac-tool filter-libtool libtool -static -o Release/nothing.a Release/obj.target/nothing/../node-addon-api/nothing.o LD_LIBRARY_PATH=/path/to/project/node_modules/sqlite3/build/Release/lib.host:/path/to/project/node_modules/sqlite3/build/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps; mkdir -p /path/to/project/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3390200; node ./extract.js ./sqlite-autoconf-3390200.tar.gz "/path/to/project/node_modules/sqlite3/build/Release/obj/gen" touch Release/obj.target/deps/action_before_build.stamp cc -o Release/obj.target/sqlite3/gen/sqlite-autoconf-3390200/sqlite3.o Release/obj/gen/sqlite-autoconf-3390200/sqlite3.c '-DNODE_GYP_MODULE_NAME=sqlite3' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DV8_COMPRESS_POINTERS' '-DV8_COMPRESS_POINTERS_IN_ISOLATE_CAGE' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-DV8_REVERSE_JSARGS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-D_REENTRANT=1' '-DSQLITE_THREADSAFE=1' '-DHAVE_USLEEP=1' '-DSQLITE_ENABLE_FTS3' '-DSQLITE_ENABLE_FTS4' '-DSQLITE_ENABLE_FTS5' '-DSQLITE_ENABLE_RTREE' '-DSQLITE_ENABLE_DBSTAT_VTAB=1' '-DSQLITE_ENABLE_MATH_FUNCTIONS' '-DNDEBUG' -I/path/to/user/.electron-gyp/19.0.9/include/node -I/path/to/user/.electron-gyp/19.0.9/src -I/path/to/user/.electron-gyp/19.0.9/deps/openssl/config -I/path/to/user/.electron-gyp/19.0.9/deps/openssl/openssl/include -I/path/to/user/.electron-gyp/19.0.9/deps/uv/include -I/path/to/user/.electron-gyp/19.0.9/deps/zlib -I/path/to/user/.electron-gyp/19.0.9/deps/v8/include -I./Release/obj/gen/sqlite-autoconf-3390200 -O3 -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/sqlite3/gen/sqlite-autoconf-3390200/sqlite3.o.d.raw -c rm -f Release/sqlite3.a && ./gyp-mac-tool filter-libtool libtool -static -o Release/sqlite3.a Release/obj.target/sqlite3/gen/sqlite-autoconf-3390200/sqlite3.o c++ -o Release/obj.target/node_sqlite3/src/backup.o ../src/backup.cc '-DNODE_GYP_MODULE_NAME=node_sqlite3' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DV8_COMPRESS_POINTERS' '-DV8_COMPRESS_POINTERS_IN_ISOLATE_CAGE' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-DV8_REVERSE_JSARGS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNAPI_VERSION=6' '-DNAPI_DISABLE_CPP_EXCEPTIONS=1' '-DSQLITE_THREADSAFE=1' '-DHAVE_USLEEP=1' '-DSQLITE_ENABLE_FTS3' '-DSQLITE_ENABLE_FTS4' '-DSQLITE_ENABLE_FTS5' '-DSQLITE_ENABLE_RTREE' '-DSQLITE_ENABLE_DBSTAT_VTAB=1' '-DSQLITE_ENABLE_MATH_FUNCTIONS' '-DBUILDING_NODE_EXTENSION' '-DNDEBUG' -I/path/to/user/.electron-gyp/19.0.9/include/node -I/path/to/user/.electron-gyp/19.0.9/src -I/path/to/user/.electron-gyp/19.0.9/deps/openssl/config -I/path/to/user/.electron-gyp/19.0.9/deps/openssl/openssl/include -I/path/to/user/.electron-gyp/19.0.9/deps/uv/include -I/path/to/user/.electron-gyp/19.0.9/deps/zlib -I/path/to/user/.electron-gyp/19.0.9/deps/v8/include -I/path/to/project/node_modules/node-addon-api -I./Release/obj/gen/sqlite-autoconf-3390200 -O3 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++14 -stdlib=libc++ -fno-rtti -fvisibility-inlines-hidden -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/node_sqlite3/src/backup.o.d.raw -c c++ -o Release/obj.target/node_sqlite3/src/database.o ../src/database.cc '-DNODE_GYP_MODULE_NAME=node_sqlite3' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DV8_COMPRESS_POINTERS' '-DV8_COMPRESS_POINTERS_IN_ISOLATE_CAGE' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-DV8_REVERSE_JSARGS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNAPI_VERSION=6' '-DNAPI_DISABLE_CPP_EXCEPTIONS=1' '-DSQLITE_THREADSAFE=1' '-DHAVE_USLEEP=1' '-DSQLITE_ENABLE_FTS3' '-DSQLITE_ENABLE_FTS4' '-DSQLITE_ENABLE_FTS5' '-DSQLITE_ENABLE_RTREE' '-DSQLITE_ENABLE_DBSTAT_VTAB=1' '-DSQLITE_ENABLE_MATH_FUNCTIONS' '-DBUILDING_NODE_EXTENSION' '-DNDEBUG' -I/path/to/user/.electron-gyp/19.0.9/include/node -I/path/to/user/.electron-gyp/19.0.9/src -I/path/to/user/.electron-gyp/19.0.9/deps/openssl/config -I/path/to/user/.electron-gyp/19.0.9/deps/openssl/openssl/include -I/path/to/user/.electron-gyp/19.0.9/deps/uv/include -I/path/to/user/.electron-gyp/19.0.9/deps/zlib -I/path/to/user/.electron-gyp/19.0.9/deps/v8/include -I/path/to/project/node_modules/node-addon-api -I./Release/obj/gen/sqlite-autoconf-3390200 -O3 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++14 -stdlib=libc++ -fno-rtti -fvisibility-inlines-hidden -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/node_sqlite3/src/database.o.d.raw -c c++ -o Release/obj.target/node_sqlite3/src/node_sqlite3.o ../src/node_sqlite3.cc '-DNODE_GYP_MODULE_NAME=node_sqlite3' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DV8_COMPRESS_POINTERS' '-DV8_COMPRESS_POINTERS_IN_ISOLATE_CAGE' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-DV8_REVERSE_JSARGS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNAPI_VERSION=6' '-DNAPI_DISABLE_CPP_EXCEPTIONS=1' '-DSQLITE_THREADSAFE=1' '-DHAVE_USLEEP=1' '-DSQLITE_ENABLE_FTS3' '-DSQLITE_ENABLE_FTS4' '-DSQLITE_ENABLE_FTS5' '-DSQLITE_ENABLE_RTREE' '-DSQLITE_ENABLE_DBSTAT_VTAB=1' '-DSQLITE_ENABLE_MATH_FUNCTIONS' '-DBUILDING_NODE_EXTENSION' '-DNDEBUG' -I/path/to/user/.electron-gyp/19.0.9/include/node -I/path/to/user/.electron-gyp/19.0.9/src -I/path/to/user/.electron-gyp/19.0.9/deps/openssl/config -I/path/to/user/.electron-gyp/19.0.9/deps/openssl/openssl/include -I/path/to/user/.electron-gyp/19.0.9/deps/uv/include -I/path/to/user/.electron-gyp/19.0.9/deps/zlib -I/path/to/user/.electron-gyp/19.0.9/deps/v8/include -I/path/to/project/node_modules/node-addon-api -I./Release/obj/gen/sqlite-autoconf-3390200 -O3 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++14 -stdlib=libc++ -fno-rtti -fvisibility-inlines-hidden -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/node_sqlite3/src/node_sqlite3.o.d.raw -c c++ -o Release/obj.target/node_sqlite3/src/statement.o ../src/statement.cc '-DNODE_GYP_MODULE_NAME=node_sqlite3' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DV8_COMPRESS_POINTERS' '-DV8_COMPRESS_POINTERS_IN_ISOLATE_CAGE' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-DV8_REVERSE_JSARGS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNAPI_VERSION=6' '-DNAPI_DISABLE_CPP_EXCEPTIONS=1' '-DSQLITE_THREADSAFE=1' '-DHAVE_USLEEP=1' '-DSQLITE_ENABLE_FTS3' '-DSQLITE_ENABLE_FTS4' '-DSQLITE_ENABLE_FTS5' '-DSQLITE_ENABLE_RTREE' '-DSQLITE_ENABLE_DBSTAT_VTAB=1' '-DSQLITE_ENABLE_MATH_FUNCTIONS' '-DBUILDING_NODE_EXTENSION' '-DNDEBUG' -I/path/to/user/.electron-gyp/19.0.9/include/node -I/path/to/user/.electron-gyp/19.0.9/src -I/path/to/user/.electron-gyp/19.0.9/deps/openssl/config -I/path/to/user/.electron-gyp/19.0.9/deps/openssl/openssl/include -I/path/to/user/.electron-gyp/19.0.9/deps/uv/include -I/path/to/user/.electron-gyp/19.0.9/deps/zlib -I/path/to/user/.electron-gyp/19.0.9/deps/v8/include -I/path/to/project/node_modules/node-addon-api -I./Release/obj/gen/sqlite-autoconf-3390200 -O3 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++14 -stdlib=libc++ -fno-rtti -fvisibility-inlines-hidden -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/node_sqlite3/src/statement.o.d.raw -c c++ -bundle -undefined dynamic_lookup -Wl,-search_paths_first -Wl,-dead_strip -mmacosx-version-min=10.7 -arch x86_64 -L./Release -stdlib=libc++ -o Release/node_sqlite3.node Release/obj.target/node_sqlite3/src/backup.o Release/obj.target/node_sqlite3/src/database.o Release/obj.target/node_sqlite3/src/node_sqlite3.o Release/obj.target/node_sqlite3/src/statement.o Release/nothing.a Release/sqlite3.a ln -f "Release/node_sqlite3.node" "/path/to/project/node_modules/sqlite3/lib/binding/napi-v6-win32-unknown-x64/node_sqlite3.node" 2>/dev/null || (rm -rf "/path/to/project/node_modules/sqlite3/lib/binding/napi-v6-win32-unknown-x64/node_sqlite3.node" && cp -af "Release/node_sqlite3.node" "/path/to/project/node_modules/sqlite3/lib/binding/napi-v6-win32-unknown-x64/node_sqlite3.node") touch Release/obj.target/action_after_build.stamp errorOut=node-pre-gyp info it worked if it ends with ok node-pre-gyp verb cli [ node-pre-gyp verb cli '/path/to/user/.nvm/versions/node/v16.16.0/bin/node', node-pre-gyp verb cli '/path/to/project/node_modules/sqlite3/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 '--verbose' node-pre-gyp verb cli ] node-pre-gyp info using [email protected] node-pre-gyp info using [email protected] | darwin | x64 node-pre-gyp verb command install [ 'napi_build_version=6' ] node-pre-gyp http GET https://github.com/TryGhost/node-sqlite3/releases/download/v5.0.10/napi-v6-win32-unknown-x64.tar.gz node-pre-gyp http download proxy agent configured using: "http://127.0.0.1:7890/" node-pre-gyp ERR! install request to https://github.com/TryGhost/node-sqlite3/releases/download/v5.0.10/napi-v6-win32-unknown-x64.tar.gz failed, reason: Client network socket disconnected before secure TLS connection was established node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (electron-v19.0 ABI, unknown) (falling back to source compile with node-gyp) node-pre-gyp WARN Hit error request to https://github.com/TryGhost/node-sqlite3/releases/download/v5.0.10/napi-v6-win32-unknown-x64.tar.gz failed, reason: Client network socket disconnected before secure TLS connection was established node-pre-gyp verb command build [ 'rebuild', 'napi_build_version=6' ] gyp info it worked if it ends with ok gyp info using [email protected] gyp info using [email protected] | darwin | x64 gyp info ok gyp info it worked if it ends with ok gyp verb cli [ gyp verb cli '/path/to/user/.nvm/versions/node/v16.16.0/bin/node', gyp verb cli '/path/to/project/node_modules/node-gyp/bin/node-gyp.js', gyp verb cli 'configure', gyp verb cli '--fallback-to-build', gyp verb cli '--loglevel=verbose', gyp verb cli '--module=/path/to/project/node_modules/sqlite3/lib/binding/napi-v6-win32-unknown-x64/node_sqlite3.node', gyp verb cli '--module_name=node_sqlite3', gyp verb cli '--module_path=/path/to/project/node_modules/sqlite3/lib/binding/napi-v6-win32-unknown-x64', gyp verb cli '--napi_version=8', 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 [email protected] gyp info using [email protected] | darwin | x64 gyp verb command configure [] gyp verb download using dist-url https://electronjs.org/headers 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 "python3" can be used gyp verb find Python - executing "python3" to get executable path gyp verb find Python - executable path is "/path/to/user/.pyenv/versions/3.7.5/bin/python3" gyp verb find Python - executing "/path/to/user/.pyenv/versions/3.7.5/bin/python3" to get version gyp verb find Python - version is "3.7.5" gyp info find Python using Python version 3.7.5 found at "/path/to/user/.pyenv/versions/3.7.5/bin/python3" gyp verb get node dir compiling against --target node version: 19.0.9 gyp verb command install [ '19.0.9' ] gyp verb download using dist-url https://electronjs.org/headers gyp verb install input version string "19.0.9" gyp verb install installing version: 19.0.9 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: 19.0.9 gyp verb build dir attempting to create "build" dir: /path/to/project/node_modules/sqlite3/build gyp verb build dir "build" dir needed to be created? Yes gyp verb build/config.gypi creating config file gyp verb build/config.gypi writing out config file: /path/to/project/node_modules/sqlite3/build/config.gypi gyp verb config.gypi checking for gypi file: /path/to/project/node_modules/sqlite3/config.gypi gyp verb common.gypi checking for gypi file: /path/to/project/node_modules/sqlite3/common.gypi gyp verb gyp gyp format was not specified; forcing "make" gyp info spawn /path/to/user/.pyenv/versions/3.7.5/bin/python3 gyp info spawn args [ gyp info spawn args '/path/to/project/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 '/path/to/project/node_modules/sqlite3/build/config.gypi', gyp info spawn args '-I', gyp info spawn args '/path/to/project/node_modules/node-gyp/addon.gypi', gyp info spawn args '-I', gyp info spawn args '/path/to/user/.electron-gyp/19.0.9/include/node/common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=/path/to/user/.electron-gyp/19.0.9', gyp info spawn args '-Dnode_gyp_dir=/path/to/project/node_modules/node-gyp', gyp info spawn args '-Dnode_lib_file=/path/to/user/.electron-gyp/19.0.9/<(target_arch)/node.lib', gyp info spawn args '-Dmodule_root_dir=/path/to/project/node_modules/sqlite3', 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 '/path/to/user/.nvm/versions/node/v16.16.0/bin/node', gyp verb cli '/path/to/project/node_modules/node-gyp/bin/node-gyp.js', gyp verb cli 'build', gyp verb cli '--fallback-to-build', gyp verb cli '--loglevel=verbose', gyp verb cli '--module=/path/to/project/node_modules/sqlite3/lib/binding/napi-v6-win32-unknown-x64/node_sqlite3.node', gyp verb cli '--module_name=node_sqlite3', gyp verb cli '--module_path=/path/to/project/node_modules/sqlite3/lib/binding/napi-v6-win32-unknown-x64', gyp verb cli '--napi_version=8', 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 [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 /path/to/user/.electron-gyp/19.0.9 gyp verb `which` succeeded for `make` /usr/bin/make gyp info spawn make gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ] 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) ../src/backup.cc:179:9: warning: unused variable 'status' [-Wunused-variable] int status = napi_create_async_work( ^ ../src/backup.cc:252:5: warning: unused variable 'status' [-Wunused-variable] BACKUP_BEGIN(Step); ^ ../src/macros.h:182:9: note: expanded from macro 'BACKUP_BEGIN' int status = napi_create_async_work( \ ^ ../src/backup.cc:319:5: warning: unused variable 'status' [-Wunused-variable] BACKUP_BEGIN(Finish); ^ ../src/macros.h:182:9: note: expanded from macro 'BACKUP_BEGIN' int status = napi_create_async_work( \ ^ 3 warnings generated. ../src/database.cc:155:9: warning: unused variable 'status' [-Wunused-variable] int status = napi_create_async_work( ^ ../src/database.cc:249:9: warning: unused variable 'status' [-Wunused-variable] int status = napi_create_async_work( ^ ../src/database.cc:562:9: warning: unused variable 'status' [-Wunused-variable] int status = napi_create_async_work( ^ ../src/database.cc:671:9: warning: unused variable 'status' [-Wunused-variable] int status = napi_create_async_work( ^ 4 warnings generated. ../src/statement.cc:122:9: warning: unused variable 'status' [-Wunused-variable] int status = napi_create_async_work( ^ ../src/statement.cc:350:5: warning: unused variable 'status' [-Wunused-variable] STATEMENT_BEGIN(Bind); ^ ../src/macros.h:146:9: note: expanded from macro 'STATEMENT_BEGIN' int status = napi_create_async_work( \ ^ ../src/statement.cc:402:5: warning: unused variable 'status' [-Wunused-variable] STATEMENT_BEGIN(Get); ^ ../src/macros.h:146:9: note: expanded from macro 'STATEMENT_BEGIN' int status = napi_create_async_work( \ ^ ../src/statement.cc:474:5: warning: unused variable 'status' [-Wunused-variable] STATEMENT_BEGIN(Run); ^ ../src/macros.h:146:9: note: expanded from macro 'STATEMENT_BEGIN' int status = napi_create_async_work( \ ^ ../src/statement.cc:544:5: warning: unused variable 'status' [-Wunused-variable] STATEMENT_BEGIN(All); ^ ../src/macros.h:146:9: note: expanded from macro 'STATEMENT_BEGIN' int status = napi_create_async_work( \ ^ ../src/statement.cc:645:5: warning: unused variable 'status' [-Wunused-variable] STATEMENT_BEGIN(Each); ^ ../src/macros.h:146:9: note: expanded from macro 'STATEMENT_BEGIN' int status = napi_create_async_work( \ ^ ../src/statement.cc:772:5: warning: unused variable 'status' [-Wunused-variable] STATEMENT_BEGIN(Reset); ^ ../src/macros.h:146:9: note: expanded from macro 'STATEMENT_BEGIN' int status = napi_create_async_work( \ ^ 7 warnings generated. ld: warning: object file (Release/sqlite3.a(sqlite3.o)) was built for newer macOS version (10.13) than being linked (10.7) gyp info ok node-pre-gyp info ok
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Question
How to build for windows on mac?
I'm mimicking the build process of node-sqlite3 in my project to bundle this minimal example, a
now()
function.Node-sqlite3 build output works correctly on windows even if it's generated on mac. But my program won't. What am I missing?
My code and logs
Here's my code
Binding path correctly outputs
binding_path C:Users\....\lib\binding\napi-v6-win32-unknown-x64\pyembed.node
However the execution says xxxx.tmp.node is not a valid win32 application? What am I missing compared to node-sqlite3?
Node-sqlite3 logs
Here's the log of a successful sqlite3 fallback rebuild. It's triggered by electron-builder It works correctly on windows even if it's built on mac.
The module_path has win32, but I don't see any other flags related to platform. I don't see "target_platform=win32" either.
The text was updated successfully, but these errors were encountered: