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

Update node-gyp to 10.0.1 #2

Merged
merged 457 commits into from
Feb 21, 2024

Conversation

jaimecbernardo
Copy link

Hi @staltz ,

Creating this PR to update the base version of nodejs-mobile-gyp to match node-gyp 10.0.1 (latest release). Main motivator is really that nodejs-mobile-gyp doesn't work with Python3, that's shipped by default everywhere now. node-gyp upstream has that fixed for ages, it seems.

I've tested this nodejs-mobile-gyp for Android in nodejs-mobile-cordova, but I'm on an Android only scenario for now and don't really have the means to test iOS. Is there some change you can test for your iOS use cases as well? Thank you.

I've been consuming this updated version by overriding a dependency of a dependency as needed. I assume the same can be done for testing it with nodejs-mobile-react-native as well.
Here's what I'm adding to package.json.

  "overrides": {
    "nodejs-mobile-cordova": {
      "nodejs-mobile-gyp": "github:JaneaSystems/nodejs-mobile-gyp#merge-node-gyp-10.0"
    }
  },

For seeing actual differences between upstream 10.0.1 and this new branch, JaneaSystems/nodejs-mobile-gyp@upstream-v10.0.1...merge-node-gyp-10.0 is a better way of seeing those.

If all is well, thinking it'd be nice upping the nodejs-mobile-gyp version to 0.4.0 and releasing to npm. (or 10.0.1, really, since it's mirroring that one)

Thoughts?
For merging, it's best for a merge commit, to facilitate future updates.

ryzokuken and others added 30 commits May 26, 2020 15:15
PR-URL: nodejs/node-gyp#2092
Reviewed-By: Rod Vagg <rod@vagg.org>
only supported on Node.js 10+

Closes: #2084
PR-URL: nodejs/node-gyp#2123
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
PR-URL: nodejs/node-gyp#2133
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Christian Clauss <cclauss@me.com>
Makes npm warn users if they are using an unsupported Node version.

Refs: nodejs/node-gyp#2123
PR-URL: nodejs/node-gyp#2153
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
PR-URL: nodejs/node-gyp#2150
Reviewed-By: Rod Vagg <rod@vagg.org>
PR-URL: nodejs/node-gyp#2156
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
PR-URL: nodejs/node-gyp#2165
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
PR-URL: nodejs/node-gyp#2165
Co-authored-by: Christian Clauss <cclauss@me.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Christian Clauss <cclauss@me.com>
PR-URL: nodejs/node-gyp#2167
This isn't needed, and was probably copy-pasted from
windows-build-tools' README.md, which has since been changed
to drop the `--production` flag from the install instructions.

PR-URL: nodejs/node-gyp#2206
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Matias Lopez <imatlopez@gmail.com>
PR-URL: nodejs/node-gyp#2210
Closes: #2127
Closes: #2209
PR-URL: nodejs/node-gyp#2218
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Matias Lopez <imatlopez@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
From python: [3.6, 3.7, 3.8] --> python: [3.6, 3.8, 3.9] because if things work on Python 3.6 and 3.8 then they should work on 3.7.

https://www.python.org/downloads/release/python-390/
PR-URL: nodejs/node-gyp#2230
Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
PR-URL: nodejs/node-gyp#2229
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Closes: nodejs/node-gyp#2236
PR-URL: nodejs/node-gyp#2238
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
PR-URL: nodejs/node-gyp#2240
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
PR-URL: nodejs/node-gyp#2239
Reviewed-By: Christian Clauss <cclauss@me.com>
PR-URL: nodejs/node-gyp#2235
Reviewed-By: Christian Clauss <cclauss@me.com>
PR-URL: nodejs/node-gyp#2244
Reviewed-By: Rod Vagg <rod@vagg.org>
PR-URL: nodejs/node-gyp#2285
Reviewed-By: Richard Lau <rlau@redhat.com>
PR-URL: nodejs/node-gyp#2281
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
PR-URL: nodejs/node-gyp#2284
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Christian Clauss <cclauss@me.com>
PR-URL: nodejs/node-gyp#2293
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
PR-URL: nodejs/node-gyp#2318
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
PR-URL: nodejs/node-gyp#2322
Refs: nodejs/node#36902
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
lukekarrys and others added 18 commits October 27, 2023 20:51
BREAKING CHANGE: `node-gyp` now supports node `^16.14.0 || >=18.0.0`
BREAKING CHANGE: All internal functions have been coverted to return
promises and no longer accept callbacks. This is not a breaking change
for users but may be breaking to consumers of `node-gyp` if you are
requiring internal functions directly.
BREAKING CHANGE: the `Gyp` class exported is now created using
ECMAScript classes and therefore might have small differences to classes
that were previously created with `util.inherits`.
* chore: misc test fixes

