Skip to content

Rebase on Node v18.10.0#7

Closed
gmaclennan wants to merge 27 commits into
upstream-node-v18.10.0from
nodejs-mobile-v18.10.0-patch.0
Closed

Rebase on Node v18.10.0#7
gmaclennan wants to merge 27 commits into
upstream-node-v18.10.0from
nodejs-mobile-v18.10.0-patch.0

Conversation

@gmaclennan

@gmaclennan gmaclennan commented Oct 17, 2022

Copy link
Copy Markdown

This is an attempt to rebase the changes to nodejs-mobile onto upstream Node v18.10.0. This is using the same approach as #3 by applying the diff upstream-node-v12.19.0...mobile-master onto v18.10.0 from upstream. I am going through each file one-by-one and manually resolving differences. Some patches apply cleanly, in other cases sometimes code has been removed, or changed order. Once the patch is applied we can see whether it compiles and then have a starting point for modifying the patches to work. I will keep the task list below updated as I go through each file.

Modified

  • README.md
  • android-configure
  • common.gypi
  • configure.py
  • deps/cares/cares.gyp
  • deps/cares/config/android/ares_config.h
  • deps/openssl/config/opensslconf.h
  • deps/openssl/openssl_no_asm.gypi
  • deps/uv/include/uv/android-ifaddrs.h
  • deps/uv/src/unix/android-ifaddrs.c
  • deps/uv/src/unix/darwin.c
  • deps/uv/src/unix/fs.c
  • deps/uv/src/unix/linux-core.c
  • deps/uv/uv.gyp
  • deps/uvwasi/src/uvwasi.c
  • deps/v8/src/base/platform/platform-posix.cc
  • doc/api/os.md
  • node.gyp
  • node.gypi
  • src/debug_utils.cc
  • src/node.cc
  • src/node_credentials.cc
  • src/node_env_var.cc
  • src/node_internals.h
  • src/node_metadata.cc
  • src/node_metadata.h
  • src/node_version.h
  • test/common/index.js
  • test/message/message.status
  • test/message/testcfg.py
  • test/parallel/parallel.status
  • test/parallel/test-assert-deep.js
  • test/parallel/test-assert.js
  • test/parallel/test-dgram-bind-fd.js
  • test/parallel/test-dgram-membership.js
  • test/parallel/test-dgram-socket-buffer-size.js
  • test/parallel/test-fs-copyfile.js
  • test/parallel/test-fs-lchmod.js
  • test/parallel/test-fs-mkdir.js
  • test/parallel/test-fs-open-flags.js
  • test/parallel/test-fs-promises.js
  • test/parallel/test-fs-read-file-sync-hostname.js
  • test/parallel/test-fs-readdir-stack-overflow.js
  • test/parallel/test-fs-readdir-ucs2.js
  • test/parallel/test-fs-realpath-native.js
  • test/parallel/test-fs-realpath.js
  • test/parallel/test-fs-rmdir-recursive.js
  • test/parallel/test-fs-stat.js
  • test/parallel/test-fs-watch.js
  • test/parallel/test-fs-watchfile.js
  • test/parallel/test-gc-http-client-onerror.js
  • test/parallel/test-http2-respond-file-error-dir.js
  • test/parallel/test-net-connect-options-fd.js
  • test/parallel/test-os.js
  • test/parallel/test-process-constants-noatime.js
  • test/parallel/test-process-versions.js
  • test/parallel/test-repl-options.js
  • test/parallel/test-signal-handler.js
  • test/parallel/test-util-types.js
  • test/parallel/test-v8-serdes.js
  • test/sequential/sequential.status
  • test/sequential/test-async-wrap-getasyncid.js
  • test/sequential/test-fs-watch.js
  • test/sequential/test-perf-hooks.js

