fix windows binding
Release / Version (push) Canceled after 0s
Release / CI (push) Canceled after 0s
Release / Prebuild (macos-13) (push) Canceled after 0s
Release / Prebuild (macos-latest) (push) Canceled after 0s
Release / Prebuild (ubuntu-24.04-arm) (push) Canceled after 0s
Release / Prebuild (ubuntu-latest) (push) Canceled after 0s
Release / Prebuild (windows-latest) (push) Canceled after 0s
Release / Tag and stage (push) Canceled after 0s
Release / Version (push) Canceled after 0s
Release / CI (push) Canceled after 0s
Release / Prebuild (macos-13) (push) Canceled after 0s
Release / Prebuild (macos-latest) (push) Canceled after 0s
Release / Prebuild (ubuntu-24.04-arm) (push) Canceled after 0s
Release / Prebuild (ubuntu-latest) (push) Canceled after 0s
Release / Prebuild (windows-latest) (push) Canceled after 0s
Release / Tag and stage (push) Canceled after 0s
This commit is contained in:
1 parent
96e7b2a9c5
commit
a3de44f4ca
3 files changed
+18
No files matched your search
@@ -44,6 +44,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 22
|
||||||
cache: npm
|
cache: npm
|
||||||
|
# windows-latest is Windows Server 2025 with Visual Studio 2026, which the
|
||||||
|
# node-gyp bundled with the runner's npm (11.5) reports as "unknown
|
||||||
|
# version undefined" and then gives up on. node-gyp learned VS 18 in
|
||||||
|
# 12.1.0 and npm 12 bundles 13.
|
||||||
|
- if: runner.os == 'Windows'
|
||||||
|
run: npm install -g npm@^12
|
||||||
# npm ci builds the addon through the install script (node-gyp-build)
|
# npm ci builds the addon through the install script (node-gyp-build)
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run binding-test
|
- run: npm run binding-test
|
||||||
|
|||||||
@@ -112,6 +112,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 22
|
||||||
cache: npm
|
cache: npm
|
||||||
|
# the Windows runner's own npm bundles a node-gyp too old to see the
|
||||||
|
# Visual Studio 2026 on that image; see ci.yml
|
||||||
|
- if: runner.os == 'Windows'
|
||||||
|
run: npm install -g npm@^12
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run prebuildify
|
- run: npm run prebuildify
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
|
|||||||
@@ -100,6 +100,14 @@ Releasing needs three things to line up:
|
|||||||
The arm64 Linux runner (`ubuntu-24.04-arm`) is free for public repositories only. `tree-sitter build --wasm`
|
The arm64 Linux runner (`ubuntu-24.04-arm`) is free for public repositories only. `tree-sitter build --wasm`
|
||||||
runs Emscripten through Docker, which the ubuntu runners provide.
|
runs Emscripten through Docker, which the ubuntu runners provide.
|
||||||
|
|
||||||
|
**Windows needs a newer npm than its runner ships.** `windows-latest` is Windows Server 2025 **with Visual
|
||||||
|
Studio 2026**, and the node-gyp bundled with that image's npm (11.5.0) reads VS 18 as
|
||||||
|
`unknown version "undefined"` and then reports "Could not find any Visual Studio installation to use", so
|
||||||
|
`npm ci` fails in the install script. node-gyp learned VS 2026 in 12.1.0 and npm 12 bundles 13, which is why
|
||||||
|
both jobs that compile the addon there — CI's Node binding and the release's `prebuild` — install `npm@^12`
|
||||||
|
first. Pinning `windows-2022` instead would work, at the price of testing against a toolchain the image no
|
||||||
|
longer has. Installs of the published package never meet this: they unpack a prebuild and never run node-gyp.
|
||||||
|
|
||||||
**The npm package must carry its prebuilds**, or `npm install` runs `node-gyp-build`, finds nothing and
|
**The npm package must carry its prebuilds**, or `npm install` runs `node-gyp-build`, finds nothing and
|
||||||
compiles, which fails on an image without `python3`, `make` and a compiler — `node:20-slim`, for instance.
|
compiles, which fails on an image without `python3`, `make` and a compiler — `node:20-slim`, for instance.
|
||||||
0.1.0 was published by hand before the workflow existed and shipped none, which is what that image hit. The
|
0.1.0 was published by hand before the workflow existed and shipped none, which is what that image hit. The
|
||||||
|
|||||||
Reference in new issue
Block a user