* Sort test runs by os first

* Use cross-env for test env var

* Try sorting matrix params

* Make FAST_TEST the default and rename to FULL_TEST

* Separate helper functions to not need to export test obj in files
* feat!: use package.json files to limit which files are published

Fixes: #2372

* Use npmignore instead of package.json#files

* Add update-gyp.py to npmignore

* Add install to pack test

* Use output var for pack dir

* Move existing .gitignore entries to .npmignore

* Sort git and npm ignores

* Update and cleanup workflows
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
The `findAccessibleSync()` function is in the local `util` module
instead of Node.js' builtin `util` module.
@staltz
Copy link
Member

staltz commented Dec 7, 2023

@jaimecbernardo Thanks a lot for this, and great to see you collaborating again.

I tried out using this update via the overrides but ran into another issue that is blocking me (seems like strip-ansi is being updated to a breaking change):

There was a problem loading formatter: ./node_modules/eslint/lib/cli-engine/formatters/stylish
Error: require() of ES Module ./node_modules/strip-ansi/index.js from ./node_modules/eslint/lib/cli-engine/formatters/stylish.js not supported.
Instead change the require of index.js in ./node_modules/eslint/lib/cli-engine/formatters/stylish.js to a dynamic import() which is available in all CommonJS modules.

This happened for stylish and ora and maybe others. I ended up chasing bug this for too long and I have other work to do today. Will come back to this.

@jaimecbernardo
Copy link
Author

@jaimecbernardo Thanks a lot for this, and great to see you collaborating again.

I tried out using this update via the overrides but ran into another issue that is blocking me (seems like strip-ansi is being updated to a breaking change):

There was a problem loading formatter: ./node_modules/eslint/lib/cli-engine/formatters/stylish
Error: require() of ES Module ./node_modules/strip-ansi/index.js from ./node_modules/eslint/lib/cli-engine/formatters/stylish.js not supported.
Instead change the require of index.js in ./node_modules/eslint/lib/cli-engine/formatters/stylish.js to a dynamic import() which is available in all CommonJS modules.

This happened for stylish and ora and maybe others. I ended up chasing bug this for too long and I have other work to do today. Will come back to this.

Thanks for the update and for giving it a try.
Weird, is this only occurring when testing with this override?

@staltz
Copy link
Member

staltz commented Dec 7, 2023

Weird, is this only occurring when testing with this override?

Yes. I can try on another nodejs-mobile project for iOS that I have locally.

@jaimecbernardo
Copy link
Author

I've been using it on nodejs-mobile-cordova, so maybe there's something different in react-native that triggers the lint? I'll give react-native a try too.

@jaimecbernardo
Copy link
Author

