From d1e747a02031ff98e42198a9dc77391d91638344 Mon Sep 17 00:00:00 2001 From: Nigro Simone Date: Wed, 30 Sep 2026 18:13:38 +0200 Subject: [PATCH] benchmark,tools: fix napi benchmarks on GHA The GHA benchmark never built the addons of benchmark/napi, and its --debug-node build made benchmark/common.js look for them in build/Debug. Build them when the napi category runs, and pick the build type as test/common does. Refs: https://github.com/nodejs/node/pull/66395 Signed-off-by: Nigro Simone --- .github/workflows/benchmark.yml | 6 +++++- benchmark/common.js | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index a5cebb3ca899..17d008fb02a9 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -140,7 +140,7 @@ jobs: run: | nix-shell \ -I nixpkgs=./tools/nix/pkgs.nix \ - --pure --keep SCCACHE_LOCAL_RW_MODE \ + --pure --keep SCCACHE_LOCAL_RW_MODE --keep CATEGORIES \ --arg useSeparateDerivationForV8 true \ --arg withPerfetto ${{ matrix.perfetto || false }} \ --arg loadJSBuiltinsDynamically false \ @@ -148,10 +148,14 @@ jobs: --arg devTools '[]' \ --arg benchmarkTools '[]' \ --run ' + set -e make build-ci -j4 V=1 + # The napi benchmarks load addons of their own, both binaries use these. + if [[ " $CATEGORIES " == *" napi "* ]]; then make bench-addons-build; fi ' env: SCCACHE_LOCAL_RW_MODE: READ_ONLY + CATEGORIES: ${{ inputs.category }} - name: Run benchmark run: | diff --git a/benchmark/common.js b/benchmark/common.js index fa108b706831..734c664c80f5 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -470,7 +470,11 @@ module.exports = { return process.binding(bindingName); } }, - buildType: process.features.debug ? 'Debug' : 'Release', + // As in test/common: a --debug-node build is still a Release build, and its + // addons are in build/Release. + buildType: process.config.target_defaults ? + process.config.target_defaults.default_configuration : + 'Release', createBenchmark(fn, configs, options) { return new Benchmark(fn, configs, options); },