Added

  • .github/ISSUE_TEMPLATE.md
  • FAQ.md
  • NodeMobile.podspec
  • doc_mobile/CHANGELOG.md
  • doc_mobile/CONTRIBUTING.md
  • doc_mobile/TESTING.md
  • src/node_mobile_version.h
  • tools/android_build.sh
  • tools/ios-framework/NodeMobile.xcodeproj/project.pbxproj
  • tools/ios-framework/NodeMobile.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  • tools/ios-framework/NodeMobile.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  • tools/ios-framework/NodeMobile.xcodeproj/project.xcworkspace/xcuserdata/jbernardo.xcuserdatad/UserInterfaceState.xcuserstate
  • tools/ios-framework/NodeMobile.xcodeproj/xcuserdata/jbernardo.xcuserdatad/xcschemes/xcschememanagement.plist
  • tools/ios-framework/NodeMobile/Info.plist
  • tools/ios-framework/NodeMobile/NodeMobile.cpp
  • tools/ios-framework/NodeMobile/NodeMobile.h
  • tools/ios_framework_prepare.sh
  • tools/mobile-test/android/node-android-proxy.sh
  • tools/mobile-test/android/prepare-android-test.sh
  • tools/mobile-test/android/testnode/.gitignore
  • tools/mobile-test/android/testnode/app/.gitignore
  • tools/mobile-test/android/testnode/app/CMakeLists.txt
  • tools/mobile-test/android/testnode/app/build.gradle
  • tools/mobile-test/android/testnode/app/proguard-rules.pro
  • tools/mobile-test/android/testnode/app/src/main/AndroidManifest.xml
  • tools/mobile-test/android/testnode/app/src/main/assets/main-test.js
  • tools/mobile-test/android/testnode/app/src/main/cpp/native-lib.cpp
  • tools/mobile-test/android/testnode/app/src/main/java/com/janeasystems/test/testnode/MainActivity.java
  • tools/mobile-test/android/testnode/app/src/main/res/layout/activity_main.xml
  • tools/mobile-test/android/testnode/app/src/main/res/mipmap-hdpi/ic_launcher.png
  • tools/mobile-test/android/testnode/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
  • tools/mobile-test/android/testnode/app/src/main/res/mipmap-mdpi/ic_launcher.png
  • tools/mobile-test/android/testnode/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
  • tools/mobile-test/android/testnode/app/src/main/res/mipmap-xhdpi/ic_launcher.png
  • tools/mobile-test/android/testnode/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  • tools/mobile-test/android/testnode/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  • tools/mobile-test/android/testnode/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
  • tools/mobile-test/android/testnode/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  • tools/mobile-test/android/testnode/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
  • tools/mobile-test/android/testnode/app/src/main/res/values/colors.xml
  • tools/mobile-test/android/testnode/app/src/main/res/values/strings.xml
  • tools/mobile-test/android/testnode/app/src/main/res/values/styles.xml
  • tools/mobile-test/android/testnode/build.gradle
  • tools/mobile-test/android/testnode/gradle.properties
  • tools/mobile-test/android/testnode/gradle/wrapper/gradle-wrapper.jar
  • tools/mobile-test/android/testnode/gradle/wrapper/gradle-wrapper.properties
  • tools/mobile-test/android/testnode/gradlew
  • tools/mobile-test/android/testnode/gradlew.bat
  • tools/mobile-test/android/testnode/settings.gradle
  • tools/mobile-test/ios/node-ios-proxy.sh
  • tools/mobile-test/ios/prepare-ios-tests.sh
  • tools/mobile-test/ios/testnode/testnode.xcodeproj/project.pbxproj
  • tools/mobile-test/ios/testnode/testnode/AppDelegate.h
  • tools/mobile-test/ios/testnode/testnode/AppDelegate.m
  • tools/mobile-test/ios/testnode/testnode/Assets.xcassets/AppIcon.appiconset/Contents.json
  • tools/mobile-test/ios/testnode/testnode/Base.lproj/LaunchScreen.storyboard
  • tools/mobile-test/ios/testnode/testnode/Base.lproj/Main.storyboard
  • tools/mobile-test/ios/testnode/testnode/Info.plist
  • tools/mobile-test/ios/testnode/testnode/NodeRunner.hpp
  • tools/mobile-test/ios/testnode/testnode/NodeRunner.mm
  • tools/mobile-test/ios/testnode/testnode/ViewController.h
  • tools/mobile-test/ios/testnode/testnode/ViewController.m
  • tools/mobile-test/ios/testnode/testnode/main.m