I've just given a nodejs-mobile-react-native a try, with the nodejs-mobile-gyp override and a nodejs-project running sqlite3 (with a node-pre-gyp override as well). I've been able to run this well on android and confirmed sqlite3 is running on Android. (did have to delete a folder named "root" from one of the node_modules in nodejs-project because it doesn't work well copying on Android runtime, but that was the only weird hack to get it to not fail at runtime).
Didn't get any linter errors.

I've got no iOS device to test, though :(
But looks like the linter errors are not related directly to the nodejs-mobile-gyp update itself, unless it's forcing some other version elsewhere.

Regarding nodejs-mobile-react-native experience, WOW, I don't remember ever having such a pleasant experience with this beast 😄 You really did a number here. Great work!

@staltz
Copy link
Member

staltz commented Dec 11, 2023

I tried using this updated nodejs-mobile-gyp now on iOS (on Manyverse, which is open source, easy to reproduce), and got a native addon compilation error which I believe originates from nodejs-mobile-gyp. However, one of the native addons (bufferutil) successfully compiled, while the other (leveldown-nodejs-mobile) didn't:

Traceback (most recent call last):
  File "/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp/gyp/gyp_main.py", line 45, in <module>
    sys.exit(gyp.script_main())
  File "/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp/gyp/pylib/gyp/__init__.py", line 688, in script_main
    return main(sys.argv[1:])
  File "/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp/gyp/pylib/gyp/__init__.py", line 680, in main
    return gyp_main(args)
  File "/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp/gyp/pylib/gyp/__init__.py", line 665, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp/gyp/pylib/gyp/generator/make.py", line 2647, in GenerateOutput
    writer.Write(
  File "/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp/gyp/pylib/gyp/generator/make.py", line 944, in Write
    self.WriteTarget(
  File "/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp/gyp/pylib/gyp/generator/make.py", line 1991, in WriteTarget
    assert install_path == self.output, f"{install_path} != {self.output}"
AssertionError: $(builddir)/snappy.a != $(obj).target/deps/snappy/snappy.a

I ran the build native scripts for Android and those succeeded though. So it seems iOS specific.

CLICK to see full log here

npm info run bufferutil@4.0.1 install node_modules/bufferutil $PROJECT_DIR/../node_modules/.bin/node-gyp-build-mobile

> bufferutil@4.0.1 install
> $PROJECT_DIR/../node_modules/.bin/node-gyp-build-mobile

gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli '/Users/staltz/.nvm/versions/node/v18.17.1/bin/node',
gyp verb cli '/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild'
gyp verb cli ]
gyp info using node-gyp@0.3.1
gyp info using node@18.17.1 | darwin | x64
gyp verb clean removing "build" directory
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 "/Applications/Xcode.app/Contents/Developer/usr/bin/python3"
gyp verb find Python - executing "/Applications/Xcode.app/Contents/Developer/usr/bin/python3" to get version
gyp verb find Python - version is "3.9.6"
gyp info find Python using Python version 3.9.6 found at "/Applications/Xcode.app/Contents/Developer/usr/bin/python3"
gyp verb get node dir compiling against specified --nodedir dev files: /Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-react-native/ios/libnode
gyp verb build dir attempting to create "build" dir: /Users/staltz/Library/Developer/Xcode/DerivedData/Manyverse-apuvsofckhifrpanlgiseiimvrgg/Build/Products/Debug-iphoneos/Manyverse.app/nodejs-project/node_modules/bufferutil/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: /Users/staltz/Library/Developer/Xcode/DerivedData/Manyverse-apuvsofckhifrpanlgiseiimvrgg/Build/Products/Debug-iphoneos/Manyverse.app/nodejs-project/node_modules/bufferutil/build/config.gypi
gyp verb config.gypi checking for gypi file: /Users/staltz/Library/Developer/Xcode/DerivedData/Manyverse-apuvsofckhifrpanlgiseiimvrgg/Build/Products/Debug-iphoneos/Manyverse.app/nodejs-project/node_modules/bufferutil/config.gypi
gyp verb common.gypi checking for gypi file: /Users/staltz/Library/Developer/Xcode/DerivedData/Manyverse-apuvsofckhifrpanlgiseiimvrgg/Build/Products/Debug-iphoneos/Manyverse.app/nodejs-project/node_modules/bufferutil/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /Applications/Xcode.app/Contents/Developer/usr/bin/python3
gyp info spawn args [
gyp info spawn args '/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make-ios',
gyp info spawn args '-I',
gyp info spawn args '/Users/staltz/Library/Developer/Xcode/DerivedData/Manyverse-apuvsofckhifrpanlgiseiimvrgg/Build/Products/Debug-iphoneos/Manyverse.app/nodejs-project/node_modules/bufferutil/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-react-native/ios/libnode/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/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-react-native/ios/libnode',
gyp info spawn args '-Dnode_gyp_dir=/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-react-native/ios/libnode/$(Configuration)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/staltz/Library/Developer/Xcode/DerivedData/Manyverse-apuvsofckhifrpanlgiseiimvrgg/Build/Products/Debug-iphoneos/Manyverse.app/nodejs-project/node_modules/bufferutil',
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 verb build type Release
gyp verb architecture arm64
gyp verb node dev dir /Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-react-native/ios/libnode
gyp verb python /Applications/Xcode.app/Contents/Developer/usr/bin/python3
gyp verb `which` succeeded for `make` /Applications/Xcode.app/Contents/Developer/usr/bin/make
gyp verb bin symlinks created symlink to "/Applications/Xcode.app/Contents/Developer/usr/bin/python3" in "/Users/staltz/Library/Developer/Xcode/DerivedData/Manyverse-apuvsofckhifrpanlgiseiimvrgg/Build/Products/Debug-iphoneos/Manyverse.app/nodejs-project/node_modules/bufferutil/build/node_gyp_bins" and added to PATH
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
  cc -o Release/obj.target/bufferutil/src/bufferutil.o ../src/bufferutil.c '-DNODE_GYP_MODULE_NAME=bufferutil' '-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' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_ASM' '-DBUILDING_NODE_EXTENSION' -I/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-react-native/ios/libnode/include/node -I/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-react-native/ios/libnode/src -I/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-react-native/ios/libnode/deps/openssl/config -I/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-react-native/ios/libnode/deps/openssl/openssl/include -I/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-react-native/ios/libnode/deps/uv/include -I/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-react-native/ios/libnode/deps/zlib -I/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-react-native/ios/libnode/deps/v8/include  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk -O3 -gdwarf-2 -miphoneos-version-min=13.0 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -fembed-bitcode -MMD -MF ./Release/.deps/Release/obj.target/bufferutil/src/bufferutil.o.d.raw   -c
  c++ -shared -undefined dynamic_lookup -Wl,-no_pie -Wl,-search_paths_first -miphoneos-version-min=13.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk -arch arm64 -L./Release -stdlib=libc++  -o "Release/bufferutil.node/bufferutil" ./Release/obj.target/bufferutil/src/bufferutil.o
ld: warning: -undefined dynamic_lookup is deprecated on iOS
  ./gyp-mac-tool package-framework "Release/bufferutil.node" A
gyp info ok
npm info run bufferutil@4.0.1 install { code: 0, signal: null }
npm info run leveldown-nodejs-mobile@5.4.1-3 install node_modules/leveldown-nodejs-mobile $PROJECT_DIR/../node_modules/.bin/node-gyp-build-mobile

> leveldown-nodejs-mobile@5.4.1-3 install
> $PROJECT_DIR/../node_modules/.bin/node-gyp-build-mobile

gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli '/Users/staltz/.nvm/versions/node/v18.17.1/bin/node',
gyp verb cli '/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild'
gyp verb cli ]
gyp info using node-gyp@0.3.1
gyp info using node@18.17.1 | darwin | x64
gyp verb clean removing "build" directory
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 "/Applications/Xcode.app/Contents/Developer/usr/bin/python3"
gyp verb find Python - executing "/Applications/Xcode.app/Contents/Developer/usr/bin/python3" to get version
gyp verb find Python - version is "3.9.6"
gyp info find Python using Python version 3.9.6 found at "/Applications/Xcode.app/Contents/Developer/usr/bin/python3"
gyp verb get node dir compiling against specified --nodedir dev files: /Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-react-native/ios/libnode
gyp verb build dir attempting to create "build" dir: /Users/staltz/Library/Developer/Xcode/DerivedData/Manyverse-apuvsofckhifrpanlgiseiimvrgg/Build/Products/Debug-iphoneos/Manyverse.app/nodejs-project/node_modules/leveldown-nodejs-mobile/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: /Users/staltz/Library/Developer/Xcode/DerivedData/Manyverse-apuvsofckhifrpanlgiseiimvrgg/Build/Products/Debug-iphoneos/Manyverse.app/nodejs-project/node_modules/leveldown-nodejs-mobile/build/config.gypi
gyp verb config.gypi checking for gypi file: /Users/staltz/Library/Developer/Xcode/DerivedData/Manyverse-apuvsofckhifrpanlgiseiimvrgg/Build/Products/Debug-iphoneos/Manyverse.app/nodejs-project/node_modules/leveldown-nodejs-mobile/config.gypi
gyp verb common.gypi checking for gypi file: /Users/staltz/Library/Developer/Xcode/DerivedData/Manyverse-apuvsofckhifrpanlgiseiimvrgg/Build/Products/Debug-iphoneos/Manyverse.app/nodejs-project/node_modules/leveldown-nodejs-mobile/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /Applications/Xcode.app/Contents/Developer/usr/bin/python3
gyp info spawn args [
gyp info spawn args '/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make-ios',
gyp info spawn args '-I',
gyp info spawn args '/Users/staltz/Library/Developer/Xcode/DerivedData/Manyverse-apuvsofckhifrpanlgiseiimvrgg/Build/Products/Debug-iphoneos/Manyverse.app/nodejs-project/node_modules/leveldown-nodejs-mobile/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-react-native/ios/libnode/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/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-react-native/ios/libnode',
gyp info spawn args '-Dnode_gyp_dir=/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-react-native/ios/libnode/$(Configuration)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/staltz/Library/Developer/Xcode/DerivedData/Manyverse-apuvsofckhifrpanlgiseiimvrgg/Build/Products/Debug-iphoneos/Manyverse.app/nodejs-project/node_modules/leveldown-nodejs-mobile',
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 ]
Traceback (most recent call last):
  File "/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp/gyp/gyp_main.py", line 45, in <module>
    sys.exit(gyp.script_main())
  File "/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp/gyp/pylib/gyp/__init__.py", line 688, in script_main
    return main(sys.argv[1:])
  File "/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp/gyp/pylib/gyp/__init__.py", line 680, in main
    return gyp_main(args)
  File "/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp/gyp/pylib/gyp/__init__.py", line 665, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp/gyp/pylib/gyp/generator/make.py", line 2647, in GenerateOutput
    writer.Write(
  File "/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp/gyp/pylib/gyp/generator/make.py", line 944, in Write
    self.WriteTarget(
  File "/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp/gyp/pylib/gyp/generator/make.py", line 1991, in WriteTarget
    assert install_path == self.output, f"{install_path} != {self.output}"
AssertionError: $(builddir)/snappy.a != $(obj).target/deps/snappy/snappy.a
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.<anonymous> (/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp/lib/configure.js:271:18)
gyp ERR! stack at ChildProcess.emit (node:events:514:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Darwin 21.6.0
gyp ERR! command "/Users/staltz/.nvm/versions/node/v18.17.1/bin/node" "/Users/staltz/oss/manyverse/manyverse/node_modules/nodejs-mobile-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/staltz/Library/Developer/Xcode/DerivedData/Manyverse-apuvsofckhifrpanlgiseiimvrgg/Build/Products/Debug-iphoneos/Manyverse.app/nodejs-project/node_modules/leveldown-nodejs-mobile
gyp ERR! node -v v18.17.1
gyp ERR! node-gyp -v v0.3.1
gyp ERR! not ok
npm info run leveldown-nodejs-mobile@5.4.1-3 install { code: 1, signal: null }
npm verb stack Error: command failed
npm verb stack     at ChildProcess.<anonymous> (/Users/staltz/.nvm/versions/node/v18.17.1/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27)
npm verb stack     at ChildProcess.emit (node:events:514:28)
npm verb stack     at maybeClose (node:internal/child_process:1091:16)
npm verb stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm verb pkgid leveldown-nodejs-mobile@5.4.1-3
npm verb cwd /Users/staltz/Library/Developer/Xcode/DerivedData/Manyverse-apuvsofckhifrpanlgiseiimvrgg/Build/Products/Debug-iphoneos/Manyverse.app/nodejs-project
npm verb Darwin 21.6.0
npm verb node v18.17.1
npm verb npm  v9.6.7
npm ERR! code 1
npm ERR! path /Users/staltz/Library/Developer/Xcode/DerivedData/Manyverse-apuvsofckhifrpanlgiseiimvrgg/Build/Products/Debug-iphoneos/Manyverse.app/nodejs-project/node_modules/leveldown-nodejs-mobile
npm ERR! command failed
npm ERR! command sh -c $PROJECT_DIR/../node_modules/.bin/node-gyp-build-mobile
npm verb exit 1
npm verb unfinished npm timer build 1702285561775
npm verb unfinished npm timer build:deps 1702285561776
npm verb unfinished npm timer build:run:install 1702285561804
npm verb unfinished npm timer build:run:install:node_modules/leveldown-nodejs-mobile 1702285564271
npm verb code 1

npm ERR! A complete log of this run can be found in: /Users/staltz/.npm/_logs/2023-12-11T09_06_00_772Z-debug-0.log
Command PhaseScriptExecution failed with a nonzero exit code

** BUILD FAILED **


The following build commands failed:
	PhaseScriptExecution [CP-User]\ [NODEJS\ MOBILE]\ Build\ Native\ Modules /Users/staltz/Library/Developer/Xcode/DerivedData/Manyverse-apuvsofckhifrpanlgiseiimvrgg/Build/Intermediates.noindex/Manyverse.build/Debug-iphoneos/Manyverse.build/Script-58FF749F1656993926E90E1F.sh (in target 'Manyverse' from project 'Manyverse')
(1 failure)

Regarding nodejs-mobile-react-native experience, WOW, I don't remember ever having such a pleasant experience with this beast 😄 You really did a number here. Great work!

Thank you! I have more plans for nodejs-mobile to improve the developer experience (e.g. regarding native addons).

@ManWithBear
Copy link

Hi @staltz 👋🏾🐻
I fixed issues with output path generation for iOS. Tested it out on an internal project, looks great.
Could you double check it please on manyverse project? (I was unable to compile the project even with the previous gyp version, errors in sources of pods)

@staltz
Copy link
Member

staltz commented Feb 6, 2024

Will do. For some reason I saw your message only now, that's why there was silence.

@staltz
Copy link
Member

staltz commented Feb 21, 2024

Confirmed it's working. Thanks for the patches and the patience!

@staltz staltz merged commit babfd3d into nodejs-mobile:mobile-master Feb 21, 2024
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

Successfully merging this pull request may close these issues.