From 2b3bdb1097378a1db02cb3d6916c2c893175f5a7 Mon Sep 17 00:00:00 2001 From: moluopro Date: Fri, 1 May 2026 20:15:14 +0800 Subject: [PATCH 01/15] build: support Android cross-compiling Signed-off-by: moluopro --- android-configure | 12 ++++------ android_configure.py | 32 +++++++++++++++++++++++--- deps/uv/uv.gyp | 25 ++++++++++++++++++++ deps/zlib/zlib.gyp | 23 +++++++++++++++++++ tools/gyp/pylib/gyp/generator/make.py | 8 +++++-- tools/v8_gypfiles/abseil.gyp | 7 ++++++ tools/v8_gypfiles/v8.gyp | 33 ++++++++++----------------- 7 files changed, 107 insertions(+), 33 deletions(-) diff --git a/android-configure b/android-configure index b2628f95e8e4f4..d79f9a18012fc2 100755 --- a/android-configure +++ b/android-configure @@ -4,13 +4,11 @@ # Note that the mix of single and double quotes is intentional, # as is the fact that the ] goes on a new line. _=[ 'exec' '/bin/sh' '-c' ''' -command -v python3.14 >/dev/null && exec python3.14 "$0" "$@" -command -v python3.13 >/dev/null && exec python3.13 "$0" "$@" -command -v python3.12 >/dev/null && exec python3.12 "$0" "$@" -command -v python3.11 >/dev/null && exec python3.11 "$0" "$@" -command -v python3.10 >/dev/null && exec python3.10 "$0" "$@" -command -v python3 >/dev/null && exec python3 "$0" "$@" -exec python "$0" "$@" +for python in python3.14 python3.13 python3.12 python3.11 python3.10 python3 python; do + command -v "$python" >/dev/null 2>&1 && exec "$python" "$0" "$@" +done +echo "No Python interpreter found." >&2 +exit 1 ''' "$0" "$@" ] del _ diff --git a/android_configure.py b/android_configure.py index 5cea0393f48a76..a4506779f26373 100644 --- a/android_configure.py +++ b/android_configure.py @@ -1,3 +1,4 @@ +import subprocess import platform import sys import os @@ -7,7 +8,12 @@ def patch_android(): print("- Patches List -") print("[1] [deps/v8/src/trap-handler/trap-handler.h] related to https://github.com/nodejs/node/issues/36287") if platform.system() == "Linux": - os.system('patch -f ./deps/v8/src/trap-handler/trap-handler.h < ./android-patches/trap-handler.h.patch') + with open("./android-patches/trap-handler.h.patch", "rb") as patch_file: + subprocess.run( + ["patch", "-f", "./deps/v8/src/trap-handler/trap-handler.h"], + stdin=patch_file, + check=True, + ) print("\033[92mInfo: \033[0m" + "Tried to patch.") if platform.system() != "Linux" and platform.system() != "Darwin": @@ -55,7 +61,7 @@ def patch_android(): print("\033[92mInfo: \033[0m" + "Configuring for " + DEST_CPU + "...") if platform.system() == "Darwin": - host_os = "darwin" + host_os = "mac" toolchain_path = android_ndk_path + "/toolchains/llvm/prebuilt/darwin-x86_64" elif platform.system() == "Linux": @@ -65,6 +71,18 @@ def patch_android(): os.environ['PATH'] += os.pathsep + toolchain_path + "/bin" os.environ['CC'] = toolchain_path + "/bin/" + TOOLCHAIN_PREFIX + android_sdk_version + "-" + "clang" os.environ['CXX'] = toolchain_path + "/bin/" + TOOLCHAIN_PREFIX + android_sdk_version + "-" + "clang++" +os.environ.setdefault('CC_target', os.environ['CC']) +os.environ.setdefault('CXX_target', os.environ['CXX']) +os.environ.setdefault('CC_host', 'cc') +os.environ.setdefault('CXX_host', 'c++') + +# macOS /usr/bin/ar cannot consume the @file-list syntax emitted by GYP for +# large archives. llvm-ar can archive both host Mach-O objects and Android +# target objects. +llvm_ar = toolchain_path + "/bin/llvm-ar" +os.environ.setdefault('AR', llvm_ar) +os.environ.setdefault('AR_host', llvm_ar) +os.environ.setdefault('AR_target', llvm_ar) GYP_DEFINES = "target_arch=" + arch GYP_DEFINES += " v8_target_arch=" + arch @@ -74,4 +92,12 @@ def patch_android(): os.environ['GYP_DEFINES'] = GYP_DEFINES if os.path.exists("./configure"): - os.system("./configure --dest-cpu=" + DEST_CPU + " --dest-os=android --openssl-no-asm --cross-compiling") + subprocess.run([ + "./configure", + "--dest-cpu=" + DEST_CPU, + "--dest-os=android", + "--openssl-no-asm", + "--cross-compiling", + "--enable-static", + "--v8-disable-temporal-support", + ], check=True) diff --git a/deps/uv/uv.gyp b/deps/uv/uv.gyp index 540445f1f3249b..dc6465203b84d0 100644 --- a/deps/uv/uv.gyp +++ b/deps/uv/uv.gyp @@ -406,6 +406,31 @@ 'src/unix/os390-syscalls.c' ] }], + ], + 'target_conditions': [ + [ '_toolset=="host" and host_os=="mac" and OS=="android"', { + 'defines': [ + '_DARWIN_USE_64_BIT_INODE=1', + '_DARWIN_UNLIMITED_SELECT=1', + ], + 'sources': [ + '<@(uv_sources_apple)', + '<@(uv_sources_bsd_common)', + 'src/unix/proctitle.c', + ], + 'sources!': [ + '<@(uv_sources_android)', + '<@(uv_sources_linux)', + ], + }], + [ '_toolset=="host" and host_os=="linux" and OS=="android"', { + 'sources': [ + '<@(uv_sources_linux)', + ], + 'sources!': [ + '<@(uv_sources_android)', + ], + }], ] }, ] diff --git a/deps/zlib/zlib.gyp b/deps/zlib/zlib.gyp index 12449e7b0294c9..b49e0bc247d5b2 100644 --- a/deps/zlib/zlib.gyp +++ b/deps/zlib/zlib.gyp @@ -201,6 +201,29 @@ 'USE_FILE32API' ], }], + ['OS=="android"', { + 'actions': [ + { + 'action_name': 'copy_android_cpufeatures', + 'inputs': [ + '<(android_ndk_path)/sources/android/cpufeatures/cpu-features.c', + ], + 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/android_cpufeatures.c', + ], + 'action': [ + '<(python)', + '-c', + 'import os, shutil, sys; os.makedirs(os.path.dirname(sys.argv[2]), exist_ok=True); shutil.copyfile(sys.argv[1], sys.argv[2])', + '<@(_inputs)', + '<@(_outputs)', + ], + }, + ], + 'sources': [ + '<(SHARED_INTERMEDIATE_DIR)/android_cpufeatures.c', + ], + }], # Incorporate optimizations where possible. ['(target_arch in "ia32 x64" and OS!="ios") or arm_fpu=="neon"', { 'dependencies': [ 'zlib_data_chunk_simd' ], diff --git a/tools/gyp/pylib/gyp/generator/make.py b/tools/gyp/pylib/gyp/generator/make.py index 16b6f4e80b119a..fe9cfbc440e6f8 100644 --- a/tools/gyp/pylib/gyp/generator/make.py +++ b/tools/gyp/pylib/gyp/generator/make.py @@ -249,7 +249,11 @@ def CalculateGeneratorInputInfo(params): define create_thin_archive rm -f $(1) $(OBJ_FILE_LIST); mkdir -p `dirname $(1)` $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) - $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST) + if [ "$(TOOLSET)" = "host" ] && [ "$$(uname -s)" = "Darwin" ]; then \ + $(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST); \ + else \ + $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST); \ + fi endef # Due to circular dependencies between libraries :(, we wrap the @@ -258,7 +262,7 @@ def CalculateGeneratorInputInfo(params): quiet_cmd_link = LINK($(TOOLSET)) $@ quiet_cmd_link_host = LINK($(TOOLSET)) $@ cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS) -cmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS) +cmd_link_host = if [ "$$(uname -s)" = "Darwin" ]; then $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS); else $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS); fi # Other shared-object link notes: # - Set SONAME to the library filename so our binaries don't reference diff --git a/tools/v8_gypfiles/abseil.gyp b/tools/v8_gypfiles/abseil.gyp index fdc2fae1ab4d75..d091f1d1648b8c 100644 --- a/tools/v8_gypfiles/abseil.gyp +++ b/tools/v8_gypfiles/abseil.gyp @@ -15,6 +15,13 @@ 'xcode_settings': { 'OTHER_LDFLAGS': ['-framework CoreFoundation'], }, + 'conditions': [ + [ '_toolset=="host" and host_os=="mac" and OS=="android"', { + 'libraries': [ + '-framework CoreFoundation', + ], + }], + ], }, 'include_dirs': [ '<(ABSEIL_ROOT)', diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index 945aa0aa501df1..4ee7d824ba2d70 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -1191,7 +1191,7 @@ 'conditions': [ ['v8_enable_webassembly==1', { 'conditions': [ - ['((_toolset=="host" and host_arch=="arm64" or _toolset=="target" and target_arch=="arm64") and (OS in "linux mac ios openharmony")) or ((_toolset=="host" and host_arch=="x64" or _toolset=="target" and target_arch=="x64") and (OS in "linux mac openharmony"))', { + ['((_toolset=="host" and host_arch=="arm64" or _toolset=="target" and target_arch=="arm64") and (OS in "linux mac ios openharmony")) or ((_toolset=="host" and host_arch=="x64" or _toolset=="target" and target_arch=="x64") and (OS in "linux mac openharmony")) or (_toolset=="host" and OS=="android" and host_arch=="arm64" and host_os in "linux mac ios openharmony") or (_toolset=="host" and OS=="android" and host_arch=="x64" and host_os in "linux mac openharmony")', { 'sources': [ '<(V8_ROOT)/src/trap-handler/handler-inside-posix.cc', '<(V8_ROOT)/src/trap-handler/handler-outside-posix.cc', @@ -1478,35 +1478,26 @@ }], ], }], - ['is_android', { + ['is_android and _toolset=="target"', { 'sources': [ '<(V8_ROOT)/src/base/platform/platform-posix.cc', '<(V8_ROOT)/src/base/platform/platform-posix.h', '<(V8_ROOT)/src/base/platform/platform-posix-time.cc', '<(V8_ROOT)/src/base/platform/platform-posix-time.h', + '<(V8_ROOT)/src/base/debug/stack_trace_android.cc', + '<(V8_ROOT)/src/base/platform/platform-linux.cc', + ], + }], + ['is_android and _toolset=="host" and host_os=="linux"', { + 'sources': [ + '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc', + '<(V8_ROOT)/src/base/platform/platform-linux.cc', ], 'link_settings': { - 'target_conditions': [ - ['_toolset=="host" and host_os=="linux"', { - 'libraries': [ - '-ldl' - ], - }], + 'libraries': [ + '-ldl' ], }, - 'target_conditions': [ - ['_toolset=="host"', { - 'sources': [ - '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc', - '<(V8_ROOT)/src/base/platform/platform-linux.cc', - ], - }, { - 'sources': [ - '<(V8_ROOT)/src/base/debug/stack_trace_android.cc', - '<(V8_ROOT)/src/base/platform/platform-linux.cc', - ], - }], - ], }], ['is_fuchsia', { 'sources': [ From 5b37f60465780dc482c2fcee656d2ff19410768b Mon Sep 17 00:00:00 2001 From: moluopro Date: Fri, 1 May 2026 20:15:37 +0800 Subject: [PATCH 02/15] test: add Android build workflow Signed-off-by: moluopro --- .github/workflows/test-android.yml | 112 +++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 .github/workflows/test-android.yml diff --git a/.github/workflows/test-android.yml b/.github/workflows/test-android.yml new file mode 100644 index 00000000000000..ccef4384a86739 --- /dev/null +++ b/.github/workflows/test-android.yml @@ -0,0 +1,112 @@ +name: Test Android + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + paths-ignore: + - '**.md' + - '**.nix' + - eslint.config.mjs + - '**/eslint.config_partial.mjs' + - benchmarks/** + - codecov.yml + - doc/** + - pyproject.yml + - tsconfig.json + - test/internet/** + - tools/actions/** + - tools/dep_updaters/** + - tools/doc/** + - tools/eslint-rules/** + - tools/eslint/** + - tools/lint-md/** + - typings/** + - vcbuild.bat + - .** + - '!.github/workflows/test-android.yml' + push: + branches: + - main + - canary + - v[0-9]+.x-staging + - v[0-9]+.x + paths-ignore: + - '**.md' + - '**.nix' + - eslint.config.mjs + - '**/eslint.config_partial.mjs' + - benchmarks/** + - codecov.yml + - doc/** + - pyproject.yml + - tsconfig.json + - test/internet/** + - tools/actions/** + - tools/dep_updaters/** + - tools/doc/** + - tools/eslint-rules/** + - tools/eslint/** + - tools/lint-md/** + - typings/** + - vcbuild.bat + - .** + - '!.github/workflows/test-android.yml' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +env: + ANDROID_API_LEVEL: '29' + ANDROID_NDK_VERSION: '27.2.12479018' + PYTHON_VERSION: '3.14' + +permissions: + contents: read + +jobs: + build-android: + if: github.event.pull_request.draft == false + strategy: + fail-fast: false + matrix: + arch: + - arm + - arm64 + - x86 + - x86_64 + name: Android ${{ matrix.arch }} + runs-on: macos-26 + steps: + - uses: actions/checkout@v6 + with: + persist-credentials: false + path: node + - name: Set up Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@v6 + with: + python-version: ${{ env.PYTHON_VERSION }} + allow-prereleases: true + - name: Install Android NDK ${{ env.ANDROID_NDK_VERSION }} + run: | + ANDROID_SDK_ROOT="${ANDROID_HOME:-${ANDROID_SDK_ROOT:-$HOME/Library/Android/sdk}}" + export ANDROID_HOME="$ANDROID_SDK_ROOT" + export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$PATH" + echo "ANDROID_HOME=$ANDROID_HOME" >> "$GITHUB_ENV" + + yes | sdkmanager --licenses >/dev/null || true + sdkmanager --install \ + "platforms;android-${ANDROID_API_LEVEL}" \ + "ndk;${ANDROID_NDK_VERSION}" + echo "ANDROID_NDK_HOME=${ANDROID_HOME}/ndk/${ANDROID_NDK_VERSION}" >> "$GITHUB_ENV" + - name: Environment Information + run: npx envinfo + - name: Configure Android ${{ matrix.arch }} + run: ./android-configure "$ANDROID_NDK_HOME" "$ANDROID_API_LEVEL" "${{ matrix.arch }}" + working-directory: node + - name: Build Android ${{ matrix.arch }} + run: make -j + working-directory: node + - name: Verify Android binary + run: file out/Release/node + working-directory: node From 2dd712cb5b2ddd4284715fe86f398154c5ef2353 Mon Sep 17 00:00:00 2001 From: moluopro Date: Fri, 1 May 2026 20:16:03 +0800 Subject: [PATCH 03/15] doc: update Android build notes Signed-off-by: moluopro --- BUILDING.md | 126 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 74 insertions(+), 52 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 2cb15c812acf3b..0cbf2e12e370fb 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -10,58 +10,63 @@ file a new issue. ## Table of contents -* [Supported platforms](#supported-platforms) - * [Input](#input) - * [Strategy](#strategy) - * [Platform list](#platform-list) - * [Supported toolchains](#supported-toolchains) - * [Official binary platforms and toolchains](#official-binary-platforms-and-toolchains) - * [OpenSSL asm support](#openssl-asm-support) - * [Previous versions of this document](#previous-versions-of-this-document) -* [Building Node.js on supported platforms](#building-nodejs-on-supported-platforms) - * [Prerequisites](#prerequisites) - * [Unix and macOS](#unix-and-macos) - * [Unix prerequisites](#unix-prerequisites) - * [macOS prerequisites](#macos-prerequisites) - * [Building Node.js](#building-nodejs-1) - * [Installing Node.js](#installing-nodejs) - * [Running Tests](#running-tests) - * [Running Coverage](#running-coverage) - * [Building the documentation](#building-the-documentation) - * [Building a debug build](#building-a-debug-build) - * [Building an ASan build](#building-an-asan-build) - * [Speeding up frequent rebuilds when developing](#speeding-up-frequent-rebuilds-when-developing) - * [ccache](#ccache) - * [Loading JS files from disk instead of embedding](#loading-js-files-from-disk-instead-of-embedding) - * [Troubleshooting Unix and macOS builds](#troubleshooting-unix-and-macos-builds) - * [Windows](#windows) - * [Windows Prerequisites](#windows-prerequisites) - * [Option 1: Manual install](#option-1-manual-install) - * [Option 2: Automated install with WinGet](#option-2-automated-install-with-winget) - * [Building Node.js](#building-nodejs-2) - * [Using ccache](#using-ccache) - * [Android](#android) -* [`Intl` (ECMA-402) support](#intl-ecma-402-support) - * [Build with full ICU support (all locales supported by ICU)](#build-with-full-icu-support-all-locales-supported-by-icu) - * [Unix/macOS](#unixmacos) - * [Windows](#windows-1) - * [Trimmed: `small-icu` (English only) support](#trimmed-small-icu-english-only-support) - * [Unix/macOS](#unixmacos-1) - * [Windows](#windows-2) - * [Building without Intl support](#building-without-intl-support) - * [Unix/macOS](#unixmacos-2) - * [Windows](#windows-3) - * [Use existing installed ICU (Unix/macOS only)](#use-existing-installed-icu-unixmacos-only) - * [Build with a specific ICU](#build-with-a-specific-icu) - * [Unix/macOS](#unixmacos-3) - * [Windows](#windows-4) -* [Configuring OpenSSL config appname](#configure-openssl-appname) -* [Building Node.js with FIPS-compliant OpenSSL](#building-nodejs-with-fips-compliant-openssl) -* [Building Node.js with Temporal support](#building-nodejs-with-temporal-support) -* [Building Node.js with external core modules](#building-nodejs-with-external-core-modules) - * [Unix/macOS](#unixmacos-4) - * [Windows](#windows-5) -* [Note for downstream distributors of Node.js](#note-for-downstream-distributors-of-nodejs) +- [Building Node.js](#building-nodejs) + - [Table of contents](#table-of-contents) + - [Supported platforms](#supported-platforms) + - [Input](#input) + - [Strategy](#strategy) + - [Platform list](#platform-list) + - [Supported toolchains](#supported-toolchains) + - [Official binary platforms and toolchains](#official-binary-platforms-and-toolchains) + - [OpenSSL asm support](#openssl-asm-support) + - [Previous versions of this document](#previous-versions-of-this-document) + - [Building Node.js on supported platforms](#building-nodejs-on-supported-platforms) + - [Prerequisites](#prerequisites) + - [Unix and macOS](#unix-and-macos) + - [Unix prerequisites](#unix-prerequisites) + - [macOS prerequisites](#macos-prerequisites) + - [Nix integration](#nix-integration) + - [Building Node.js](#building-nodejs-1) + - [Installing Node.js](#installing-nodejs) + - [Running tests](#running-tests) + - [Running coverage](#running-coverage) + - [Building the documentation](#building-the-documentation) + - [Building a debug build](#building-a-debug-build) + - [Building an ASan build](#building-an-asan-build) + - [Speeding up frequent rebuilds when developing](#speeding-up-frequent-rebuilds-when-developing) + - [ccache](#ccache) + - [Loading JS files from disk instead of embedding](#loading-js-files-from-disk-instead-of-embedding) + - [Troubleshooting Unix and macOS builds](#troubleshooting-unix-and-macos-builds) + - [Windows](#windows) + - [Tips](#tips) + - [Windows Prerequisites](#windows-prerequisites) + - [Option 1: Manual install](#option-1-manual-install) + - [Option 2: Automated install with WinGet](#option-2-automated-install-with-winget) + - [Building Node.js](#building-nodejs-2) + - [Using ccache:](#using-ccache) + - [Android](#android) + - [`Intl` (ECMA-402) support](#intl-ecma-402-support) + - [Build with full ICU support (all locales supported by ICU)](#build-with-full-icu-support-all-locales-supported-by-icu) + - [Unix/macOS](#unixmacos) + - [Windows](#windows-1) + - [Trimmed: `small-icu` (English only) support](#trimmed-small-icu-english-only-support) + - [Unix/macOS](#unixmacos-1) + - [Windows](#windows-2) + - [Building without Intl support](#building-without-intl-support) + - [Unix/macOS](#unixmacos-2) + - [Windows](#windows-3) + - [Use existing installed ICU (Unix/macOS only)](#use-existing-installed-icu-unixmacos-only) + - [Build with a specific ICU](#build-with-a-specific-icu) + - [Unix/macOS](#unixmacos-3) + - [Windows](#windows-4) + - [Configure OpenSSL appname](#configure-openssl-appname) + - [Building Node.js with FIPS-compliant OpenSSL](#building-nodejs-with-fips-compliant-openssl) + - [Building Node.js with Temporal support](#building-nodejs-with-temporal-support) + - [Building Node.js with external core modules](#building-nodejs-with-external-core-modules) + - [Unix/macOS](#unixmacos-4) + - [Windows](#windows-5) + - [Building to use shared dependencies at runtime](#building-to-use-shared-dependencies-at-runtime) + - [Note for downstream distributors of Node.js](#note-for-downstream-distributors-of-nodejs) ## Supported platforms @@ -914,6 +919,23 @@ make -j4 The Android SDK version should be at least 24 (Android 7.0) and the target architecture supports \[arm, arm64/aarch64, x86, x86\_64]. +The static Node.js archive is generated at `out/Release/obj.target/libnode.a`. +This archive is a thin archive by default. It references object files in the +build directory and may still require the other static dependency archives under +`out/Release/obj.target/` when embedding Node.js elsewhere. To produce one +standalone archive for distribution, merge the target static archives with the +NDK `llvm-ar`. + +To reduce the Android build size, disable optional features in the `./configure` +call made by `android_configure.py`. Common options include: + +```bash +--without-ssl +--without-node-snapshot +--without-intl +--without-inspector +``` + ## `Intl` (ECMA-402) support [Intl](doc/api/intl.md) support is From 5e31d44d0f196e16f4b412770ad3203803d72a76 Mon Sep 17 00:00:00 2001 From: moluopro Date: Fri, 1 May 2026 20:26:15 +0800 Subject: [PATCH 04/15] test: limit Android workflow to arm64 Signed-off-by: moluopro --- .github/workflows/test-android.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test-android.yml b/.github/workflows/test-android.yml index ccef4384a86739..f9225a5dfafc3d 100644 --- a/.github/workflows/test-android.yml +++ b/.github/workflows/test-android.yml @@ -71,10 +71,7 @@ jobs: fail-fast: false matrix: arch: - - arm - arm64 - - x86 - - x86_64 name: Android ${{ matrix.arch }} runs-on: macos-26 steps: From ca8a0f7cc05ad87ebe457243fdc52ab4ab00db5b Mon Sep 17 00:00:00 2001 From: moluopro Date: Fri, 1 May 2026 20:27:29 +0800 Subject: [PATCH 05/15] test: remove Android workflow matrix Signed-off-by: moluopro --- .github/workflows/test-android.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-android.yml b/.github/workflows/test-android.yml index f9225a5dfafc3d..00fae27059f44f 100644 --- a/.github/workflows/test-android.yml +++ b/.github/workflows/test-android.yml @@ -67,12 +67,7 @@ permissions: jobs: build-android: if: github.event.pull_request.draft == false - strategy: - fail-fast: false - matrix: - arch: - - arm64 - name: Android ${{ matrix.arch }} + name: Android arm64 runs-on: macos-26 steps: - uses: actions/checkout@v6 @@ -98,10 +93,10 @@ jobs: echo "ANDROID_NDK_HOME=${ANDROID_HOME}/ndk/${ANDROID_NDK_VERSION}" >> "$GITHUB_ENV" - name: Environment Information run: npx envinfo - - name: Configure Android ${{ matrix.arch }} - run: ./android-configure "$ANDROID_NDK_HOME" "$ANDROID_API_LEVEL" "${{ matrix.arch }}" + - name: Configure Android arm64 + run: ./android-configure "$ANDROID_NDK_HOME" "$ANDROID_API_LEVEL" arm64 working-directory: node - - name: Build Android ${{ matrix.arch }} + - name: Build Android arm64 run: make -j working-directory: node - name: Verify Android binary From a4673674c66de44b44ef02d7e10b97b1eded71d6 Mon Sep 17 00:00:00 2001 From: moluopro Date: Fri, 1 May 2026 20:47:58 +0800 Subject: [PATCH 06/15] test: simplify Android workflow steps Signed-off-by: moluopro --- .github/workflows/test-android.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-android.yml b/.github/workflows/test-android.yml index 00fae27059f44f..61cd21b422e7fe 100644 --- a/.github/workflows/test-android.yml +++ b/.github/workflows/test-android.yml @@ -67,7 +67,7 @@ permissions: jobs: build-android: if: github.event.pull_request.draft == false - name: Android arm64 + name: Build Android runs-on: macos-26 steps: - uses: actions/checkout@v6 @@ -91,14 +91,12 @@ jobs: "platforms;android-${ANDROID_API_LEVEL}" \ "ndk;${ANDROID_NDK_VERSION}" echo "ANDROID_NDK_HOME=${ANDROID_HOME}/ndk/${ANDROID_NDK_VERSION}" >> "$GITHUB_ENV" - - name: Environment Information - run: npx envinfo - - name: Configure Android arm64 + - name: Configure run: ./android-configure "$ANDROID_NDK_HOME" "$ANDROID_API_LEVEL" arm64 working-directory: node - - name: Build Android arm64 + - name: Build run: make -j working-directory: node - - name: Verify Android binary + - name: Verify run: file out/Release/node working-directory: node From 8b66e69f1fb0cf521769091f418e44499e68fc67 Mon Sep 17 00:00:00 2001 From: moluopro Date: Fri, 1 May 2026 20:58:52 +0800 Subject: [PATCH 07/15] test: name Android workflow setup steps Signed-off-by: moluopro --- .github/workflows/test-android.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-android.yml b/.github/workflows/test-android.yml index 61cd21b422e7fe..1dcc2b78e302b5 100644 --- a/.github/workflows/test-android.yml +++ b/.github/workflows/test-android.yml @@ -70,16 +70,17 @@ jobs: name: Build Android runs-on: macos-26 steps: - - uses: actions/checkout@v6 + - name: Checkout + uses: actions/checkout@v6 with: persist-credentials: false path: node - - name: Set up Python ${{ env.PYTHON_VERSION }} + - name: Setup Python uses: actions/setup-python@v6 with: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true - - name: Install Android NDK ${{ env.ANDROID_NDK_VERSION }} + - name: Install NDK run: | ANDROID_SDK_ROOT="${ANDROID_HOME:-${ANDROID_SDK_ROOT:-$HOME/Library/Android/sdk}}" export ANDROID_HOME="$ANDROID_SDK_ROOT" From 71923c063760508559b02df86d53cc36e1bc3ac8 Mon Sep 17 00:00:00 2001 From: moluopro Date: Fri, 1 May 2026 21:03:34 +0800 Subject: [PATCH 08/15] test: limit Android workflow build parallelism Signed-off-by: moluopro --- .github/workflows/test-android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-android.yml b/.github/workflows/test-android.yml index 1dcc2b78e302b5..f860c3d0d0af99 100644 --- a/.github/workflows/test-android.yml +++ b/.github/workflows/test-android.yml @@ -96,7 +96,7 @@ jobs: run: ./android-configure "$ANDROID_NDK_HOME" "$ANDROID_API_LEVEL" arm64 working-directory: node - name: Build - run: make -j + run: make -j$(getconf _NPROCESSORS_ONLN) working-directory: node - name: Verify run: file out/Release/node From e6720b428b4eabdcf40e80656baf0893b2a6a8c5 Mon Sep 17 00:00:00 2001 From: moluopro Date: Fri, 1 May 2026 21:15:09 +0800 Subject: [PATCH 09/15] test: pin Android workflow actions Signed-off-by: moluopro --- .github/workflows/test-android.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-android.yml b/.github/workflows/test-android.yml index f860c3d0d0af99..e8f0114521fdc1 100644 --- a/.github/workflows/test-android.yml +++ b/.github/workflows/test-android.yml @@ -71,12 +71,12 @@ jobs: runs-on: macos-26 steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false path: node - name: Setup Python - uses: actions/setup-python@v6 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true From cfb5f5fe3bdd31be7e58ee4e55df0d4a167c728e Mon Sep 17 00:00:00 2001 From: moluopro Date: Fri, 1 May 2026 21:31:15 +0800 Subject: [PATCH 10/15] test: fix Android workflow YAML lint Signed-off-by: moluopro --- .github/workflows/test-android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-android.yml b/.github/workflows/test-android.yml index e8f0114521fdc1..23e984f4ab4daf 100644 --- a/.github/workflows/test-android.yml +++ b/.github/workflows/test-android.yml @@ -58,7 +58,7 @@ concurrency: env: ANDROID_API_LEVEL: '29' - ANDROID_NDK_VERSION: '27.2.12479018' + ANDROID_NDK_VERSION: 27.2.12479018 PYTHON_VERSION: '3.14' permissions: From e9b39848ff643a9d6e0687e972846854aace34e9 Mon Sep 17 00:00:00 2001 From: moluopro Date: Fri, 1 May 2026 21:35:08 +0800 Subject: [PATCH 11/15] test: update Android workflow NDK Signed-off-by: moluopro --- .github/workflows/test-android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-android.yml b/.github/workflows/test-android.yml index 23e984f4ab4daf..8ba4f3cb3a4ab5 100644 --- a/.github/workflows/test-android.yml +++ b/.github/workflows/test-android.yml @@ -58,7 +58,7 @@ concurrency: env: ANDROID_API_LEVEL: '29' - ANDROID_NDK_VERSION: 27.2.12479018 + ANDROID_NDK_VERSION: 29.0.14206865 PYTHON_VERSION: '3.14' permissions: From 912e34662bfd2d71c70f57910963cd1321641fe7 Mon Sep 17 00:00:00 2001 From: moluopro Date: Fri, 1 May 2026 21:46:15 +0800 Subject: [PATCH 12/15] doc: fix BUILDING.md formatting Signed-off-by: moluopro --- BUILDING.md | 114 ++++++++++++++++++++++++++-------------------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 0cbf2e12e370fb..6cdfec59aac820 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -10,63 +10,63 @@ file a new issue. ## Table of contents -- [Building Node.js](#building-nodejs) - - [Table of contents](#table-of-contents) - - [Supported platforms](#supported-platforms) - - [Input](#input) - - [Strategy](#strategy) - - [Platform list](#platform-list) - - [Supported toolchains](#supported-toolchains) - - [Official binary platforms and toolchains](#official-binary-platforms-and-toolchains) - - [OpenSSL asm support](#openssl-asm-support) - - [Previous versions of this document](#previous-versions-of-this-document) - - [Building Node.js on supported platforms](#building-nodejs-on-supported-platforms) - - [Prerequisites](#prerequisites) - - [Unix and macOS](#unix-and-macos) - - [Unix prerequisites](#unix-prerequisites) - - [macOS prerequisites](#macos-prerequisites) - - [Nix integration](#nix-integration) - - [Building Node.js](#building-nodejs-1) - - [Installing Node.js](#installing-nodejs) - - [Running tests](#running-tests) - - [Running coverage](#running-coverage) - - [Building the documentation](#building-the-documentation) - - [Building a debug build](#building-a-debug-build) - - [Building an ASan build](#building-an-asan-build) - - [Speeding up frequent rebuilds when developing](#speeding-up-frequent-rebuilds-when-developing) - - [ccache](#ccache) - - [Loading JS files from disk instead of embedding](#loading-js-files-from-disk-instead-of-embedding) - - [Troubleshooting Unix and macOS builds](#troubleshooting-unix-and-macos-builds) - - [Windows](#windows) - - [Tips](#tips) - - [Windows Prerequisites](#windows-prerequisites) - - [Option 1: Manual install](#option-1-manual-install) - - [Option 2: Automated install with WinGet](#option-2-automated-install-with-winget) - - [Building Node.js](#building-nodejs-2) - - [Using ccache:](#using-ccache) - - [Android](#android) - - [`Intl` (ECMA-402) support](#intl-ecma-402-support) - - [Build with full ICU support (all locales supported by ICU)](#build-with-full-icu-support-all-locales-supported-by-icu) - - [Unix/macOS](#unixmacos) - - [Windows](#windows-1) - - [Trimmed: `small-icu` (English only) support](#trimmed-small-icu-english-only-support) - - [Unix/macOS](#unixmacos-1) - - [Windows](#windows-2) - - [Building without Intl support](#building-without-intl-support) - - [Unix/macOS](#unixmacos-2) - - [Windows](#windows-3) - - [Use existing installed ICU (Unix/macOS only)](#use-existing-installed-icu-unixmacos-only) - - [Build with a specific ICU](#build-with-a-specific-icu) - - [Unix/macOS](#unixmacos-3) - - [Windows](#windows-4) - - [Configure OpenSSL appname](#configure-openssl-appname) - - [Building Node.js with FIPS-compliant OpenSSL](#building-nodejs-with-fips-compliant-openssl) - - [Building Node.js with Temporal support](#building-nodejs-with-temporal-support) - - [Building Node.js with external core modules](#building-nodejs-with-external-core-modules) - - [Unix/macOS](#unixmacos-4) - - [Windows](#windows-5) - - [Building to use shared dependencies at runtime](#building-to-use-shared-dependencies-at-runtime) - - [Note for downstream distributors of Node.js](#note-for-downstream-distributors-of-nodejs) +* [Building Node.js](#building-nodejs) + * [Table of contents](#table-of-contents) + * [Supported platforms](#supported-platforms) + * [Input](#input) + * [Strategy](#strategy) + * [Platform list](#platform-list) + * [Supported toolchains](#supported-toolchains) + * [Official binary platforms and toolchains](#official-binary-platforms-and-toolchains) + * [OpenSSL asm support](#openssl-asm-support) + * [Previous versions of this document](#previous-versions-of-this-document) + * [Building Node.js on supported platforms](#building-nodejs-on-supported-platforms) + * [Prerequisites](#prerequisites) + * [Unix and macOS](#unix-and-macos) + * [Unix prerequisites](#unix-prerequisites) + * [macOS prerequisites](#macos-prerequisites) + * [Nix integration](#nix-integration) + * [Building Node.js](#building-nodejs-1) + * [Installing Node.js](#installing-nodejs) + * [Running tests](#running-tests) + * [Running coverage](#running-coverage) + * [Building the documentation](#building-the-documentation) + * [Building a debug build](#building-a-debug-build) + * [Building an ASan build](#building-an-asan-build) + * [Speeding up frequent rebuilds when developing](#speeding-up-frequent-rebuilds-when-developing) + * [ccache](#ccache) + * [Loading JS files from disk instead of embedding](#loading-js-files-from-disk-instead-of-embedding) + * [Troubleshooting Unix and macOS builds](#troubleshooting-unix-and-macos-builds) + * [Windows](#windows) + * [Tips](#tips) + * [Windows Prerequisites](#windows-prerequisites) + * [Option 1: Manual install](#option-1-manual-install) + * [Option 2: Automated install with WinGet](#option-2-automated-install-with-winget) + * [Building Node.js](#building-nodejs-2) + * [Using ccache:](#using-ccache) + * [Android](#android) + * [`Intl` (ECMA-402) support](#intl-ecma-402-support) + * [Build with full ICU support (all locales supported by ICU)](#build-with-full-icu-support-all-locales-supported-by-icu) + * [Unix/macOS](#unixmacos) + * [Windows](#windows-1) + * [Trimmed: `small-icu` (English only) support](#trimmed-small-icu-english-only-support) + * [Unix/macOS](#unixmacos-1) + * [Windows](#windows-2) + * [Building without Intl support](#building-without-intl-support) + * [Unix/macOS](#unixmacos-2) + * [Windows](#windows-3) + * [Use existing installed ICU (Unix/macOS only)](#use-existing-installed-icu-unixmacos-only) + * [Build with a specific ICU](#build-with-a-specific-icu) + * [Unix/macOS](#unixmacos-3) + * [Windows](#windows-4) + * [Configure OpenSSL appname](#configure-openssl-appname) + * [Building Node.js with FIPS-compliant OpenSSL](#building-nodejs-with-fips-compliant-openssl) + * [Building Node.js with Temporal support](#building-nodejs-with-temporal-support) + * [Building Node.js with external core modules](#building-nodejs-with-external-core-modules) + * [Unix/macOS](#unixmacos-4) + * [Windows](#windows-5) + * [Building to use shared dependencies at runtime](#building-to-use-shared-dependencies-at-runtime) + * [Note for downstream distributors of Node.js](#note-for-downstream-distributors-of-nodejs) ## Supported platforms From 6dc378b56ac4930b12814d1b8268dddef045d412 Mon Sep 17 00:00:00 2001 From: moluopro Date: Fri, 1 May 2026 22:27:05 +0800 Subject: [PATCH 13/15] doc: mark Android as experimental Signed-off-by: moluopro --- .github/workflows/test-android.yml | 103 -------------------------- BUILDING.md | 115 +++++++++++++++-------------- 2 files changed, 58 insertions(+), 160 deletions(-) delete mode 100644 .github/workflows/test-android.yml diff --git a/.github/workflows/test-android.yml b/.github/workflows/test-android.yml deleted file mode 100644 index 8ba4f3cb3a4ab5..00000000000000 --- a/.github/workflows/test-android.yml +++ /dev/null @@ -1,103 +0,0 @@ -name: Test Android - -on: - pull_request: - types: [opened, synchronize, reopened, ready_for_review] - paths-ignore: - - '**.md' - - '**.nix' - - eslint.config.mjs - - '**/eslint.config_partial.mjs' - - benchmarks/** - - codecov.yml - - doc/** - - pyproject.yml - - tsconfig.json - - test/internet/** - - tools/actions/** - - tools/dep_updaters/** - - tools/doc/** - - tools/eslint-rules/** - - tools/eslint/** - - tools/lint-md/** - - typings/** - - vcbuild.bat - - .** - - '!.github/workflows/test-android.yml' - push: - branches: - - main - - canary - - v[0-9]+.x-staging - - v[0-9]+.x - paths-ignore: - - '**.md' - - '**.nix' - - eslint.config.mjs - - '**/eslint.config_partial.mjs' - - benchmarks/** - - codecov.yml - - doc/** - - pyproject.yml - - tsconfig.json - - test/internet/** - - tools/actions/** - - tools/dep_updaters/** - - tools/doc/** - - tools/eslint-rules/** - - tools/eslint/** - - tools/lint-md/** - - typings/** - - vcbuild.bat - - .** - - '!.github/workflows/test-android.yml' - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -env: - ANDROID_API_LEVEL: '29' - ANDROID_NDK_VERSION: 29.0.14206865 - PYTHON_VERSION: '3.14' - -permissions: - contents: read - -jobs: - build-android: - if: github.event.pull_request.draft == false - name: Build Android - runs-on: macos-26 - steps: - - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - path: node - - name: Setup Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.PYTHON_VERSION }} - allow-prereleases: true - - name: Install NDK - run: | - ANDROID_SDK_ROOT="${ANDROID_HOME:-${ANDROID_SDK_ROOT:-$HOME/Library/Android/sdk}}" - export ANDROID_HOME="$ANDROID_SDK_ROOT" - export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$PATH" - echo "ANDROID_HOME=$ANDROID_HOME" >> "$GITHUB_ENV" - - yes | sdkmanager --licenses >/dev/null || true - sdkmanager --install \ - "platforms;android-${ANDROID_API_LEVEL}" \ - "ndk;${ANDROID_NDK_VERSION}" - echo "ANDROID_NDK_HOME=${ANDROID_HOME}/ndk/${ANDROID_NDK_VERSION}" >> "$GITHUB_ENV" - - name: Configure - run: ./android-configure "$ANDROID_NDK_HOME" "$ANDROID_API_LEVEL" arm64 - working-directory: node - - name: Build - run: make -j$(getconf _NPROCESSORS_ONLN) - working-directory: node - - name: Verify - run: file out/Release/node - working-directory: node diff --git a/BUILDING.md b/BUILDING.md index 6cdfec59aac820..a5b06b45f1b29c 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -10,63 +10,63 @@ file a new issue. ## Table of contents -* [Building Node.js](#building-nodejs) - * [Table of contents](#table-of-contents) - * [Supported platforms](#supported-platforms) - * [Input](#input) - * [Strategy](#strategy) - * [Platform list](#platform-list) - * [Supported toolchains](#supported-toolchains) - * [Official binary platforms and toolchains](#official-binary-platforms-and-toolchains) - * [OpenSSL asm support](#openssl-asm-support) - * [Previous versions of this document](#previous-versions-of-this-document) - * [Building Node.js on supported platforms](#building-nodejs-on-supported-platforms) - * [Prerequisites](#prerequisites) - * [Unix and macOS](#unix-and-macos) - * [Unix prerequisites](#unix-prerequisites) - * [macOS prerequisites](#macos-prerequisites) - * [Nix integration](#nix-integration) - * [Building Node.js](#building-nodejs-1) - * [Installing Node.js](#installing-nodejs) - * [Running tests](#running-tests) - * [Running coverage](#running-coverage) - * [Building the documentation](#building-the-documentation) - * [Building a debug build](#building-a-debug-build) - * [Building an ASan build](#building-an-asan-build) - * [Speeding up frequent rebuilds when developing](#speeding-up-frequent-rebuilds-when-developing) - * [ccache](#ccache) - * [Loading JS files from disk instead of embedding](#loading-js-files-from-disk-instead-of-embedding) - * [Troubleshooting Unix and macOS builds](#troubleshooting-unix-and-macos-builds) - * [Windows](#windows) - * [Tips](#tips) - * [Windows Prerequisites](#windows-prerequisites) - * [Option 1: Manual install](#option-1-manual-install) - * [Option 2: Automated install with WinGet](#option-2-automated-install-with-winget) - * [Building Node.js](#building-nodejs-2) - * [Using ccache:](#using-ccache) - * [Android](#android) - * [`Intl` (ECMA-402) support](#intl-ecma-402-support) - * [Build with full ICU support (all locales supported by ICU)](#build-with-full-icu-support-all-locales-supported-by-icu) - * [Unix/macOS](#unixmacos) - * [Windows](#windows-1) - * [Trimmed: `small-icu` (English only) support](#trimmed-small-icu-english-only-support) - * [Unix/macOS](#unixmacos-1) - * [Windows](#windows-2) - * [Building without Intl support](#building-without-intl-support) - * [Unix/macOS](#unixmacos-2) - * [Windows](#windows-3) - * [Use existing installed ICU (Unix/macOS only)](#use-existing-installed-icu-unixmacos-only) - * [Build with a specific ICU](#build-with-a-specific-icu) - * [Unix/macOS](#unixmacos-3) - * [Windows](#windows-4) - * [Configure OpenSSL appname](#configure-openssl-appname) - * [Building Node.js with FIPS-compliant OpenSSL](#building-nodejs-with-fips-compliant-openssl) - * [Building Node.js with Temporal support](#building-nodejs-with-temporal-support) - * [Building Node.js with external core modules](#building-nodejs-with-external-core-modules) - * [Unix/macOS](#unixmacos-4) - * [Windows](#windows-5) - * [Building to use shared dependencies at runtime](#building-to-use-shared-dependencies-at-runtime) - * [Note for downstream distributors of Node.js](#note-for-downstream-distributors-of-nodejs) +- [Building Node.js](#building-nodejs) + - [Table of contents](#table-of-contents) + - [Supported platforms](#supported-platforms) + - [Input](#input) + - [Strategy](#strategy) + - [Platform list](#platform-list) + - [Supported toolchains](#supported-toolchains) + - [Official binary platforms and toolchains](#official-binary-platforms-and-toolchains) + - [OpenSSL asm support](#openssl-asm-support) + - [Previous versions of this document](#previous-versions-of-this-document) + - [Building Node.js on supported platforms](#building-nodejs-on-supported-platforms) + - [Prerequisites](#prerequisites) + - [Unix and macOS](#unix-and-macos) + - [Unix prerequisites](#unix-prerequisites) + - [macOS prerequisites](#macos-prerequisites) + - [Nix integration](#nix-integration) + - [Building Node.js](#building-nodejs-1) + - [Installing Node.js](#installing-nodejs) + - [Running tests](#running-tests) + - [Running coverage](#running-coverage) + - [Building the documentation](#building-the-documentation) + - [Building a debug build](#building-a-debug-build) + - [Building an ASan build](#building-an-asan-build) + - [Speeding up frequent rebuilds when developing](#speeding-up-frequent-rebuilds-when-developing) + - [ccache](#ccache) + - [Loading JS files from disk instead of embedding](#loading-js-files-from-disk-instead-of-embedding) + - [Troubleshooting Unix and macOS builds](#troubleshooting-unix-and-macos-builds) + - [Windows](#windows) + - [Tips](#tips) + - [Windows Prerequisites](#windows-prerequisites) + - [Option 1: Manual install](#option-1-manual-install) + - [Option 2: Automated install with WinGet](#option-2-automated-install-with-winget) + - [Building Node.js](#building-nodejs-2) + - [Using ccache:](#using-ccache) + - [Android](#android) + - [`Intl` (ECMA-402) support](#intl-ecma-402-support) + - [Build with full ICU support (all locales supported by ICU)](#build-with-full-icu-support-all-locales-supported-by-icu) + - [Unix/macOS](#unixmacos) + - [Windows](#windows-1) + - [Trimmed: `small-icu` (English only) support](#trimmed-small-icu-english-only-support) + - [Unix/macOS](#unixmacos-1) + - [Windows](#windows-2) + - [Building without Intl support](#building-without-intl-support) + - [Unix/macOS](#unixmacos-2) + - [Windows](#windows-3) + - [Use existing installed ICU (Unix/macOS only)](#use-existing-installed-icu-unixmacos-only) + - [Build with a specific ICU](#build-with-a-specific-icu) + - [Unix/macOS](#unixmacos-3) + - [Windows](#windows-4) + - [Configure OpenSSL appname](#configure-openssl-appname) + - [Building Node.js with FIPS-compliant OpenSSL](#building-nodejs-with-fips-compliant-openssl) + - [Building Node.js with Temporal support](#building-nodejs-with-temporal-support) + - [Building Node.js with external core modules](#building-nodejs-with-external-core-modules) + - [Unix/macOS](#unixmacos-4) + - [Windows](#windows-5) + - [Building to use shared dependencies at runtime](#building-to-use-shared-dependencies-at-runtime) + - [Note for downstream distributors of Node.js](#note-for-downstream-distributors-of-nodejs) ## Supported platforms @@ -128,6 +128,7 @@ platforms. This is true regardless of entries in the table below. | SmartOS | x64 | >= 18 | Tier 2 | | | AIX | ppc64be >=power9 | >= 7.2 TL04 | Tier 2 | | | FreeBSD | x64 | >= 13.2 | Experimental | | +| Android | arm64 | >= 7.0 | Experimental | | | OpenHarmony | arm64 | >= 5.0 | Experimental | | From fcf1522695ab9a011d2b8cf0cb40231671c421ee Mon Sep 17 00:00:00 2001 From: moluopro Date: Fri, 1 May 2026 22:42:28 +0800 Subject: [PATCH 14/15] doc: fix BUILDING.md list markers Signed-off-by: moluopro --- BUILDING.md | 114 ++++++++++++++++++++++++++-------------------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index a5b06b45f1b29c..48b2c83c57c354 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -10,63 +10,63 @@ file a new issue. ## Table of contents -- [Building Node.js](#building-nodejs) - - [Table of contents](#table-of-contents) - - [Supported platforms](#supported-platforms) - - [Input](#input) - - [Strategy](#strategy) - - [Platform list](#platform-list) - - [Supported toolchains](#supported-toolchains) - - [Official binary platforms and toolchains](#official-binary-platforms-and-toolchains) - - [OpenSSL asm support](#openssl-asm-support) - - [Previous versions of this document](#previous-versions-of-this-document) - - [Building Node.js on supported platforms](#building-nodejs-on-supported-platforms) - - [Prerequisites](#prerequisites) - - [Unix and macOS](#unix-and-macos) - - [Unix prerequisites](#unix-prerequisites) - - [macOS prerequisites](#macos-prerequisites) - - [Nix integration](#nix-integration) - - [Building Node.js](#building-nodejs-1) - - [Installing Node.js](#installing-nodejs) - - [Running tests](#running-tests) - - [Running coverage](#running-coverage) - - [Building the documentation](#building-the-documentation) - - [Building a debug build](#building-a-debug-build) - - [Building an ASan build](#building-an-asan-build) - - [Speeding up frequent rebuilds when developing](#speeding-up-frequent-rebuilds-when-developing) - - [ccache](#ccache) - - [Loading JS files from disk instead of embedding](#loading-js-files-from-disk-instead-of-embedding) - - [Troubleshooting Unix and macOS builds](#troubleshooting-unix-and-macos-builds) - - [Windows](#windows) - - [Tips](#tips) - - [Windows Prerequisites](#windows-prerequisites) - - [Option 1: Manual install](#option-1-manual-install) - - [Option 2: Automated install with WinGet](#option-2-automated-install-with-winget) - - [Building Node.js](#building-nodejs-2) - - [Using ccache:](#using-ccache) - - [Android](#android) - - [`Intl` (ECMA-402) support](#intl-ecma-402-support) - - [Build with full ICU support (all locales supported by ICU)](#build-with-full-icu-support-all-locales-supported-by-icu) - - [Unix/macOS](#unixmacos) - - [Windows](#windows-1) - - [Trimmed: `small-icu` (English only) support](#trimmed-small-icu-english-only-support) - - [Unix/macOS](#unixmacos-1) - - [Windows](#windows-2) - - [Building without Intl support](#building-without-intl-support) - - [Unix/macOS](#unixmacos-2) - - [Windows](#windows-3) - - [Use existing installed ICU (Unix/macOS only)](#use-existing-installed-icu-unixmacos-only) - - [Build with a specific ICU](#build-with-a-specific-icu) - - [Unix/macOS](#unixmacos-3) - - [Windows](#windows-4) - - [Configure OpenSSL appname](#configure-openssl-appname) - - [Building Node.js with FIPS-compliant OpenSSL](#building-nodejs-with-fips-compliant-openssl) - - [Building Node.js with Temporal support](#building-nodejs-with-temporal-support) - - [Building Node.js with external core modules](#building-nodejs-with-external-core-modules) - - [Unix/macOS](#unixmacos-4) - - [Windows](#windows-5) - - [Building to use shared dependencies at runtime](#building-to-use-shared-dependencies-at-runtime) - - [Note for downstream distributors of Node.js](#note-for-downstream-distributors-of-nodejs) +* [Building Node.js](#building-nodejs) + * [Table of contents](#table-of-contents) + * [Supported platforms](#supported-platforms) + * [Input](#input) + * [Strategy](#strategy) + * [Platform list](#platform-list) + * [Supported toolchains](#supported-toolchains) + * [Official binary platforms and toolchains](#official-binary-platforms-and-toolchains) + * [OpenSSL asm support](#openssl-asm-support) + * [Previous versions of this document](#previous-versions-of-this-document) + * [Building Node.js on supported platforms](#building-nodejs-on-supported-platforms) + * [Prerequisites](#prerequisites) + * [Unix and macOS](#unix-and-macos) + * [Unix prerequisites](#unix-prerequisites) + * [macOS prerequisites](#macos-prerequisites) + * [Nix integration](#nix-integration) + * [Building Node.js](#building-nodejs-1) + * [Installing Node.js](#installing-nodejs) + * [Running tests](#running-tests) + * [Running coverage](#running-coverage) + * [Building the documentation](#building-the-documentation) + * [Building a debug build](#building-a-debug-build) + * [Building an ASan build](#building-an-asan-build) + * [Speeding up frequent rebuilds when developing](#speeding-up-frequent-rebuilds-when-developing) + * [ccache](#ccache) + * [Loading JS files from disk instead of embedding](#loading-js-files-from-disk-instead-of-embedding) + * [Troubleshooting Unix and macOS builds](#troubleshooting-unix-and-macos-builds) + * [Windows](#windows) + * [Tips](#tips) + * [Windows Prerequisites](#windows-prerequisites) + * [Option 1: Manual install](#option-1-manual-install) + * [Option 2: Automated install with WinGet](#option-2-automated-install-with-winget) + * [Building Node.js](#building-nodejs-2) + * [Using ccache:](#using-ccache) + * [Android](#android) + * [`Intl` (ECMA-402) support](#intl-ecma-402-support) + * [Build with full ICU support (all locales supported by ICU)](#build-with-full-icu-support-all-locales-supported-by-icu) + * [Unix/macOS](#unixmacos) + * [Windows](#windows-1) + * [Trimmed: `small-icu` (English only) support](#trimmed-small-icu-english-only-support) + * [Unix/macOS](#unixmacos-1) + * [Windows](#windows-2) + * [Building without Intl support](#building-without-intl-support) + * [Unix/macOS](#unixmacos-2) + * [Windows](#windows-3) + * [Use existing installed ICU (Unix/macOS only)](#use-existing-installed-icu-unixmacos-only) + * [Build with a specific ICU](#build-with-a-specific-icu) + * [Unix/macOS](#unixmacos-3) + * [Windows](#windows-4) + * [Configure OpenSSL appname](#configure-openssl-appname) + * [Building Node.js with FIPS-compliant OpenSSL](#building-nodejs-with-fips-compliant-openssl) + * [Building Node.js with Temporal support](#building-nodejs-with-temporal-support) + * [Building Node.js with external core modules](#building-nodejs-with-external-core-modules) + * [Unix/macOS](#unixmacos-4) + * [Windows](#windows-5) + * [Building to use shared dependencies at runtime](#building-to-use-shared-dependencies-at-runtime) + * [Note for downstream distributors of Node.js](#note-for-downstream-distributors-of-nodejs) ## Supported platforms From 5339f969550fba65cd1048c0517ef450ff8a64c8 Mon Sep 17 00:00:00 2001 From: moluopro Date: Sat, 2 May 2026 10:00:17 +0800 Subject: [PATCH 15/15] build: limit Android Darwin host make rules The Android make generator needs Darwin-specific host archive and link commands when cross-compiling on macOS. Keep the default Android make command template unchanged and select the Darwin host variant only while generating Android Makefiles on macOS. Signed-off-by: moluopro --- tools/gyp/pylib/gyp/generator/make.py | 28 ++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/tools/gyp/pylib/gyp/generator/make.py b/tools/gyp/pylib/gyp/generator/make.py index fe9cfbc440e6f8..66e6d5e6140bff 100644 --- a/tools/gyp/pylib/gyp/generator/make.py +++ b/tools/gyp/pylib/gyp/generator/make.py @@ -249,11 +249,7 @@ def CalculateGeneratorInputInfo(params): define create_thin_archive rm -f $(1) $(OBJ_FILE_LIST); mkdir -p `dirname $(1)` $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) - if [ "$(TOOLSET)" = "host" ] && [ "$$(uname -s)" = "Darwin" ]; then \ - $(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST); \ - else \ - $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST); \ - fi + $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST) endef # Due to circular dependencies between libraries :(, we wrap the @@ -262,7 +258,7 @@ def CalculateGeneratorInputInfo(params): quiet_cmd_link = LINK($(TOOLSET)) $@ quiet_cmd_link_host = LINK($(TOOLSET)) $@ cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS) -cmd_link_host = if [ "$$(uname -s)" = "Darwin" ]; then $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS); else $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS); fi +cmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS) # Other shared-object link notes: # - Set SONAME to the library filename so our binaries don't reference @@ -276,6 +272,21 @@ def CalculateGeneratorInputInfo(params): cmd_solink_module_host = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) """ # noqa: E501 +LINK_COMMANDS_ANDROID_DARWIN_HOST = LINK_COMMANDS_ANDROID.replace( + "$(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST)", + 'if [ "$(TOOLSET)" = "host" ]; then \\\n' + " $(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST); \\\n" + " else \\\n" + " $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST); \\\n" + " fi", +).replace( + "cmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) " + "$(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) " + "-Wl,--end-group $(LIBS)", + "cmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) " + "$(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)", +) + LINK_COMMANDS_AIX = """\ quiet_cmd_alink = AR($(TOOLSET)) $@ @@ -2522,7 +2533,10 @@ def CalculateMakefilePath(build_file, base_name): } ) elif flavor == "android": - header_params.update({"link_commands": LINK_COMMANDS_ANDROID}) + link_commands = LINK_COMMANDS_ANDROID + if sys.platform == "darwin": + link_commands = LINK_COMMANDS_ANDROID_DARWIN_HOST + header_params.update({"link_commands": link_commands}) elif flavor == "zos": copy_archive_arguments = "-fPR" CC_target = GetEnvironFallback(("CC_target", "CC"), "njsc")