From a42ed4743da1ec4de92ac33f7e169f608db0bbe0 Mon Sep 17 00:00:00 2001 From: Mark IJbema Date: Mon, 29 Jun 2026 13:33:18 +0200 Subject: [PATCH 1/3] fix(ci): use local node headers for native deps --- .github/actions/setup-bun/action.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/actions/setup-bun/action.yml b/.github/actions/setup-bun/action.yml index 5b44517ec5..b3551d0ac0 100644 --- a/.github/actions/setup-bun/action.yml +++ b/.github/actions/setup-bun/action.yml @@ -42,6 +42,31 @@ runs: restore-keys: | ${{ runner.os }}-bun- + # kilocode_change start + - name: Setup Node for native dependency builds + uses: actions/setup-node@v6 + with: + node-version: "24" + package-manager-cache: false + + - name: Configure node-gyp Node headers + run: | + node <<'NODE' + const fs = require("node:fs") + const path = require("node:path") + + const exe = path.dirname(fs.realpathSync(process.execPath)) + const dirs = [exe, path.dirname(exe)] + const root = dirs.find((dir) => fs.existsSync(path.join(dir, "include", "node", "node.h"))) + if (!root) { + throw new Error(`Node headers not found under ${dirs.join(", ")}`) + } + + fs.appendFileSync(process.env.GITHUB_ENV, `npm_config_nodedir=${root}\n`) + NODE + shell: bash + # kilocode_change end + - name: Install setuptools for distutils compatibility run: python3 -m pip install setuptools || pip install setuptools || true shell: bash From bf96052b2419c9a95bf1102deb364148343fa582 Mon Sep 17 00:00:00 2001 From: Mark IJbema Date: Mon, 29 Jun 2026 13:56:35 +0200 Subject: [PATCH 2/3] fix(ci): skip local node headers on windows --- .github/actions/setup-bun/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/setup-bun/action.yml b/.github/actions/setup-bun/action.yml index b3551d0ac0..a55acce8a1 100644 --- a/.github/actions/setup-bun/action.yml +++ b/.github/actions/setup-bun/action.yml @@ -44,12 +44,14 @@ runs: # kilocode_change start - name: Setup Node for native dependency builds + if: runner.os != 'Windows' uses: actions/setup-node@v6 with: node-version: "24" package-manager-cache: false - name: Configure node-gyp Node headers + if: runner.os != 'Windows' run: | node <<'NODE' const fs = require("node:fs") From d791d710c1cf9ae81525f15604ad81abd8e05e85 Mon Sep 17 00:00:00 2001 From: Mark IJbema Date: Mon, 29 Jun 2026 14:21:11 +0200 Subject: [PATCH 3/3] fix(ci): scope node-gyp headers to install step --- .github/actions/setup-bun/action.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-bun/action.yml b/.github/actions/setup-bun/action.yml index a55acce8a1..228d05c91e 100644 --- a/.github/actions/setup-bun/action.yml +++ b/.github/actions/setup-bun/action.yml @@ -52,6 +52,7 @@ runs: - name: Configure node-gyp Node headers if: runner.os != 'Windows' + id: node-gyp run: | node <<'NODE' const fs = require("node:fs") @@ -64,7 +65,7 @@ runs: throw new Error(`Node headers not found under ${dirs.join(", ")}`) } - fs.appendFileSync(process.env.GITHUB_ENV, `npm_config_nodedir=${root}\n`) + fs.appendFileSync(process.env.GITHUB_OUTPUT, `nodedir=${root}\n`) NODE shell: bash # kilocode_change end @@ -75,6 +76,12 @@ runs: - name: Install dependencies run: | + # kilocode_change start + if [ "$RUNNER_OS" != "Windows" ]; then + export npm_config_nodedir="${{ steps.node-gyp.outputs.nodedir }}" + fi + # kilocode_change end + # Workaround for patched peer variants # e.g. ./patches/ for standard-openapi # https://github.com/oven-sh/bun/issues/28147