193 Commits
Author SHA1 Message Date
Olivier Flückiger d5ad7d774d [tools] Verify main repo gclient sync in setup_worktree_build.py
Previously, setup_worktree_build.py only compared main_repo/DEPS with
worktree_dir/DEPS and assumed main_repo's dependencies were synced if
the two DEPS files matched. When main_repo had pulled or checked out a
new revision without running gclient sync, worktrees were symlinked to
unsynced dependencies in main_repo.

Check that ../.gclient_entries is at least as new as main_repo/DEPS
before symlinking directly to main_repo; otherwise fall back to
.deps_cache/<hash>.

TAG=agy
CONV=030aee38-e9f1-408a-9fca-9c36359b29d1

Change-Id: I1711292f6e1f6eee4873a48cb96ea2140072e73f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8691065
Commit-Queue: Olivier Flückiger <olivf@chromium.org>
Auto-Submit: Olivier Flückiger <olivf@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Olivier Flückiger <olivf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#111407}
2026-10-30 05:51:43 -07:00
Jakob Kummerow 73d33ee8b3 [gm.py] Fix gm.py for btrfs worktrees
Skip worktree dependency symlink setup in `setup_worktree_build.py` when
`build` already exists as a real directory (not a symlink), which
indicates a pre-populated checkout such as a btrfs CoW snapshot rather
than a normal git worktree.

TAG=agy
CONV=ac1407cc-76ee-4bd6-888d-4b747c3582ce

Change-Id: I563ca80e9776d1dd4e1261d44cdefe82edb4cba8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8615041
Reviewed-by: Olivier Flückiger <olivf@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Olivier Flückiger <olivf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#111009}
2026-10-21 06:22:33 -07:00
Olivier Flückiger 0fd7249475 [heap] Allocate read-only holes before WasmNull
Allocating the holes before WasmNull allows TheHoleValue's 4-byte map
header to fit at the end of the first 64 KiB OS page (0xfffd) instead
of wasting a 64 KiB filler page after WasmNull's page-aligned payload.

This places StaticReadOnlyRoot::kTheHoleValue at 0xfffd across all
static-roots configurations (so it fits in a 16-bit immediate on arm64)
and shrinks ReadOnlySpace by one V8 page. Also handle
V8_STATIC_ROOTS_GENERATION_BOOL in IsWasmNullNoSpaceCheck.

TAG=agy
CONV=5409847f-bf7f-48ca-b6b7-4128aed86b43

Change-Id: I03cbc6660b9f91cb4426d6cb286378351a2daa89
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8570844
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Olivier Flückiger <olivf@chromium.org>
Commit-Queue: Olivier Flückiger <olivf@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#110850}
2026-10-16 04:06:07 -07:00
Jakob Linke 926303f3a4 [metagen] Check in generated files to unblock the build graph
~1000 cpp build targets were previously blocked behind run_torque in the
build graph. This CL checks in widely-used generated files instead for
the most common build config. Instead of regenerating in each build, we
now fail the build when a mismatch is detected.

For now, only the common wasm-intl build uses checked-in headers (and
thus defines V8_USE_CHECKED_IN_GENERATED_HEADERS to swap the include).

The gen headers are written to src/gen/intl-wasm. static-roots.h
additionally supports nointl-wasm, intl-nowasm, and nointl-nowasm. Note
the gen headers rely on more config values than just intl and wasm; see
BUILD.gn.

Before this change, run_torque-blocked targets took 40s until they
started compiling on a cold build. Now they start immediately.

NO_IFTTT=some reason...

Bug: 531344950
Change-Id: I6d724d964b720b5d3a120e8855e930de2aa4d4e4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8352503
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#110808}
2026-10-15 09:18:46 -07:00
Andreas Haas 9251265f9d [tools] Detect Siso remote execution in gm.py
On Linux corp machines (including Cog workspaces), Siso's built-in
remote execution uses build/config/siso/.sisoenv and does not require
download_remoteexec_cfg in .gclient. Teach detect_reclient() in gm.py to
check for .sisoenv and gcert on Linux so newly generated args.gn files
include use_remoteexec = true.

