From 8e84aa120729cc23a0b355d1f25a9ca04af47aff Mon Sep 17 00:00:00 2001 From: StefanStojanovic Date: Wed, 9 Sep 2026 08:24:06 +0200 Subject: [PATCH 1/7] build,win: fix Perfetto Signed-off-by: StefanStojanovic --- deps/perfetto/perfetto.gyp | 8 ++++++++ node.gypi | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/deps/perfetto/perfetto.gyp b/deps/perfetto/perfetto.gyp index 083d0b386dd2..697256401a3a 100644 --- a/deps/perfetto/perfetto.gyp +++ b/deps/perfetto/perfetto.gyp @@ -18,6 +18,14 @@ 'sources': [ '<@(perfetto_sdk_sources)', ], + 'conditions': [ + ['OS=="win"', { + 'defines': [ + 'WIN32_LEAN_AND_MEAN', + 'NOMINMAX', + ], + }], + ], }, ] } diff --git a/node.gypi b/node.gypi index 9eb972adc47f..3ca9d4633d04 100644 --- a/node.gypi +++ b/node.gypi @@ -93,6 +93,11 @@ [ 'OS=="linux" and target_arch=="s390x"', { 'cflags': [ '-march=z14' ], }], + [ 'v8_use_perfetto==1 and node_shared_perfetto=="false"', { + 'dependencies': [ + 'deps/perfetto/perfetto.gyp:perfetto_sdk', + ], + }], [ 'node_enable_d8=="true"', { 'dependencies': [ 'tools/v8_gypfiles/d8.gyp:d8' ], }], From d4077b8527abdf0024b0edb7bb2f18a5a1ae2a6e Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 13 Oct 2026 13:00:16 +0200 Subject: [PATCH 2/7] test: skip trace-events tests inside unusual char dirs Refs: https://github.com/google/perfetto/issues/7590 Signed-off-by: Antoine du Hamel --- test/trace_events/test-trace-events-all.js | 5 +++++ test/trace_events/test-trace-events-api.js | 5 +++++ test/trace_events/test-trace-events-async-hooks-worker.js | 5 +++++ test/trace_events/test-trace-events-async-hooks.js | 5 +++++ test/trace_events/test-trace-events-bootstrap.js | 5 +++++ test/trace_events/test-trace-events-environment.js | 5 +++++ test/trace_events/test-trace-events-file-pattern.js | 5 +++++ test/trace_events/test-trace-events-fs-sync.js | 5 +++++ test/trace_events/test-trace-events-http.js | 5 +++++ test/trace_events/test-trace-events-net-abstract-socket.js | 5 +++++ test/trace_events/test-trace-events-net.js | 5 +++++ test/trace_events/test-trace-events-process-exit.js | 5 +++++ test/trace_events/test-trace-events-promises.js | 5 +++++ test/trace_events/test-trace-events-threadpool.js | 5 +++++ test/trace_events/test-trace-events-v8.js | 5 +++++ test/trace_events/test-trace-events-vm.js | 5 +++++ 16 files changed, 80 insertions(+) diff --git a/test/trace_events/test-trace-events-all.js b/test/trace_events/test-trace-events-all.js index fe422d03a77a..18979f0636d7 100644 --- a/test/trace_events/test-trace-events-all.js +++ b/test/trace_events/test-trace-events-all.js @@ -1,5 +1,10 @@ 'use strict'; const common = require('../common'); + +if (common.isInsideDirWithUnusualChars) { + common.skip('Test is broken in directories with unusual characters'); +} + const assert = require('assert'); const cp = require('child_process'); const fs = require('fs'); diff --git a/test/trace_events/test-trace-events-api.js b/test/trace_events/test-trace-events-api.js index 6d50213d7750..55d0766c4f4e 100644 --- a/test/trace_events/test-trace-events-api.js +++ b/test/trace_events/test-trace-events-api.js @@ -2,6 +2,11 @@ 'use strict'; const common = require('../common'); + +if (common.isInsideDirWithUnusualChars) { + common.skip('Test is broken in directories with unusual characters'); +} + const { isMainThread } = require('worker_threads'); if (!isMainThread) { diff --git a/test/trace_events/test-trace-events-async-hooks-worker.js b/test/trace_events/test-trace-events-async-hooks-worker.js index 4fdeb2138ebe..0539756dcf49 100644 --- a/test/trace_events/test-trace-events-async-hooks-worker.js +++ b/test/trace_events/test-trace-events-async-hooks-worker.js @@ -4,6 +4,11 @@ // affects the workers. const common = require('../common'); + +if (common.isInsideDirWithUnusualChars) { + common.skip('Test is broken in directories with unusual characters'); +} + try { require('trace_events'); } catch { diff --git a/test/trace_events/test-trace-events-async-hooks.js b/test/trace_events/test-trace-events-async-hooks.js index c404402594a1..b0b1db50339f 100644 --- a/test/trace_events/test-trace-events-async-hooks.js +++ b/test/trace_events/test-trace-events-async-hooks.js @@ -1,5 +1,10 @@ 'use strict'; const common = require('../common'); + +if (common.isInsideDirWithUnusualChars) { + common.skip('Test is broken in directories with unusual characters'); +} + const assert = require('assert'); const cp = require('child_process'); const fs = require('fs'); diff --git a/test/trace_events/test-trace-events-bootstrap.js b/test/trace_events/test-trace-events-bootstrap.js index dfead479bb7c..6a4589e8d0cd 100644 --- a/test/trace_events/test-trace-events-bootstrap.js +++ b/test/trace_events/test-trace-events-bootstrap.js @@ -1,5 +1,10 @@ 'use strict'; const common = require('../common'); + +if (common.isInsideDirWithUnusualChars) { + common.skip('Test is broken in directories with unusual characters'); +} + const assert = require('assert'); const cp = require('child_process'); const fs = require('fs'); diff --git a/test/trace_events/test-trace-events-environment.js b/test/trace_events/test-trace-events-environment.js index 07561e58a948..43bb86b4fa0a 100644 --- a/test/trace_events/test-trace-events-environment.js +++ b/test/trace_events/test-trace-events-environment.js @@ -2,6 +2,11 @@ 'use strict'; const common = require('../common'); + +if (common.isInsideDirWithUnusualChars) { + common.skip('Test is broken in directories with unusual characters'); +} + const assert = require('assert'); const cp = require('child_process'); const fs = require('fs'); diff --git a/test/trace_events/test-trace-events-file-pattern.js b/test/trace_events/test-trace-events-file-pattern.js index 4b053aeb60cb..8d1cf1942b0d 100644 --- a/test/trace_events/test-trace-events-file-pattern.js +++ b/test/trace_events/test-trace-events-file-pattern.js @@ -1,5 +1,10 @@ 'use strict'; const common = require('../common'); + +if (common.isInsideDirWithUnusualChars) { + common.skip('Test is broken in directories with unusual characters'); +} + const tmpdir = require('../common/tmpdir'); const assert = require('assert'); const cp = require('child_process'); diff --git a/test/trace_events/test-trace-events-fs-sync.js b/test/trace_events/test-trace-events-fs-sync.js index 0fddb93dfda7..394494347f4d 100644 --- a/test/trace_events/test-trace-events-fs-sync.js +++ b/test/trace_events/test-trace-events-fs-sync.js @@ -1,5 +1,10 @@ 'use strict'; const common = require('../common'); + +if (common.isInsideDirWithUnusualChars) { + common.skip('Test is broken in directories with unusual characters'); +} + const assert = require('assert'); const cp = require('child_process'); const fs = require('fs'); diff --git a/test/trace_events/test-trace-events-http.js b/test/trace_events/test-trace-events-http.js index 32c8bc7d1674..e70d92e710a3 100644 --- a/test/trace_events/test-trace-events-http.js +++ b/test/trace_events/test-trace-events-http.js @@ -1,5 +1,10 @@ 'use strict'; const common = require('../common'); + +if (common.isInsideDirWithUnusualChars) { + common.skip('Test is broken in directories with unusual characters'); +} + const assert = require('assert'); const cp = require('child_process'); const fs = require('fs'); diff --git a/test/trace_events/test-trace-events-net-abstract-socket.js b/test/trace_events/test-trace-events-net-abstract-socket.js index 4f933be8dd8f..6ca2280fa8b7 100644 --- a/test/trace_events/test-trace-events-net-abstract-socket.js +++ b/test/trace_events/test-trace-events-net-abstract-socket.js @@ -1,5 +1,10 @@ 'use strict'; const common = require('../common'); + +if (common.isInsideDirWithUnusualChars) { + common.skip('Test is broken in directories with unusual characters'); +} + const assert = require('assert'); const cp = require('child_process'); const fs = require('fs'); diff --git a/test/trace_events/test-trace-events-net.js b/test/trace_events/test-trace-events-net.js index 90d501984aa7..b31b189caa93 100644 --- a/test/trace_events/test-trace-events-net.js +++ b/test/trace_events/test-trace-events-net.js @@ -1,5 +1,10 @@ 'use strict'; const common = require('../common'); + +if (common.isInsideDirWithUnusualChars) { + common.skip('Test is broken in directories with unusual characters'); +} + const assert = require('assert'); const cp = require('child_process'); const fs = require('fs'); diff --git a/test/trace_events/test-trace-events-process-exit.js b/test/trace_events/test-trace-events-process-exit.js index cb09c1e3cdcc..6e2db0fbe491 100644 --- a/test/trace_events/test-trace-events-process-exit.js +++ b/test/trace_events/test-trace-events-process-exit.js @@ -1,5 +1,10 @@ 'use strict'; const common = require('../common'); + +if (common.isInsideDirWithUnusualChars) { + common.skip('Test is broken in directories with unusual characters'); +} + const assert = require('assert'); const cp = require('child_process'); const fs = require('fs'); diff --git a/test/trace_events/test-trace-events-promises.js b/test/trace_events/test-trace-events-promises.js index d633d55cab3d..5650c6133f37 100644 --- a/test/trace_events/test-trace-events-promises.js +++ b/test/trace_events/test-trace-events-promises.js @@ -1,5 +1,10 @@ 'use strict'; const common = require('../common'); + +if (common.isInsideDirWithUnusualChars) { + common.skip('Test is broken in directories with unusual characters'); +} + const assert = require('assert'); const cp = require('child_process'); const fs = require('fs'); diff --git a/test/trace_events/test-trace-events-threadpool.js b/test/trace_events/test-trace-events-threadpool.js index d0cfeff7a868..8f6012e430e1 100644 --- a/test/trace_events/test-trace-events-threadpool.js +++ b/test/trace_events/test-trace-events-threadpool.js @@ -1,5 +1,10 @@ 'use strict'; const common = require('../common'); + +if (common.isInsideDirWithUnusualChars) { + common.skip('Test is broken in directories with unusual characters'); +} + const assert = require('assert'); const cp = require('child_process'); const fs = require('fs'); diff --git a/test/trace_events/test-trace-events-v8.js b/test/trace_events/test-trace-events-v8.js index d6c3821407e2..031c25106a53 100644 --- a/test/trace_events/test-trace-events-v8.js +++ b/test/trace_events/test-trace-events-v8.js @@ -1,5 +1,10 @@ 'use strict'; const common = require('../common'); + +if (common.isInsideDirWithUnusualChars) { + common.skip('Test is broken in directories with unusual characters'); +} + const assert = require('assert'); const cp = require('child_process'); const fs = require('fs'); diff --git a/test/trace_events/test-trace-events-vm.js b/test/trace_events/test-trace-events-vm.js index c2b9d95e0f04..00ef5d3928c8 100644 --- a/test/trace_events/test-trace-events-vm.js +++ b/test/trace_events/test-trace-events-vm.js @@ -1,5 +1,10 @@ 'use strict'; const common = require('../common'); + +if (common.isInsideDirWithUnusualChars) { + common.skip('Test is broken in directories with unusual characters'); +} + const assert = require('assert'); const cp = require('child_process'); const fs = require('fs'); From 1015f6ceafe978b415ecd52bda3f1cdb16dfc9cd Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 4 Sep 2026 16:47:36 +0200 Subject: [PATCH 3/7] build: enable Perfetto by default Signed-off-by: Antoine du Hamel --- .github/workflows/benchmark.yml | 5 +- .github/workflows/test-linux-perfetto.yml | 73 ----------------------- .github/workflows/test-shared.yml | 5 +- configure.py | 12 ++-- shell.nix | 6 +- tools/nix/sharedLibDeps.nix | 4 +- tools/nix/v8.nix | 2 +- 7 files changed, 14 insertions(+), 93 deletions(-) delete mode 100644 .github/workflows/test-linux-perfetto.yml diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 9f4ed58447df..717f791a175f 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -71,14 +71,13 @@ jobs: include: - runner: ubuntu-24.04 system: x86_64-linux - perfetto: true - runner: ubuntu-24.04-arm system: aarch64-linux - runner: macos-15-intel system: x86_64-darwin - runner: macos-latest system: aarch64-darwin - name: '${{ matrix.system }}: with shared libraries${{ matrix.perfetto && '' and perfetto'' || '''' }}' + name: '${{ matrix.system }}: with shared libraries' runs-on: ${{ matrix.runner }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -121,7 +120,6 @@ jobs: --pure --keep TAR_DIR --keep FLAKY_TESTS \ --keep SCCACHE_GHA_ENABLED --keep SCCACHE_GHA_RW_MODE \ --keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN \ - --arg withPerfetto ${{ matrix.perfetto || false }} \ --arg ccache '(import {}).sccache' \ --run ' make build-ci -j4 V=1 && sccache --stop-server @@ -137,7 +135,6 @@ jobs: nix-shell \ -I nixpkgs=./tools/nix/pkgs.nix \ --pure --keep SCCACHE_LOCAL_RW_MODE \ - --arg withPerfetto ${{ matrix.perfetto || false }} \ --arg ccache '(import {}).sccache' \ --run ' make build-ci -j4 V=1 ${{ contains(format(' {0} ', inputs.category), ' napi ') && '&& make bench-addons-build' || '' }} diff --git a/.github/workflows/test-linux-perfetto.yml b/.github/workflows/test-linux-perfetto.yml deleted file mode 100644 index edc7e5c3a772..000000000000 --- a/.github/workflows/test-linux-perfetto.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: Test Linux (with Perfetto) - -on: - workflow_dispatch: - pull_request: - # Only targeting paths specific to the vendored version of Perfetto, `test-shared` - # is taking care of rest of the coverage. - paths: - - .github/workflows/test-linux-perfetto.yml - - common.gypi - - configure.py - - deps/perfetto/** - - node.gyp - - node.gypi - - tools/v8_gypfiles/v8.gyp - types: [opened, synchronize, reopened, ready_for_review] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -env: - PYTHON_VERSION: '3.15' - FLAKY_TESTS: keep_retrying - CLANG_VERSION: '19' - CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang-19 - CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang++-19 - SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }} - SCCACHE_IDLE_TIMEOUT: '0' - RUSTC_VERSION: '1.88' - -permissions: - contents: read - -jobs: - test-perfetto: - if: github.event.pull_request.draft == false - runs-on: ubuntu-24.04-arm - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - path: node - - name: Install Clang ${{ env.CLANG_VERSION }} - uses: $/.github/actions/install-clang - with: - clang-version: ${{ env.CLANG_VERSION }} - - name: Install Rust ${{ env.RUSTC_VERSION }} - run: | - rustup override set "$RUSTC_VERSION" - rustup --version - - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 - with: - python-version: ${{ env.PYTHON_VERSION }} - allow-prereleases: true - - name: Set up sccache - if: github.base_ref == 'main' || github.ref_name == 'main' - uses: Mozilla-Actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11 - with: - version: v0.17.0 - - name: Build - working-directory: node - run: make build-ci -j4 V=1 CONFIG_FLAGS="--error-on-warn --v8-enable-temporal-support --with-perfetto" - - name: Get trace_processor - working-directory: node - run: make tools/perfetto/trace_processor_shell - - name: Test - working-directory: node - run: make test-ci -j1 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9" - - name: Ensure running tests did not cause any change in the tree - working-directory: node - run: git add -A && git diff --name-only --exit-code --staged diff --git a/.github/workflows/test-shared.yml b/.github/workflows/test-shared.yml index 8292ac253fd2..afd6c706c065 100644 --- a/.github/workflows/test-shared.yml +++ b/.github/workflows/test-shared.yml @@ -153,8 +153,6 @@ jobs: include: - runner: ubuntu-24.04 system: x86_64-linux - # Exercise the trace-event code against a perfetto-enabled V8. - perfetto: true # built separately in build-aarch64-linux-v8 # - runner: ubuntu-24.04-arm # system: aarch64-linux @@ -162,12 +160,11 @@ jobs: system: x86_64-darwin - runner: macos-latest system: aarch64-darwin - name: '${{ matrix.system }}: with shared libraries${{ matrix.perfetto && '' and perfetto'' || '''' }}' + name: '${{ matrix.system }}: with shared libraries' uses: $/.github/workflows/build-shared.yml with: runner: ${{ matrix.runner }} with-sccache: ${{ github.base_ref == 'main' || github.ref_name == 'main' }} - extra-nix-flags: ${{ matrix.perfetto && '--arg withPerfetto true' || '' }} secrets: CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} diff --git a/configure.py b/configure.py index e38dd91cdb9d..61139198bcab 100755 --- a/configure.py +++ b/configure.py @@ -1171,11 +1171,11 @@ default=None, help='disable the V8 inspector protocol') -parser.add_argument('--with-perfetto', +parser.add_argument('--without-perfetto', action='store_true', - dest='with_perfetto', + dest='without_perfetto', default=None, - help='enable perfetto support') + help='disable perfetto support') parser.add_argument('--shared', action='store_true', @@ -2275,7 +2275,7 @@ def configure_v8(o, configs): options.v8_disable_temporal_support = True o['variables']['v8_enable_temporal_support'] = 0 if options.v8_disable_temporal_support else 1 o['variables']['v8_trace_maps'] = 1 if options.trace_maps else 0 - o['variables']['v8_use_perfetto'] = 1 if options.with_perfetto else 0 + o['variables']['v8_use_perfetto'] = 0 if options.without_perfetto else 1 o['variables']['node_use_v8_platform'] = b(not options.without_v8_platform) o['variables']['node_use_bundled_v8'] = b(not options.without_bundled_v8) o['variables']['force_dynamic_crt'] = 1 if options.shared else 0 @@ -2399,9 +2399,9 @@ def configure_lief(o): configure_library('lief', o, pkgname='LIEF') def configure_perfetto(o): - if not options.with_perfetto: + if options.without_perfetto: if options.shared_perfetto: - error('--shared-perfetto requires --with-perfetto') + error('--without-perfetto is incompatible with --shared-perfetto') o['variables']['node_shared_perfetto'] = b(False) return diff --git a/shell.nix b/shell.nix index a1d917bf864a..8da90a6ba71d 100644 --- a/shell.nix +++ b/shell.nix @@ -13,13 +13,13 @@ # Build options icu ? pkgs.icu, withAmaro ? true, + withFFI ? true, withLief ? true, + withPerfetto ? true, withQuic ? false, withSQLite ? true, - withFFI ? true, withSSL ? true, withTemporal ? true, - withPerfetto ? false, sharedLibDeps ? ( import ./tools/nix/sharedLibDeps.nix { inherit @@ -87,7 +87,7 @@ let "--v8-${if withTemporal then "enable" else "disable"}-temporal-support" ] ++ builtins.map (depName: "--shared-${depName}") sharedV8Deps - ++ pkgs.lib.optional withPerfetto "--with-perfetto"; + ++ pkgs.lib.optional (!withPerfetto) "--without-perfetto"; in pkgs.mkShell { inherit nativeBuildInputs; diff --git a/tools/nix/sharedLibDeps.nix b/tools/nix/sharedLibDeps.nix index 41a406237daa..f77ed162550a 100644 --- a/tools/nix/sharedLibDeps.nix +++ b/tools/nix/sharedLibDeps.nix @@ -1,11 +1,11 @@ { pkgs ? import ./pkgs.nix { }, + withFFI ? true, withLief ? true, + withPerfetto ? true, withQuic ? false, withSQLite ? true, withSSL ? true, - withFFI ? true, - withPerfetto ? false, withTemporal ? true, }: { diff --git a/tools/nix/v8.nix b/tools/nix/v8.nix index 8b9f1796e068..e757ebc69c04 100644 --- a/tools/nix/v8.nix +++ b/tools/nix/v8.nix @@ -59,7 +59,7 @@ let !(builtins.elem "--v8-disable-temporal-support" configureFlags) ) ../../deps/crates ++ lib.optional ( - builtins.elem "--with-perfetto" configureFlags && !useSharedPerfetto + !(builtins.elem "--without-perfetto" configureFlags) && !useSharedPerfetto ) ../../deps/perfetto ++ lib.optionals (icu != null) [ ../../tools/icu/icu_versions.json From 37bf2af8a96e74ddc1b89893ee4e7b02ef0a3f06 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Thu, 10 Sep 2026 17:37:26 +0200 Subject: [PATCH 4/7] fixup! build: enable Perfetto by default except on incompatible platforms --- configure.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/configure.py b/configure.py index 61139198bcab..258dffac7461 100755 --- a/configure.py +++ b/configure.py @@ -2275,7 +2275,7 @@ def configure_v8(o, configs): options.v8_disable_temporal_support = True o['variables']['v8_enable_temporal_support'] = 0 if options.v8_disable_temporal_support else 1 o['variables']['v8_trace_maps'] = 1 if options.trace_maps else 0 - o['variables']['v8_use_perfetto'] = 0 if options.without_perfetto else 1 + o['variables']['v8_use_perfetto'] = 0 if options.without_perfetto or not perfetto_supported() else 1 o['variables']['node_use_v8_platform'] = b(not options.without_v8_platform) o['variables']['node_use_bundled_v8'] = b(not options.without_bundled_v8) o['variables']['force_dynamic_crt'] = 1 if options.shared else 0 @@ -2398,12 +2398,20 @@ def configure_lief(o): configure_library('lief', o, pkgname='LIEF') +def perfetto_supported(): + return flavor not in ('aix', 'cloudabi', 'openbsd', 'os400', 'solaris') + def configure_perfetto(o): if options.without_perfetto: if options.shared_perfetto: error('--without-perfetto is incompatible with --shared-perfetto') o['variables']['node_shared_perfetto'] = b(False) return + if options.without_perfetto is None and not perfetto_supported(): + warn(f'Perfetto is disabled for {flavor}: the bundled perfetto integration ' + 'is not available on this platform. Pass --without-perfetto to ' + 'silence this warning.') + return configure_library('perfetto', o) From b50170c07bb8351cf960115b81fa31ab12666d4a Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 23 Sep 2026 13:48:39 +0200 Subject: [PATCH 5/7] fixup! build: enable Perfetto by default add TRACE_PROCESSOR_SHELL_PATH as dependency of JS test --- Makefile | 7 +++++-- shell.nix | 5 ++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 31d7d911c987..18cde81c9b72 100644 --- a/Makefile +++ b/Makefile @@ -321,7 +321,9 @@ v8: ## Build deps/v8. tools/make-v8.sh $(V8_ARCH).$(BUILDTYPE_LOWER) $(V8_BUILD_OPTIONS) .PHONY: jstest -jstest: build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests build-ffi-tests ## Run addon tests and JS tests. +## Run addon tests and JS tests. +jstest: build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests build-ffi-tests $(TRACE_PROCESSOR_SHELL_PATH)) + @out/$(BUILDTYPE)/cctest --gtest_list_tests $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) \ $(TEST_CI_ARGS) \ --skip-tests=$(CI_SKIP_TESTS) \ @@ -348,6 +350,7 @@ ifeq ($(TRACE_PROCESSOR_SHELL_PATH),tools/perfetto/trace_processor_shell) TRACE_PROCESSOR_SHELL_DEPS = deps/perfetto/VERSION endif +# Set TRACE_PROCESSOR_SHELL_PATH=/dev/null to disable the download $(TRACE_PROCESSOR_SHELL_PATH): $(TRACE_PROCESSOR_SHELL_DEPS) @tools/perfetto/get_trace_processor $@ @@ -660,7 +663,7 @@ test-ci-js: | clear-stalled ## Build and test JavaScript with building anything .PHONY: test-ci # Related CI jobs: most CI tests, excluding node-test-commit-arm-fanned test-ci: LOGLEVEL := info ## Build and test everything (CI). -test-ci: | clear-stalled bench-addons-build build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests build-ffi-tests doc-only +test-ci: | clear-stalled bench-addons-build build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests build-ffi-tests doc-only $(TRACE_PROCESSOR_SHELL_PATH) out/Release/cctest --gtest_output=xml:out/junit/cctest.xml $(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \ --mode=$(BUILDTYPE_LOWER) --flaky-tests=$(FLAKY_TESTS) \ diff --git a/shell.nix b/shell.nix index 8da90a6ba71d..4700ce9bc520 100644 --- a/shell.nix +++ b/shell.nix @@ -144,6 +144,8 @@ pkgs.mkShell { ) ) ); + TRACE_PROCESSOR_SHELL_PATH = + if withPerfetto then "${pkgs.perfetto.tools}/bin/trace_processor_shell" else "/dev/null"; } // ( let @@ -172,9 +174,6 @@ pkgs.mkShell { // pkgs.lib.optionalAttrs (!withSQLite) { NOSQLITE = "1"; } - // pkgs.lib.optionalAttrs (withPerfetto) { - TRACE_PROCESSOR_SHELL_PATH = "${pkgs.perfetto.tools}/bin/trace_processor_shell"; - } // pkgs.lib.optionalAttrs (pkcs11 != false && pkcs11 != null) ( let pkcs11' = From 00658d64589e48e00b59377016fcdd4135d46241 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sat, 3 Oct 2026 16:19:00 +0200 Subject: [PATCH 6/7] fixup! fixup! build: enable Perfetto by default --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 18cde81c9b72..3716dfc0e3bf 100644 --- a/Makefile +++ b/Makefile @@ -322,8 +322,7 @@ v8: ## Build deps/v8. .PHONY: jstest ## Run addon tests and JS tests. -jstest: build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests build-ffi-tests $(TRACE_PROCESSOR_SHELL_PATH)) - @out/$(BUILDTYPE)/cctest --gtest_list_tests +jstest: build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests build-ffi-tests $(TRACE_PROCESSOR_SHELL_PATH) $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) \ $(TEST_CI_ARGS) \ --skip-tests=$(CI_SKIP_TESTS) \ From 8865681a439022c2811911b8d3c2e713e0d23639 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sat, 3 Oct 2026 16:53:17 +0200 Subject: [PATCH 7/7] fixup! fixup! build: enable Perfetto by default --- Makefile | 31 ++++++++++++++++--------------- configure.py | 4 ++-- shell.nix | 5 +++-- test/trace_events/README.md | 4 ++-- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index 3716dfc0e3bf..84a21b605b37 100644 --- a/Makefile +++ b/Makefile @@ -320,9 +320,23 @@ v8: ## Build deps/v8. export PATH="$(NO_BIN_OVERRIDE_PATH)" && \ tools/make-v8.sh $(V8_ARCH).$(BUILDTYPE_LOWER) $(V8_BUILD_OPTIONS) +ifneq ($(V8_USE_PERFETTO),0) +TRACE_PROCESSOR_SHELL_PATH ?= tools/perfetto/trace_processor_shell + +# The downloaded copy has to match the vendored perfetto, so a version bump +# re-downloads it. An overridden path is a build we do not manage and may not +# be writable, so it gets no prerequisite and is left alone once it exists. +ifeq ($(TRACE_PROCESSOR_SHELL_PATH),tools/perfetto/trace_processor_shell) +TRACE_PROCESSOR_SHELL_DEPS = deps/perfetto/VERSION +endif + +$(TRACE_PROCESSOR_SHELL_PATH): $(TRACE_PROCESSOR_SHELL_DEPS) + @tools/perfetto/get_trace_processor $@ + +endif # + .PHONY: jstest -## Run addon tests and JS tests. -jstest: build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests build-ffi-tests $(TRACE_PROCESSOR_SHELL_PATH) +jstest: build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests build-ffi-tests $(TRACE_PROCESSOR_SHELL_PATH) ## Run addon tests and JS tests. $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) \ $(TEST_CI_ARGS) \ --skip-tests=$(CI_SKIP_TESTS) \ @@ -340,19 +354,6 @@ coverage-run-js: ## Run JavaScript tests with coverage. TEST_CI_ARGS="$(TEST_CI_ARGS) --type=coverage" $(MAKE) jstest $(MAKE) coverage-report-js -TRACE_PROCESSOR_SHELL_PATH ?= tools/perfetto/trace_processor_shell - -# The downloaded copy has to match the vendored perfetto, so a version bump -# re-downloads it. An overridden path is a build we do not manage and may not -# be writable, so it gets no prerequisite and is left alone once it exists. -ifeq ($(TRACE_PROCESSOR_SHELL_PATH),tools/perfetto/trace_processor_shell) -TRACE_PROCESSOR_SHELL_DEPS = deps/perfetto/VERSION -endif - -# Set TRACE_PROCESSOR_SHELL_PATH=/dev/null to disable the download -$(TRACE_PROCESSOR_SHELL_PATH): $(TRACE_PROCESSOR_SHELL_DEPS) - @tools/perfetto/get_trace_processor $@ - .PHONY: test # This does not run tests of third-party libraries inside deps. test: all ## Run default tests and build docs. diff --git a/configure.py b/configure.py index 258dffac7461..cd857374132b 100755 --- a/configure.py +++ b/configure.py @@ -551,8 +551,7 @@ action='store_true', dest='shared_perfetto', default=None, - help='link to a shared perfetto SDK instead of the one in deps/perfetto ' - '(requires --with-perfetto)') + help='link to a shared perfetto SDK instead of the one in deps/perfetto') shared_optgroup.add_argument('--shared-perfetto-includes', action='store', @@ -3071,6 +3070,7 @@ def make_bin_override(): config = { 'BUILDTYPE': 'Debug' if options.debug else 'Release', 'NODE_TARGET_TYPE': variables['node_target_type'], + 'V8_USE_PERFETTO': str(variables['v8_use_perfetto']), } # Not needed for trivial case. Useless when it's a win32 path. diff --git a/shell.nix b/shell.nix index 4700ce9bc520..8da90a6ba71d 100644 --- a/shell.nix +++ b/shell.nix @@ -144,8 +144,6 @@ pkgs.mkShell { ) ) ); - TRACE_PROCESSOR_SHELL_PATH = - if withPerfetto then "${pkgs.perfetto.tools}/bin/trace_processor_shell" else "/dev/null"; } // ( let @@ -174,6 +172,9 @@ pkgs.mkShell { // pkgs.lib.optionalAttrs (!withSQLite) { NOSQLITE = "1"; } + // pkgs.lib.optionalAttrs (withPerfetto) { + TRACE_PROCESSOR_SHELL_PATH = "${pkgs.perfetto.tools}/bin/trace_processor_shell"; + } // pkgs.lib.optionalAttrs (pkcs11 != false && pkcs11 != null) ( let pkcs11' = diff --git a/test/trace_events/README.md b/test/trace_events/README.md index 756dd9aeba63..32c597c7b790 100644 --- a/test/trace_events/README.md +++ b/test/trace_events/README.md @@ -1,11 +1,11 @@ # `trace_events` Tests -When the `node` binary is built with configure flag `--with-perfetto`, +When the `node` binary is not built with configure flag `--without-perfetto`, the tests in this folder depends on `tools/perfetto/trace_processor_shell`, which is downloaded with `tools/perfetto/get_trace_processor` via `make tools/perfetto/trace_processor_shell`, to convert Perfetto binary trace files to JSON format. Set `TRACE_PROCESSOR_SHELL_PATH` to use an existing build -of the tool instead of downloading a release. +of the tool to disable downloading a release. Refer to for help of the `trace_processor_shell` CLI.