From b200a1eaee974cdd4cb04eb52afca213c6112106 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sun, 5 Jan 2025 10:41:20 -0800 Subject: [PATCH 1/9] ci: support Windows ARM --- .github/workflows/CI.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b34f929a..a11d4edb 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -34,10 +34,10 @@ jobs: cpp_arch: amd64_x86 native: true - # - os: windows-2022 - # node_arch: x64 - # arch: arm64 - # cpp_arch: amd64_arm64 + - os: windows-2022 + node_arch: x64 + cpp_arch: amd64_arm64 + native: true - os: macos-13 node_arch: x64 From e450a7d21bcaacc15cdb134f11d2e67d7d658b82 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sun, 12 Jan 2025 03:23:07 -0800 Subject: [PATCH 2/9] ci: use setup-cpp master --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a11d4edb..6f8246f1 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -97,7 +97,7 @@ jobs: - name: Setup Cpp if: ${{ matrix.native }} - uses: aminya/setup-cpp@v1 + uses: aminya/setup-cpp@master with: vcvarsall: ${{ contains(matrix.os, 'windows') }} cmake: true From b7f999b72fdf0faa5692d0f50fcfaffa1fce25d0 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sun, 12 Jan 2025 03:52:00 -0800 Subject: [PATCH 3/9] ci: set the node target arch correctly --- .github/workflows/CI.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 6f8246f1..8fb1f5fd 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,7 +10,7 @@ jobs: if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} runs-on: ${{ matrix.os }} # prettier-ignore - name: ${{ matrix.os }}-${{ matrix.node_arch }}-${{ matrix.dockerfile }}-${{ matrix.distro }} + name: ${{ matrix.os }}-${{ matrix.node_target_arch }}-${{ matrix.dockerfile }}-${{ matrix.distro }} strategy: fail-fast: false matrix: @@ -19,6 +19,8 @@ jobs: - windows-2019 node_arch: - x64 + node_target_arch: + - x64 cpp_arch: - x64 dockerfile: @@ -31,48 +33,55 @@ jobs: include: - os: windows-2019 node_arch: ia32 + node_target_arch: ia32 cpp_arch: amd64_x86 native: true - os: windows-2022 node_arch: x64 + node_target_arch: arm64 cpp_arch: amd64_arm64 native: true - os: macos-13 node_arch: x64 + node_target_arch: x64 cpp_arch: x64 native: true - os: macos-14 node_arch: arm64 - cpp_arch: amd64_arm64 + node_target_arch: arm64 + cpp_arch: arm64 native: true # Musl Alpine - os: ubuntu-24.04 dockerfile: docker/alpine.dockerfile node_arch: x64 + node_target_arch: x64 cpp_arch: x64 native: false # Debian Arm - os: ubuntu-24.04 - node_arch: arm64 - cpp_arch: amd64_arm64 distro: bookworm + node_arch: arm64 + node_target_arch: arm64 + cpp_arch: arm64 native: false # Musl Alpine Arm - os: ubuntu-24.04 - node_arch: arm64 - cpp_arch: amd64_arm64 distro: alpine_latest + node_arch: arm64 + node_target_arch: arm64 + cpp_arch: arm64 native: false env: npm_config_arch: ${{ matrix.node_arch }} - npm_config_target_arch: ${{ matrix.node_arch }} + npm_config_target_arch: ${{ matrix.node_target_arch }} setup_node_arch: ${{ matrix.node_arch }} steps: - uses: actions/checkout@v4 From cce43230e58c20d544ac4a902e1bfa2a1ae41bc2 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sun, 12 Jan 2025 04:03:12 -0800 Subject: [PATCH 4/9] build: set the vcpkg triplet for arm64 --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1380b8ee..5a170e82 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,9 @@ if(WIN32) elseif(NOT "$ENV{PROCESSOR_ARCHITEW6432}" STREQUAL "") set(CMAKE_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITEW6432}") set(VCPKG_TARGET_TRIPLET "x86-windows-static") + elseif("$ENV{Platform}" STREQUAL "arm64") + set(CMAKE_SYSTEM_PROCESSOR "arm64") + set(VCPKG_TARGET_TRIPLET "arm64-windows-static") else() set(CMAKE_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}") set(VCPKG_TARGET_TRIPLET "x64-windows-static") From ea1d4dfce998dc5f3048c77383e49f3c1cfd7d0f Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sun, 12 Jan 2025 04:39:23 -0800 Subject: [PATCH 5/9] fix: detect cross-compilation in the install script --- .github/workflows/CI.yml | 63 +++++++++++++++++++++------------------- package.json | 9 +++++- script/install.js | 16 +++++++++- src/socket.cc | 4 +-- 4 files changed, 58 insertions(+), 34 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 8fb1f5fd..9ec24e07 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -27,33 +27,38 @@ jobs: - "" distro: - "" - native: - - true - + vm: + - false + cross_compiling: + - false include: - os: windows-2019 node_arch: ia32 node_target_arch: ia32 cpp_arch: amd64_x86 - native: true + vm: false + cross_compiling: true - os: windows-2022 node_arch: x64 node_target_arch: arm64 cpp_arch: amd64_arm64 - native: true + vm: false + cross_compiling: true - os: macos-13 node_arch: x64 node_target_arch: x64 cpp_arch: x64 - native: true + vm: false + cross_compiling: false - os: macos-14 node_arch: arm64 node_target_arch: arm64 cpp_arch: arm64 - native: true + vm: false + cross_compiling: false # Musl Alpine - os: ubuntu-24.04 @@ -61,7 +66,8 @@ jobs: node_arch: x64 node_target_arch: x64 cpp_arch: x64 - native: false + vm: true + cross_compiling: false # Debian Arm - os: ubuntu-24.04 @@ -69,7 +75,8 @@ jobs: node_arch: arm64 node_target_arch: arm64 cpp_arch: arm64 - native: false + vm: true + cross_compiling: false # Musl Alpine Arm - os: ubuntu-24.04 @@ -77,12 +84,14 @@ jobs: node_arch: arm64 node_target_arch: arm64 cpp_arch: arm64 - native: false + vm: true + cross_compiling: false env: npm_config_arch: ${{ matrix.node_arch }} npm_config_target_arch: ${{ matrix.node_target_arch }} setup_node_arch: ${{ matrix.node_arch }} + cross_compiling: ${{ matrix.cross_compiling }} steps: - uses: actions/checkout@v4 @@ -105,7 +114,7 @@ jobs: shell: bash - name: Setup Cpp - if: ${{ matrix.native }} + if: ${{ !matrix.vm }} uses: aminya/setup-cpp@master with: vcvarsall: ${{ contains(matrix.os, 'windows') }} @@ -121,44 +130,38 @@ jobs: brew install gnutls autoconf automake libtool - uses: pnpm/action-setup@v4 - if: ${{ matrix.native }} + if: ${{ !matrix.vm }} with: version: 9 - name: Install Node 20 - if: ${{ matrix.native }} + if: ${{ !matrix.vm }} uses: actions/setup-node@v4 with: node-version: 20 architecture: ${{ env.setup_node_arch }} - name: Install and Build Native - if: ${{ matrix.native }} + if: ${{ !matrix.vm }} run: pnpm install - name: Build JavaScript - if: ${{ matrix.native }} + if: ${{ !matrix.vm }} run: pnpm run build.js - name: Install Node 10 - if: ${{ matrix.native && matrix.os != 'macos-14' }} + if: ${{ !matrix.vm && matrix.os != 'macos-14' }} uses: actions/setup-node@v4 with: node-version: 10 architecture: ${{ env.setup_node_arch }} - - name: Build Native - if: ${{ matrix.native && matrix.node_arch != 'ia32' }} - run: npm run build.native - - - name: Build Native Windows 32 - if: ${{ matrix.os == 'windows-2019' && matrix.node_arch == 'ia32' }} - run: - node ./node_modules/@aminya/cmake-ts/build/main.js named-configs - windows-x86 + - name: Build Node 10 Native + if: ${{ !matrix.vm }} + run: node ./script/install.js - name: Use Node 20 - if: ${{ matrix.native }} + if: ${{ !matrix.vm }} uses: actions/setup-node@v4 with: node-version: 20 @@ -210,11 +213,11 @@ jobs: overwrite: true - name: Lint - if: "${{ contains(matrix.os, 'ubuntu') && matrix.native }}" + if: "${{ !matrix.vm && contains(matrix.os, 'ubuntu') }}" run: pnpm run lint-test - name: Test - if: ${{ matrix.native }} + if: ${{ !matrix.vm }} uses: nick-fields/retry@v3 with: timeout_minutes: 5 @@ -225,7 +228,7 @@ jobs: rm -rf ./tmp && mkdir -p ./tmp - name: Test Electron Windows/MacOS - if: "${{ !contains(matrix.os, 'ubuntu') && matrix.native }}" + if: "${{ !matrix.vm && !contains(matrix.os, 'ubuntu') }}" uses: nick-fields/retry@v3 with: timeout_minutes: 5 @@ -235,7 +238,7 @@ jobs: continue-on-error: true - name: Test Electron Linux - if: "${{ contains(matrix.os, 'ubuntu') && matrix.native }}" + if: "${{ !matrix.vm && contains(matrix.os, 'ubuntu') }}" uses: nick-fields/retry@v3 with: timeout_minutes: 5 diff --git a/package.json b/package.json index b8e8fcbf..b27bb435 100644 --- a/package.json +++ b/package.json @@ -177,6 +177,13 @@ "runtime": "node", "runtimeVersion": "12.22.12" }, + { + "name": "windows-arm64", + "os": "win32", + "arch": "arm64", + "runtime": "node", + "runtimeVersion": "12.22.12" + }, { "name": "windows-x86", "os": "win32", @@ -250,4 +257,4 @@ ], "license": "MIT AND MPL-2.0", "author": "Amin Yahyaabadi , Rolf Timmermans " -} \ No newline at end of file +} diff --git a/script/install.js b/script/install.js index 83e9431f..6bb603fb 100644 --- a/script/install.js +++ b/script/install.js @@ -7,7 +7,21 @@ function cmakeTs() { ) const cmakeTsPath = require.resolve("@aminya/cmake-ts/build/main.js") - cp.execFileSync(process.execPath, [cmakeTsPath, "nativeonly"], { + // Default args + let args = ["nativeonly"] + + if (process.arch !== process.env.npm_config_target_arch || process.env.cross_compiling === "true") { + // cross-compilation + if (process.platform === "win32") { + if (process.env.npm_config_target_arch === "ia32") { + args = ["named-configs", "windows-x86"] + } else if (process.env.npm_config_target_arch === "arm64") { + args = ["named-configs", "windows-arm64"] + } + } + } + + cp.execFileSync(process.execPath, [cmakeTsPath, ...args], { stdio: "inherit", }) } diff --git a/src/socket.cc b/src/socket.cc index 95385db2..b7229e14 100644 --- a/src/socket.cc +++ b/src/socket.cc @@ -397,7 +397,7 @@ Napi::Value Socket::Bind(const Napi::CallbackInfo& info) { if (run_ctx->error != 0) { res.Reject(ErrnoException( Env(), static_cast(run_ctx->error), run_ctx->address) - .Value()); + .Value()); return; } @@ -491,7 +491,7 @@ Napi::Value Socket::Unbind(const Napi::CallbackInfo& info) { if (run_ctx->error != 0) { res.Reject(ErrnoException( Env(), static_cast(run_ctx->error), run_ctx->address) - .Value()); + .Value()); return; } From a5e33c4bb17c911dc73703880025513a42d6cd50 Mon Sep 17 00:00:00 2001 From: Amin Ya Date: Mon, 24 Mar 2025 02:42:16 -0700 Subject: [PATCH 6/9] fix: add missing include for chrono --- src/module.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/module.h b/src/module.h index b28d789c..79d190e4 100644 --- a/src/module.h +++ b/src/module.h @@ -2,6 +2,7 @@ #include #include +#include #include "./closable.h" #include "./outgoing_msg.h" From 8fb35186387a1ece80565419d3ec3fd9bb1e84ee Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sun, 13 Apr 2025 01:00:24 -0700 Subject: [PATCH 7/9] feat: add cross-compiling Windows arm via cmake-ts v1 --- .github/workflows/CI.yml | 69 ++++++++++++++++++---------------------- CMakeLists.txt | 28 ++++++++++------ package.json | 2 +- pnpm-lock.yaml | 10 +++--- script/install.js | 16 +--------- 5 files changed, 56 insertions(+), 69 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index defe4803..b1acb6d9 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,78 +10,76 @@ jobs: if: ${{ !contains(github.event.head_commit.message, '[skip build]') }} runs-on: ${{ matrix.os }} # prettier-ignore - name: ${{ matrix.os }}-${{ matrix.node_arch }}-${{ matrix.distro }}-${{ matrix.platform }} + name: ${{ matrix.os }} ${{ matrix.target_arch }} ${{ matrix.distro }} ${{ matrix.platform }} strategy: fail-fast: false matrix: os: - ubuntu-24.04 - windows-2019 + - macos-13 node_arch: - x64 cpp_arch: - x64 + target_arch: + - x64 distro: - "" - native: - - true - include: + # Windows x86 - os: windows-2019 node_arch: ia32 + target_arch: ia32 cpp_arch: amd64_x86 - native: true - - # - os: windows-2022 - # node_arch: x64 - # arch: arm64 - # cpp_arch: amd64_arm64 - - os: macos-13 + # Windows Arm64 + - os: windows-2022 node_arch: x64 - cpp_arch: x64 - native: true + target_arch: arm64 + cpp_arch: amd64_arm64 + # MacOS Arm64 - os: macos-14 node_arch: arm64 + target_arch: arm64 cpp_arch: amd64_arm64 - native: true - # Ubuntu x64 + # Ubuntu 20.04 x64 - os: ubuntu-24.04 distro: ubuntu platform: linux/amd64 node_arch: x64 + target_arch: x64 cpp_arch: x64 - native: false - # Ubuntu Arm + # Ubuntu 20.04 Arm64 - os: ubuntu-24.04-arm distro: ubuntu platform: linux/arm64 node_arch: arm64 + target_arch: arm64 cpp_arch: arm64 - native: false # Musl Alpine - os: ubuntu-24.04 distro: alpine platform: linux/amd64 node_arch: x64 + target_arch: x64 cpp_arch: x64 - native: false # Musl Alpine Arm - os: ubuntu-24.04-arm distro: alpine platform: linux/arm64 node_arch: arm64 + target_arch: arm64 cpp_arch: arm64 - native: false env: npm_config_arch: ${{ matrix.node_arch }} - npm_config_target_arch: ${{ matrix.node_arch }} + npm_config_target_arch: ${{ matrix.target_arch }} setup_node_arch: ${{ matrix.node_arch }} steps: - uses: actions/checkout@v4 @@ -105,7 +103,7 @@ jobs: shell: bash - name: Setup Cpp - if: ${{ matrix.native }} + if: ${{ ! matrix.distro }} uses: aminya/setup-cpp@v1 with: vcvarsall: ${{ contains(matrix.os, 'windows') }} @@ -121,41 +119,36 @@ jobs: brew install gnutls autoconf automake libtool - uses: pnpm/action-setup@v4 - if: ${{ matrix.native }} + if: ${{ ! matrix.distro }} - name: Install Node 20 - if: ${{ matrix.native }} + if: ${{ ! matrix.distro }} uses: actions/setup-node@v4 with: node-version: 20 architecture: ${{ env.setup_node_arch }} - name: Install and Build Native - if: ${{ matrix.native }} + if: ${{ ! matrix.distro }} run: pnpm install - name: Build JavaScript - if: ${{ matrix.native }} + if: ${{ ! matrix.distro }} run: pnpm run build.js - name: Install Node 12 - if: ${{ matrix.native && matrix.os != 'macos-14' }} + if: ${{ !matrix.distro && matrix.os != 'macos-14' }} uses: actions/setup-node@v4 with: node-version: 12 architecture: ${{ env.setup_node_arch }} - name: Build Native - if: ${{ matrix.native && matrix.node_arch != 'ia32' }} + if: ${{ ! matrix.distro }} run: npm run build.native - - name: Build Native Windows 32 - if: ${{ matrix.os == 'windows-2019' && matrix.node_arch == 'ia32' }} - run: - node --enable-source-maps ./node_modules/cmake-ts/build/main.js build --config win32-ia32-release - - name: Use Node 20 - if: ${{ matrix.native }} + if: ${{ ! matrix.distro }} uses: actions/setup-node@v4 with: node-version: 20 @@ -190,11 +183,11 @@ jobs: overwrite: true - name: Lint - if: "${{ contains(matrix.os, 'ubuntu') && matrix.native }}" + if: "${{ contains(matrix.os, 'ubuntu') && !matrix.distro }}" run: pnpm run lint-test - name: Test - if: ${{ matrix.native }} + if: ${{ ! matrix.distro }} uses: nick-fields/retry@v3 with: timeout_minutes: 5 @@ -205,7 +198,7 @@ jobs: rm -rf ./tmp && mkdir -p ./tmp - name: Test Electron Windows/MacOS - if: "${{ !contains(matrix.os, 'ubuntu') && matrix.native }}" + if: "${{ !contains(matrix.os, 'ubuntu') && !matrix.distro }}" uses: nick-fields/retry@v3 with: timeout_minutes: 5 @@ -215,7 +208,7 @@ jobs: continue-on-error: true - name: Test Electron Linux - if: "${{ contains(matrix.os, 'ubuntu') && matrix.native }}" + if: "${{ contains(matrix.os, 'ubuntu') && !matrix.distro }}" uses: nick-fields/retry@v3 with: timeout_minutes: 5 diff --git a/CMakeLists.txt b/CMakeLists.txt index b9fefa64..69ac357e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,18 +65,26 @@ endif() # target system on Windows (for cross-compiling x86) and static linking runtimes if(WIN32) - if("$ENV{Platform}" STREQUAL "x86") - set(CMAKE_SYSTEM_PROCESSOR "x86") - set(VCPKG_TARGET_TRIPLET "x86-windows-static") - elseif(NOT "$ENV{PROCESSOR_ARCHITEW6432}" STREQUAL "") - set(CMAKE_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITEW6432}") - set(VCPKG_TARGET_TRIPLET "x86-windows-static") - elseif("$ENV{Platform}" STREQUAL "arm64") - set(CMAKE_SYSTEM_PROCESSOR "arm64") + if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "") + if("$ENV{Platform}" STREQUAL "x86") + set(CMAKE_SYSTEM_PROCESSOR "x86") + elseif(NOT "$ENV{PROCESSOR_ARCHITEW6432}" STREQUAL "") + set(CMAKE_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITEW6432}") + else() + set(CMAKE_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}") + endif() + endif() + + string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" CMAKE_SYSTEM_PROCESSOR_LOWER) + + if("${CMAKE_SYSTEM_PROCESSOR_LOWER}" STREQUAL "amd64" OR "${CMAKE_SYSTEM_PROCESSOR_LOWER}" STREQUAL "x64") + set(VCPKG_TARGET_TRIPLET "x64-windows-static") + elseif("${CMAKE_SYSTEM_PROCESSOR_LOWER}" STREQUAL "arm64" OR "${CMAKE_SYSTEM_PROCESSOR_LOWER}" STREQUAL "aarch64") set(VCPKG_TARGET_TRIPLET "arm64-windows-static") + elseif("${CMAKE_SYSTEM_PROCESSOR_LOWER}" STREQUAL "x86") + set(VCPKG_TARGET_TRIPLET "x86-windows-static") else() - set(CMAKE_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}") - set(VCPKG_TARGET_TRIPLET "x64-windows-static") + message(STATUS "Not setting VCPKG_TARGET_TRIPLET for ${CMAKE_SYSTEM_PROCESSOR}") endif() # Avoid loading of project_optinos/WindowsToolchain diff --git a/package.json b/package.json index 9706a777..413ea189 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ }, "homepage": "http://zeromq.github.io/zeromq.js/", "dependencies": { - "cmake-ts": "1.0.0", + "cmake-ts": "1.0.1", "node-addon-api": "^8.3.0" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8818c87a..da884a4d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,8 +13,8 @@ importers: .: dependencies: cmake-ts: - specifier: 1.0.0 - version: 1.0.0 + specifier: 1.0.1 + version: 1.0.1 node-addon-api: specifier: ^8.3.0 version: 8.3.0 @@ -1044,8 +1044,8 @@ packages: clone-response@1.0.3: resolution: {integrity: sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==} - cmake-ts@1.0.0: - resolution: {integrity: sha512-wg7HJHTLmoqNM7/g/D9urT2P8NEghaz1ATlr55dCZTlK19DWN9I1f8st9uV6Cn0FeOUt02Ps1CKphvfbjUPRRQ==} + cmake-ts@1.0.1: + resolution: {integrity: sha512-scFGonRZa/szqIeSeRfXnIM9XR6GYS9Fj3+ZhcACzxepBymPVUnJOn1VN5KhUxgOWWwYtLX8kdORQSUJoNWaSw==} hasBin: true coffeescript@1.12.7: @@ -4576,7 +4576,7 @@ snapshots: dependencies: mimic-response: 1.0.1 - cmake-ts@1.0.0: {} + cmake-ts@1.0.1: {} coffeescript@1.12.7: optional: true diff --git a/script/install.js b/script/install.js index 87629396..f5f398af 100644 --- a/script/install.js +++ b/script/install.js @@ -15,21 +15,7 @@ function cmakeTs() { ) } - // Default args - let args = ["nativeonly"] - - if (process.arch !== process.env.npm_config_target_arch || process.env.cross_compiling === "true") { - // cross-compilation - if (process.platform === "win32") { - if (process.env.npm_config_target_arch === "ia32") { - args = ["named-configs", "windows-x86"] - } else if (process.env.npm_config_target_arch === "arm64") { - args = ["named-configs", "windows-arm64"] - } - } - } - - cp.execFileSync(process.execPath, [cmakeTsPath, ...args], { + cp.execFileSync(process.execPath, [cmakeTsPath, "build"], { stdio: "inherit", }) } From 8519bc0aa17955a403173425c1b63222a9ad37ac Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sun, 13 Apr 2025 03:36:09 -0700 Subject: [PATCH 8/9] fix: fix cross compilation detection --- .github/workflows/CI.yml | 2 +- package.json | 4 ++-- pnpm-lock.yaml | 20 ++++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b1acb6d9..2d1d3fc3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -29,7 +29,7 @@ jobs: include: # Windows x86 - os: windows-2019 - node_arch: ia32 + node_arch: x64 target_arch: ia32 cpp_arch: amd64_x86 diff --git a/package.json b/package.json index 413ea189..37f62327 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,8 @@ }, "homepage": "http://zeromq.github.io/zeromq.js/", "dependencies": { - "cmake-ts": "1.0.1", - "node-addon-api": "^8.3.0" + "cmake-ts": "1.0.2", + "node-addon-api": "^8.3.1" }, "devDependencies": { "@types/benchmark": "~2.1.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index da884a4d..e3762b01 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,11 +13,11 @@ importers: .: dependencies: cmake-ts: - specifier: 1.0.1 - version: 1.0.1 + specifier: 1.0.2 + version: 1.0.2 node-addon-api: - specifier: ^8.3.0 - version: 8.3.0 + specifier: ^8.3.1 + version: 8.3.1 devDependencies: '@types/benchmark': specifier: ~2.1.5 @@ -1044,8 +1044,8 @@ packages: clone-response@1.0.3: resolution: {integrity: sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==} - cmake-ts@1.0.1: - resolution: {integrity: sha512-scFGonRZa/szqIeSeRfXnIM9XR6GYS9Fj3+ZhcACzxepBymPVUnJOn1VN5KhUxgOWWwYtLX8kdORQSUJoNWaSw==} + cmake-ts@1.0.2: + resolution: {integrity: sha512-5l++JHE7MxFuyV/OwJf3ek7ZZN1aGPFPM5oUz6AnK5inQAPe4TFXRMz5sA2qg2FRgByPWdqO+gSfIPo8GzoKNQ==} hasBin: true coffeescript@1.12.7: @@ -2436,8 +2436,8 @@ packages: resolution: {integrity: sha512-7vbj10trelExNjFSBm5kTvZXXa7pZyKWx9RCKIyqe6I9Ev3IzGpQoqBP3a+cOdxY+pWj6VkP28n/2wWysBHD/A==} engines: {node: '>=10'} - node-addon-api@8.3.0: - resolution: {integrity: sha512-8VOpLHFrOQlAH+qA0ZzuGRlALRA6/LVh8QJldbrC4DY0hXoMP0l4Acq8TzFC018HztWiRqyCEj2aTWY2UvnJUg==} + node-addon-api@8.3.1: + resolution: {integrity: sha512-lytcDEdxKjGJPTLEfW4mYMigRezMlyJY8W4wxJK8zE533Jlb8L8dRuObJFWg2P+AuOIxoCgKF+2Oq4d4Zd0OUA==} engines: {node: ^18 || ^20 || >= 21} node-releases@2.0.18: @@ -4576,7 +4576,7 @@ snapshots: dependencies: mimic-response: 1.0.1 - cmake-ts@1.0.1: {} + cmake-ts@1.0.2: {} coffeescript@1.12.7: optional: true @@ -6320,7 +6320,7 @@ snapshots: dependencies: semver: 7.6.3 - node-addon-api@8.3.0: {} + node-addon-api@8.3.1: {} node-releases@2.0.18: {} From d8f9eff86d6fc2a5a2dd559e9fe451d00669d4d8 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sun, 13 Apr 2025 03:46:03 -0700 Subject: [PATCH 9/9] fix: skip node 12 build on windows arm --- .github/workflows/CI.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2d1d3fc3..7d160ab5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -137,7 +137,7 @@ jobs: run: pnpm run build.js - name: Install Node 12 - if: ${{ !matrix.distro && matrix.os != 'macos-14' }} + if: ${{ !matrix.distro && matrix.os != 'macos-14' && !(matrix.os == 'windows-2022' && matrix.target_arch == 'arm64') }} uses: actions/setup-node@v4 with: node-version: 12 @@ -187,7 +187,7 @@ jobs: run: pnpm run lint-test - name: Test - if: ${{ ! matrix.distro }} + if: ${{ ! matrix.distro && !(matrix.os == 'windows-2022' && matrix.target_arch == 'arm64') }} uses: nick-fields/retry@v3 with: timeout_minutes: 5 @@ -198,7 +198,7 @@ jobs: rm -rf ./tmp && mkdir -p ./tmp - name: Test Electron Windows/MacOS - if: "${{ !contains(matrix.os, 'ubuntu') && !matrix.distro }}" + if: "${{ !contains(matrix.os, 'ubuntu') && !matrix.distro && !(matrix.os == 'windows-2022' && matrix.target_arch == 'arm64') }}" uses: nick-fields/retry@v3 with: timeout_minutes: 5