Change-Id: If23c232f1cf27e9d9539ec8cf1dc09aaa653169f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8572037
Reviewed-by: Olivier Flückiger <olivf@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#110694}
2026-10-14 03:55:30 -07:00
Clemens Backes ec1d755a0f [worktree] Filter .gclient to only sync v8 in .deps_cache
When initializing a diverged DEPS cache entry, setup_worktree_build.py
previously copied ../.gclient verbatim. If ../.gclient contained extra
solutions (such as v8-perf), gclient sync would clone and sync those
into every .deps_cache/<hash> directory even though worktrees only ever
use the v8 solution.

Filter the solutions list when writing .deps_cache's .gclient so only
the v8 solution (and its custom_vars/custom_deps) is synced.

TAG=agy
R=jgruber@chromium.org

Change-Id: Idedf3d0a432df1fd1ab65dbe9d9ebb5cf14c8d91
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8549214
Reviewed-by: Olivier Flückiger <olivf@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#110646}
2026-10-13 08:12:00 -07:00
Clemens Backes 527cbc66bd [tools] Run gm.py in quiet mode in gen-static-roots.py
`gen-static-roots.py` invokes `gm.py` multiple times concurrently across
build configurations. Pass `quiet` to `gm.py` to avoid interleaved build
output and repeated completion notifications (see
https://crrev.com/c/8548557).

TAG=agy
R=jkummerow@chromium.org

Change-Id: I7ddd9171a1b6680b812f70635b9e579451367b6d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8560377
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#110610}
2026-10-13 00:51:14 -07:00
Clemens Backes 7477c8ac35 [gm.py] Skip notifications in quiet mode
Quiet mode (added in https://crrev.com/c/6836375) is meant to only
print output on error and is used by default by coding agents. Skip
desktop and console notifications in `_notify()` when `quiet` is
specified to avoid distracting popups, especially when multiple agents
compile independently in parallel.

TAG=agy
R=jkummerow@chromium.org

Change-Id: I27634f4c956c89c5a456807fef16c479edb64ce1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8548557
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#110580}
2026-10-12 13:18:20 -07:00
Clemens Backes 3e1eb61398 [tools] Use a single global lock for .deps_cache operations
Follow up on https://crrev.com/c/8498180 to consolidate file_lock and
try_file_lock into a single context manager and replace per-entry
<hash>.lock files with a global .deps_cache/.lock.

Holding the global cache lock across cache usage/initialization and
prune_cache also closes a TOCTOU race where prune_cache could evict an
entry that a concurrent sync_dependencies started using after
get_referenced_cache_hashes completed.

TAG=agy
R=olivf@chromium.org

Bug: 569942997
Change-Id: Ic499c1970d34054c0d0ac68974622331849ea452
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8512342
Reviewed-by: Olivier Flückiger <olivf@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#110351}
2026-10-06 06:02:48 -07:00
Jakob Linke 2a973dc29f [metagen] Consolidate build flags
Use v8_use_metagen to toggle instance-type and object-layout generation
together in GN, Bazel, and developer tooling. The granular build flags
were only needed during development.

Bug: 531344950
Change-Id: I63343739ef340f9b208d931dee8a4be3dc479a53
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8524366
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#110343}
2026-10-06 03:03:17 -07:00
Clemens Backes 0da18f045e [tools] Automatically prune unreferenced .deps_cache entries
When a git worktree's DEPS differs from the main repository,
setup_worktree_build.py creates a ~11 GB cached gclient sync directory
under worktrees/.deps_cache/<hash>. Previously, old cache entries were
never evicted automatically, accumulating hundreds of gigabytes over
time.

Automatically prune unreferenced .deps_cache entries at the end of
sync_dependencies (and via a new prune-cache subcommand), while
preserving all entries referenced by existing worktrees and at least
the 3 most recently used entries.

R=olivf@chromium.org
CC=jgruber@chromium.org
TAG=agy
CONV=11c837a1-6b3f-4ae6-891c-19a33dba6c13

Change-Id: I0c14c57b1d06cf8dabfa7ac1f5f558355bf4c1f7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8498180
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#110317}
2026-10-05 06:53:30 -07:00
Jakob Linke f931cea7e7 Reland "[torque][metagen] Make C++ the source of truth for object layouts"
This is a reland of commit 2d3fa0264a

The reland fixes v8_verify_torque_generation_invariance builds,
which shouldn't run metagen layout paths.

Original change's description:
> [torque][metagen] Make C++ the source of truth for object layouts
>
> V8_OBJECT class layouts are written twice today, as C++ members and
> again as @cppObjectLayoutDefinition field blocks in .tq. With this CL
> the metagen harvest exports every C++-authored layout into a JSON
> sidecar (schema: tools/metagen/layout_ir.py) and Torque builds its class
> fields from those records. The handwritten .tq field blocks become
> redundant and can be deleted once this has soaked.
>
> Facts that C++ does not encode (accessor constness and synchronization,
> custom weak marking, semantic types like SmiTagged<Flags>, tail
> identity) move into V8_TQ_* member annotations next to the fields they
> describe, visible only to the metagen parse.
>
> Source positions ship separately in layout-positions.json: the facts
> sidecar only changes when a layout actually changes, so unrelated header
> edits no longer re-run torque. The positions file maps every field to
> its C++ member.
>
> Bug: 531344950
> Change-Id: I12e17496b0838f6c55455347f585998ed301e20a
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8309056
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Commit-Queue: Jakob Linke <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#110140}

Bug: 531344950
Change-Id: I7770288ab0e27863e38f807f16d0b9eff886bd95
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8479172
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#110147}
2026-09-29 01:33:37 -07:00
Ryan Diaz 8d1aec6f9b Revert "[torque][metagen] Make C++ the source of truth for object layouts"
This reverts commit 2d3fa0264a.

Reason for revert: Failed V8 Clusterfuzz Linux64 - release builder 

Failure Link: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Clusterfuzz%20Linux64%20-%20release%20builder/57805/overview

Original change's description:
> [torque][metagen] Make C++ the source of truth for object layouts
>
> V8_OBJECT class layouts are written twice today, as C++ members and
> again as @cppObjectLayoutDefinition field blocks in .tq. With this CL
> the metagen harvest exports every C++-authored layout into a JSON
> sidecar (schema: tools/metagen/layout_ir.py) and Torque builds its class
> fields from those records. The handwritten .tq field blocks become
> redundant and can be deleted once this has soaked.
>
> Facts that C++ does not encode (accessor constness and synchronization,
> custom weak marking, semantic types like SmiTagged<Flags>, tail
> identity) move into V8_TQ_* member annotations next to the fields they
> describe, visible only to the metagen parse.
>
> Source positions ship separately in layout-positions.json: the facts
> sidecar only changes when a layout actually changes, so unrelated header
> edits no longer re-run torque. The positions file maps every field to
> its C++ member.
>
> Bug: 531344950
> Change-Id: I12e17496b0838f6c55455347f585998ed301e20a
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8309056
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Commit-Queue: Jakob Linke <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#110140}

Bug: 531344950
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I2c06cef626715c44f767a7ef7c3bea6eb64cf644
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8478463
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Ryan Diaz <ryandiaz@chromium.org>
Auto-Submit: Ryan Diaz <ryandiaz@chromium.org>
Owners-Override: Ryan Diaz <ryandiaz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#110141}
2026-09-28 15:28:21 -07:00
Jakob Linke 2d3fa0264a [torque][metagen] Make C++ the source of truth for object layouts
V8_OBJECT class layouts are written twice today, as C++ members and
again as @cppObjectLayoutDefinition field blocks in .tq. With this CL
the metagen harvest exports every C++-authored layout into a JSON
sidecar (schema: tools/metagen/layout_ir.py) and Torque builds its class
fields from those records. The handwritten .tq field blocks become
redundant and can be deleted once this has soaked.

Facts that C++ does not encode (accessor constness and synchronization,
custom weak marking, semantic types like SmiTagged<Flags>, tail
identity) move into V8_TQ_* member annotations next to the fields they
describe, visible only to the metagen parse.

Source positions ship separately in layout-positions.json: the facts
sidecar only changes when a layout actually changes, so unrelated header
edits no longer re-run torque. The positions file maps every field to
its C++ member.

Bug: 531344950
Change-Id: I12e17496b0838f6c55455347f585998ed301e20a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8309056
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#110140}
2026-09-28 14:59:21 -07:00
Jakob Linke b8ae33c99c [metagen] Don't run metagen targets when the build arg is off
Bug: 531344950
Change-Id: I7e8b1d694d4e7b43974da2ea02408de074db0c67
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8357289
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#109670}
2026-09-04 01:27:37 -07:00
Igor Sheludko 107e13c472 [agents] Validate worktree initialization and fail fast on errors
Ensure create_worktree.sh halts immediately if git worktree add
or setup_worktree_build.py fails, avoiding partially initialized
worktree directories.

Add validation in setup_worktree_build.py to ensure the target
directory exists and contains a .git entry before acquiring locks
or creating directories.

TAG=agy
CONV=67ede365-803b-4edb-afda-a8c209ae3a22

No-Tree-Checks: true
No-Try: true
Change-Id: Ied38ae0e15be54001ea3d593347fdd8cac1d99ad
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8352624
Auto-Submit: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#109657}
2026-09-03 03:53:42 -07:00
Jakob Kummerow 5c8862ac6d [tools] Support metagen in update-compile-commands.py
To maintain the property that tools/dev/update-compile-commands.py
creates all files that an indexer (like clangd) needs, it should
invoke metagen to generate instance type header files.

Change-Id: I9a3342067ed630fcf10d4d922bba9e1ba115abf5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8336475
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#109631}
2026-09-02 02:19:12 -07:00
Andreas Haas 27a5bac040 [gn] Fix v8_use_perfetto
So far, v8_use_perfetto was disabled by default in a V8 checkout, and
enabled by default in a chrome checkout. Typically, such default values
should be set in `declare_args()` so that the value set in the gn args
overwrites the default value. However, in chrome checkouts, the default
value was set outside of `declare_args()` and thereby overwrote the
value that was set in the gn args.

This CL moves the default value of v8_use_perfetto into
`declare_args()`, so that it can be overwritten by gn args.

Additionally, in `gm xxx.debug` builds v8_use_perfetto is set to false,
as it causes linking issues in chrome checkouts otherwise.

Change-Id: I1e8017a0f36a6b6b402cae5739afef0c121ed291
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8191556
Auto-Submit: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#109034}
2026-08-04 05:00:45 -07:00
Camillo Bruni 6446b009fa [tools] Add markdown verifier
For exporting /docs to v8.dev we need to have better markdown
validation in the main v8 tree.

- Check that the markdown files have valid syntax
- Verify that relative / local links in markdown files exist

Change-Id: I7544c0146b45b7d7d2c6264dc8fedf3334876931
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8027158
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Marco Vitale <mrcvtl@chromium.org>
Cr-Commit-Position: refs/heads/main@{#108603}
2026-07-13 01:44:42 -07:00
Jakob Linke f8d2d71e8f [worktree] Cache regular files in shared_dirs, not just dirs
setup_worktree_build.py's diverged-DEPS cache path copies every
shared_dir with shutil.copytree, which raises NotADirectoryError on a
regular file. The exception was swallowed, so GEMINI.md was never cached
and its symlink was skipped. copy2 files, copytree directories.

Introduced by c6ed55f9da ("[worktree] Link GEMINI.md and .agents in
new worktrees"), which added the GEMINI.md file to shared_dirs.

Change-Id: Idf56e6292dcdb98c241d74fb547d558a356465fe
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8037031
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#108442}
2026-07-06 02:10:59 -07:00
Clemens Backes 088c808d55 [wasm] Bulk rename --experimental-wasm-foo to --wasm-foo
This CL performs a broad replacement of --experimental-wasm-* with --wasm-*
in all text files (tests, scripts, documentation, and error messages).

The flag definitions in src/flags/flag-definitions.h already use the new
naming convention for their primary names, and provide the old names
starting with --experimental- as aliases for backward compatibility.
This CL ensures that the codebase uses the new primary names.

TAG=agy
R=ecmziegler@chromium.org

Bug: 526972176
Change-Id: Ie756bfcb99122e90c16a7ef0355848ae4709991d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7993475
Reviewed-by: Emanuel Ziegler <ecmziegler@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritcodereview-exitgate@google.com>
Cr-Commit-Position: refs/heads/main@{#108400}
2026-07-02 08:17:50 -07:00
Clemens Backes c6ed55f9da [worktree] Link GEMINI.md and .agents in new worktrees
This ensures that all worktrees share the same project-specific
mandates and agent configurations.

TAG=agy
R=olivf@chromium.org

Change-Id: Ie28aa5a87a5075980be567ce78a52efb2192c838
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7979458
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#108223}
2026-06-24 07:50:15 -07:00
Olivier Flückiger 8a4bc0f684 [build] Support git cloned workspaces in gm.py
This modifies v8_root_dir() to check remote.origin.url for a local path,
enabling setup_worktree_build.py to run on git clones.

TAG=agy

CONV=f465d63d-d80b-497b-acee-5955e7734d08

Change-Id: I6d87832161f52787324b9a059e00d78b980cc402
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7956898
Commit-Queue: Olivier Flückiger <olivf@chromium.org>
Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
Auto-Submit: Olivier Flückiger <olivf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#108058}
2026-06-17 06:16:52 -07:00
Darius Mercadier f58f05fb68 [tools] Support bypassing worktree symlinks via git config
Add support for bypassing the worktree dependency symlink setup in
setup_worktree_build.py if the local git config 'v8.skip-worktree-deps'
is set to true.

This supports workflows where the worktree is pre-populated (e.g. via
Btrfs CoW snapshots) and we want to keep them isolated instead of
symlinking.

To enable this bypass, run the following command in your git repository:

  git config v8.skip-worktree-deps true

Change-Id: I98a6ed34a6a52edbabb72a197b7fd66729f84247
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7950159
Auto-Submit: Darius Mercadier <dmercadier@chromium.org>
Reviewed-by: Olivier Flückiger <olivf@chromium.org>
Commit-Queue: Darius Mercadier <dmercadier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#108038}
2026-06-16 22:50:52 -07:00
Nikolaos Papaspyrou 7082932f88 [tools] Share wasm test directories in git worktrees
WebAssembly tests (wasm-js and wasm-spec-tests) are downloaded as
tarballs via gclient hooks. Since `gclient sync` is not run in
worktrees, these local test directories eventually drift out of sync.

This CL updates the `setup_worktree_build.py` script to turn these two
test directories into symlinks to the main repo.

TAG=agy
CONV=4b602eb2-fabf-4afc-b49a-de137a5762ee

Change-Id: I2ab250a7ac5147f92510143d4bd7784974793cca
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7944423
Commit-Queue: Nikolaos Papaspyrou <nikolaos@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Olivier Flückiger <olivf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#108009}
2026-06-16 01:50:16 -07:00
Camillo Bruni 381788dc9b [DEPS] Add presubmit check to gitignore DEPS
V8 puts all DEPS-rolled projects under gitignore. This adds a
presubmit check that verify this.

TAG=agy
CONV=82258788-5cc0-469a-99c2-b962345ab84b

Change-Id: Iec202a1103d5345d455ffb27804bda77c5f7f3e4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7910042
Reviewed-by: Matthias Liedtke <mliedtke@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#107919}
2026-06-11 06:42:12 -07:00
Olivier Flückiger 0d68f887b0 [tools] Cache shared dependencies for diverged worktrees
Incorporate a DEPS caching strategy into setup_worktree_build.py to
handle worktree builds where the dependencies in the worktree diverge
from the main repository. When DEPS diverges, a content-hash based
shared cache is initialized and updated via gclient sync.

This allows gm to just work and build a worktree at any branch base,
which can be handy for e.g., bisecting inside a worktree.

TAG=agy
CONV=87c789d2-e06c-4825-a6a1-dcd9d9e3302d

Change-Id: If12c0c86d43721894d3e0f113e9dce834edb5efd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7879825
Auto-Submit: Olivier Flückiger <olivf@chromium.org>
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Olivier Flückiger <olivf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#107877}
2026-06-10 02:13:12 -07:00
Jakob Kummerow 281055710e [gm.py] Revert conditional building/testing logic
It is not working reliably.

No-Try: true
Fixed: 518635452
Change-Id: Ic1ef8e9855f3834b1d736630f963e394a66667bc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7885351
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#107692}
2026-06-01 06:33:45 -07:00
Igor Sheludko cd8c00376c [gm] Fix gm.py git change detection in worktrees
Corrects path resolution in tools/dev/gm.py's git worktree detection.
V8_ROOT_DIR is designed to refer to the main repository for external
dependency symlinks (which is correct), but for querying the active
workspace branch, HEAD commit, and changed files/mtimes, V8_DIR (the
current worktree directory) must be used.

Previously, running gm.py in a worktree would run git diff and ls-files
inside the main repository, completely ignoring changes in the active
worktree.

TAG=agy
CONV=3ef94fb5-550d-473c-8054-493f7cd74fb5

No-try: true
Change-Id: Icf278516ca7c548642b21eb4ade3ca3d5276ffa9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7876390
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#107597}
2026-05-27 07:54:00 -07:00
Marja Hölttä 8a00deaca8 [gm] Fix the child process's terminal size
This allows siso to correctly truncate the build output, so that
the lines get properly overwritten by \r and the build is not
spammy.

Change-Id: I7db6c214af588e68999187346812e015fadf6dbb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7840261
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#107301}
2026-05-13 04:58:40 -07:00
Marco Vitale 21d534b344 [tools] Prioritize default architecture flags for compile commands
In update-compile-commands.py, the order in which architectures are
processed determines which compilation flags are used for shared files
in compile_commands.json.

This change ensures that the default architecture (DEFAULT_ARCH)
is processed first, so its flags are preferred for shared files.

Change-Id: I441b48fc23aae9fd28687c4269e9f9bdec735361
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7822980
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Auto-Submit: Marco Vitale <mrcvtl@chromium.org>
Commit-Queue: Marco Vitale <mrcvtl@chromium.org>
Cr-Commit-Position: refs/heads/main@{#107104}
2026-05-06 12:42:04 -07:00
Jakob Kummerow d8e88ba4b5 [gm.py] Fix rebuilding logic
This patch fixes:
- rebuild the "main" branch after rebasing
- rebuild when adding/modifying C++ unit tests
- rebuild when non-d8 binaries are outdated
- re-run tests when switching from "check" to "checkall"

No-Try: true
Change-Id: If8851fbd6d0b32ca9b7f62c5c3c69ad993fee174
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7822240
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#107097}
2026-05-06 07:32:04 -07:00
Toon Verwaest 1164a11bee [dev] Fix gm.py filtering after rebase
gm.py uses git diff --name-only origin/main to find changed files.
This misses files that changed in origin/main and were brought in by a
rebase.

This CL fixes this by storing the HEAD commit hash to last_built_commit
in the build directory after a successful build.
On subsequent runs, it uses git diff --name-only <last_commit>..HEAD
to find changed files. It falls back to origin/main if needed.

TAG=agy
CONV=13dbf7dd-7179-45c5-a854-e05fff874a3c

Change-Id: Ic9bb7e047e4ecd86b028179aff46381634ef8ee7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7817341
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#107093}
2026-05-06 06:03:20 -07:00
Toon Verwaest 9ea9c2bfe4 [agents] Add conditional testing support
This modifies gm.py and run-tests.py to support conditionally skipping
tests when the worktree is unmodified.

We use find to check for newer files in source directories rather
than git status, which allows us to ignore untracked scratch files.
The .last_test_run timestamp file is now stored in the specific
out/<config>/ directory to prevent config switching from
invalidating the state.

TAG=agy
CONV=aec474ae-adb5-482c-80d3-0a863c0c1466

Change-Id: Iac774c250b95c63dc7c7f99d70f95f8319a88432
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7796000
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#107033}
2026-05-04 10:47:18 -07:00
Jakob Kummerow b85137ef4f [gm.py] Make updating reclient config optional
This stops automatic migration from `use_goma` to `use_remoteexec`, and
instead moves that feature behind --update-reclient-config.

No-Try: true
Change-Id: Ic381938a4d51892dde323cfe8332ad21bfabbaf7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7797167
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#106896}
2026-04-28 08:35:12 -07:00
Camillo Bruni d94a83badc [tools] Use stronger --sync=force
Agents seem to be happy modifying subprojects and breaking the builds
in subtle ways. Use all the force to sync.

Drive-by-fix:
- cleaner _parse_sync_arg handling

Change-Id: Ie09e1f3d7cc73902be92879b154ca97168141570
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7799294
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#106878}
2026-04-28 04:20:43 -07:00
Camillo Bruni c6c8e0e963 [tools] Add gm.py --sync option
This simplifies a few build steps for agents.

Change-Id: I7c0f52481d630a68d854dbca326ad3c3a114d917
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7798157
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#106867}
2026-04-28 02:36:24 -07:00
Olivier Flückiger c47c86ca80 [tools] Gracefully handle missing git in gm.py
In gm.py, it tries to detect the main repo by calling git.
This change modifies that logic to catch exceptions (like FileNotFoundError
if git is missing, or handle non-zero exit codes if not a git repo).
It falls back to the V8_DIR path if git fails or is missing.

TAG=agy
CONV=119526fa-5a97-4d6c-aa91-d67367f89a60

Change-Id: Id524358c1f024bba7abcd783e0d72aedf6608504
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7790316
Auto-Submit: Olivier Flückiger <olivf@chromium.org>
Commit-Queue: Olivier Flückiger <olivf@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#106807}
2026-04-24 03:07:01 -07:00
Olivier Flückiger 9273952ec2 [tools] Support building in git worktrees with gm.py
* Reliably detect the relative root of a worktree and the actual root
  of the repo.
* Setup symlinks for gclient managed dependencies into the worktree.

Change-Id: Ia25cf03eff23e93b75bbba3aa2ee7e55d431d0b0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7789890
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Olivier Flückiger <olivf@chromium.org>
Commit-Queue: Olivier Flückiger <olivf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#106763}
2026-04-23 05:48:14 -07:00
Toon Verwaest e1680681be [tools] Robust .gclient discovery for worktrees
Walk up the directory tree to find .gclient. If we are in a worktree, find the main repo and walk up from there as well.

TAG=agy
CONV=8d632dc8-38e8-422c-a6bf-c332b1747b44

Change-Id: Iad3c6f83bfdebc75a95c8cb784c66cf6625b484b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7784474
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#106714}
2026-04-22 07:28:44 -07:00
Andreas Haas 16aa612ab9 [gm] Fix mksnapshot debugging command in chromium checkouts
In chromium checkouts, the compilation commands can have different paths. This CL fixes two cases where the V8 path was used also for chromium checkouts.

Change-Id: I1d720264f78b046d256960952ba4189a5c23c66e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7778148
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#106602}
2026-04-20 02:50:49 -07:00
Andreas Haas b21ec3ca61 [gm] Fix ergonomics for chromium checkouts
With this change, gm can also create out directories in a chromium checkout, which is useful in CiderG checkouts. Additionally, it finds the .gclient file, even in a chrome checkout, and uses either the V8 or the Chrome solution definition to find the correct reclient setup.

Change-Id: I17454b2d7d91d6c4bbea1fe11a1f8535e3326fad
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7768436
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#106581}
2026-04-17 05:37:45 -07:00
Jakob Kummerow e9460e80a5 [tools] Fix update-vscode.sh
The repository we previously checked for updates hasn't received
the latest update. Check GitHub releases instead.

No-Try: true
Change-Id: I5821cb21ff293a624c6915a9c723650f9d04a457
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7665801
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#105802}
2026-03-16 01:09:37 -07:00
Olivier Flückiger b6c05bba96 [gm] Fix hang
Fix a deadlock where we try to read from the tty when the underlying
process already died.

Change-Id: I99b8e56faa3de935b8db829d043f280d07c265e3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7415273
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Olivier Flückiger <olivf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#104632}
2026-01-12 04:11:11 -08:00
Toon Verwaest 0d965e7278 [include] Update v8-internal.h from gen-static-roots.py
Change-Id: I0874fbf382e7c9fd2aa68b17b1b352535a479687
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7170523
Reviewed-by: Olivier Flückiger <olivf@chromium.org>
Auto-Submit: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Olivier Flückiger <olivf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#103823}
2025-11-19 05:48:02 -08:00
Camillo Bruni 84e6114001 tools: Fix gm.py with empty gcertstatus output
gcertstatus produces no output in some cases on windows which was
not handled properly before.

Drive-by-fixes:
- Use Path.read_text and Path.write_text
- Use in-operator for checking custom_vars keys

Fixed: 446939468
Change-Id: I845b0c7e172d4c139ce9b20758ecccefd67d035f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6974146
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#102721}
2025-09-24 02:44:13 -07:00
Leszek Swirski b3fed53330 [gm] Support running gm.py from a Chromium checkout.
This change detects if V8 is part of a Chromium checkout and adjusts the
default output directory (`OUTDIR`) accordingly. It also updates the
build directory parsing to correctly handle paths relative to the
Chromium root.

No-try: true
Change-Id: I65aa1a2e135fae13e9677ca9944298116fa1f46a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6906863
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#102214}
2025-09-03 04:31:34 -07:00
Leszek Swirski 5d7bf50e37 [gm.py] Resolve V8_GM_OUTDIR to absolute path
Ensure that subsequent relative path checks on OUTDIR succeed, by making
it an absolute path when specified by environment variable.

Change-Id: I2587a50e481543bb08f9e03c8c97a201cac85262
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6895244
Reviewed-by: Patrick Thier <pthier@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#102100}
2025-08-28 06:28:05 -07:00
Jakob Kummerow 94f414cd0b [gm.py] Add support for quiet mode
Quiet mode means we only print anything in case of error.
Can be enabled by passing "quiet" as a keyword, or by calling
gm.py via a symlink named "quietgm".

Bonus change: make gm.py robust to being called from any directory.

No-Try: true
Change-Id: Ica758098226e291a3d4d90a4da63b3901a5fb43e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6836375
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#101838}
2025-08-11 07:59:26 -07:00
Olivier Flückiger 17e91cb8a3 [static-roots] Support multiple r/o layouts
Support non-wasm and non-i18n builds. This allows us to always enable
static roots when the minimal dependencies (ptr compression, external
code space) are satisfied.

Ensure the bazel build has the same defaults.

Drive-By: Fix remote exec of the static roots builds by using a
different output directory schema.

Bug: 429272280

Change-Id: Ib356b8eec35a857f0b346d1f44c98918b1a616a5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6695691
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Olivier Flückiger <olivf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#101219}
2025-07-03 02:55:10 -07:00