Deleted

  • .github/ISSUE_TEMPLATE/1-bug-report.md
  • .github/ISSUE_TEMPLATE/2-feature-request.md
  • .github/ISSUE_TEMPLATE/config.yml
  • .github/PULL_REQUEST_TEMPLATE.md
  • .github/SUPPORT.md
  • .github/workflows/build-windows.yml
  • .github/workflows/linters.yml
  • .github/workflows/misc.yml
  • .github/workflows/pythonpackage.yml
  • .github/workflows/remark-lint-problem-matcher.json
  • .github/workflows/test-linux.yml
  • .github/workflows/test-macos.yml

There was a patch to deps/v8/src/base/platform/platform-posix.cc that no
longer seems to apply — it added a iOS condition at line 203 https://github.com/nodejs-mobile/nodejs-mobile/blob/mobile-master/deps/v8/src/base/platform/platform-posix.cc#L203
However I can't see how this is needed now? Original commit: ef3a2ca
Fix for env variables being removed on Android
Fix for Posix on Android < SDK 21
Add version metadata for mobile
Add isIOS and isAndroid
Skip tests on iOS & Android
There are many more workflows in here than there were at 12.19.0
when this was last merged. Some of them may still be useful to put back
@staltz

staltz commented Oct 18, 2022

Copy link
Copy Markdown
Member

Hey @gmaclennan, great work, nice to see this moving forward.

I wanted to experiment whether squashing all commits into one was possible, so I started the branch tiny-history. Currently it has one commit which got everything from nodejs upstream initial commit up until the v12.19.0 tag. Next, I'll make another big commit that bundles all commits from v12.19.0 to v18.10.0. If that works, I can try putting jaime's commits on top of the v12.19.0 commit, and then try to merge the v18.10.0 branch into that.

@gmaclennan

Copy link
Copy Markdown
Author

Sounds good @staltz. I realized that v18.10.0 has re-written Android build support, but it's not fully working. Currently the problem I'm hitting is that the v8 build seems to be using system g++ rather than respecting the CXX environment variable.

@staltz

staltz commented Oct 18, 2022

Copy link
Copy Markdown
Member

@gmaclennan Indeed, nodejs/node@70898b4e67 + nodejs/node@c975c4f674

What if update nodejs-mobile to v16? I know you're trying to get ahead of the curve with v18, but one concern is that nodejs-mobile on v18 would drop support for Android 6.0 and require Android 7.0, which may hurt end users with low-end devices.

I believe that moving forwards, once we figure out a nice workflow to update nodejs upstream into this project, then within the next 12 months we can do the v16 => v18 update. For now, it would be good to just get things working with an active LTS.

@gmaclennan

Copy link
Copy Markdown
Author

Yes, that makes sense, especially if v16 can be easier. My thinking had been that since v18 becomes active LTS on Oct 25th, to maybe just leap straight there, but it might be harder. Regarding Android compatibility, that is important. nodejs-mobile currently works with API 21 (Android 5.0) and it would be good to maintain that. Some of Jaime's patches are to enable < API 23 support (e.g. https://github.com/nodejs-mobile/nodejs-mobile/blob/mobile-master/deps/uvwasi/src/uvwasi.c#L1319). Maybe we can keep API 21 compat via some patches.

Let me know how building goes with v16. I managed to merge the diff here — not too complicated but there were a couple of files where the patches were no longer necessary, or needed changed because of code changes. It's the build I'm having issues with, I think because of changes to the v8 build process (which shouldn't be an issue because v8 officially supports android, but it doesn't seem to be picking up the toolchain env)

@CaryTrivett

Copy link
Copy Markdown

nodejs/node@6c8c3d8

I see that nodejs supports iOS's PR, does it help with nodejs-mobile migration.

@staltz

staltz commented Nov 29, 2022

Copy link
Copy Markdown
Member

I was in the process of updating to v16.18.1 (see branch 16_18_1) but I realized that that version contains the android-configure rewrite which also bumped the minimum Android SDK.

So instead, the "conservative" version would be v16.17.1. I'll work on updating nodejs-mobile to 16.17.1 and I'll postpone the android-configure update headaches.

@staltz

staltz commented Jan 23, 2023

Copy link
Copy Markdown
Member

Closing this PR because #9 has been merged

@staltz staltz closed this Jan 23, 2023
@staltz staltz deleted the nodejs-mobile-v18.10.0-patch.0 branch January 23, 2023 15:38
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.

3 participants