Skip to content

Automate use of V8's version for crates shared by workerd and V8 - #8058

Open
npaun wants to merge 1 commit into
mainfrom
npaun/v8-rust-icu-auto/1-sync-chromium-crates
Open

npaun wants to merge 1 commit into
mainfrom
npaun/v8-rust-icu-auto/1-sync-chromium-crates

Conversation

@npaun

@npaun npaun commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Applies to:

  • temporal_capi
  • icu4x and friends

Kind of involved, but I think it's ok

@codecov-commenter

codecov-commenter commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.38%. Comparing base (fb27a83) to head (d797e6c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8058      +/-   ##
==========================================
- Coverage   69.38%   69.38%   -0.01%     
==========================================
  Files         696      696              
  Lines      181896   181896              
  Branches    29221    29221              
==========================================
- Hits       126212   126209       -3     
- Misses      38610    38613       +3     
  Partials    17074    17074              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@npaun
npaun force-pushed the npaun/v8-rust-in-workerd branch from c37dbfc to 4c3bec9 Compare October 28, 2026 01:30
@npaun
npaun force-pushed the npaun/v8-rust-icu-auto/1-sync-chromium-crates branch from 6ceb0ef to 2da028e Compare October 28, 2026 01:32
@npaun
npaun changed the base branch from npaun/v8-rust-in-workerd to npaun/v8-rust-chromium-crate-versions October 28, 2026 01:32
@npaun
npaun force-pushed the npaun/v8-rust-chromium-crate-versions branch from 1d5135d to 767610e Compare October 28, 2026 03:52
@npaun
npaun force-pushed the npaun/v8-rust-icu-auto/1-sync-chromium-crates branch from 2da028e to 7c4c6e8 Compare October 28, 2026 03:53
Base automatically changed from npaun/v8-rust-chromium-crate-versions to main October 28, 2026 04:33
@npaun
npaun force-pushed the npaun/v8-rust-icu-auto/1-sync-chromium-crates branch from 7c4c6e8 to b51cac4 Compare October 28, 2026 04:36
@npaun npaun changed the title Align V8's Rust crates with Chromium in ci/v8_update.py Automate use of V8's version for crates shared by workerd and V8 Oct 28, 2026
@npaun
npaun requested a review from logan-gatlin October 28, 2026 19:53
@npaun
npaun marked this pull request as ready for review October 28, 2026 19:57
@npaun
npaun requested review from a team as code owners October 28, 2026 19:57
@clanky-the-clanker

clanky-the-clanker Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

✅ Approved — The last review's WARNING (the Bazel crate lockfile wasn't regenerated) and its smaller notes are fixed at this commit, and there are no new issues.

The decision is advisory: this comment never approves, blocks or requests changes on the pull request.


✅ All checks passed

🔒 Security: ✅ LGTM

The helper fetches from fixed HTTPS URLs and passes cargo and bazel their arguments as lists, without a shell.


📖 AGENTS.md: ✅ LGTM

No AGENTS.md update is needed. docs/v8-updates.md covers the new step, and AGENTS.md already links to it.


📋 Code Quality: ✅ LGTM

  • The helper now repins cargo-bazel-lock.json with bazel fetch --repo_env=CARGO_BAZEL_REPIN=1 --repo=@crates_vendor (ci/v8_update.py:139-143), and the tests cover it.
  • Cargo's stderr now shows when --precise is refused, and the final error says how to fix each crate that doesn't match.
  • _exact_pins reads Cargo.toml with tomllib, and cargo add updates the pins.
  • The repository's Python toolchain is 3.13, so tomllib is available to the new py_test.

⚡ Performance: ✅ LGTM

This is an offline maintenance script and doesn't touch any hot path.


📝 Documentation: ✅ LGTM

The docs and the caret-compatibility comment now match the code.


Reviewed commit: d797e6c2 — same changes as 0accb61c, so this is that commit's review (no new review was run; line numbers are as of 0accb61c)

@ask-bonk

ask-bonk Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Since last review: 1 resolved, 0 still open, 2 new.

Automates Chromium Rust dependency alignment, adds Bazel tests, and documents the V8 update workflow.


Reviewed commit: 0accb61c · github run

Comment thread ci/v8_update.py
@logan-gatlin

logan-gatlin commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Instead of writing back to the Cargo.toml you could run cargo add 'dep@x.y.z', it edits the file in place, keeps all features, just repins the version to what you want

Comment thread ci/v8_update.py Outdated
@npaun
npaun force-pushed the npaun/v8-rust-icu-auto/1-sync-chromium-crates branch from b51cac4 to 0accb61 Compare October 28, 2026 22:17
@npaun

npaun commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

improved it... still needs one more round of deslopping imo

Comment thread ci/v8_update_test.py
Comment thread ci/v8_update_test.py
V8 builds temporal_capi from Chromium's third_party/rust, at the
revision pinned in V8's DEPS. Cargo resolves temporal_capi's tree
within workerd's crate graph, so a crate can drift from the version
Chromium builds V8 with.

Following the RUST_ICU_MAJOR_VERSION_NUMBER update, which reads
ICU's version at the commit pinned in V8's DEPS, read
chromium_crates_io/Cargo.lock at V8's third_party/rust revision.
Move the exact pins in deps/rust/Cargo.toml for crates in
temporal_capi's runtime tree to Chromium's versions with one
`cargo add`, which keeps their features, then move the remaining
crates in Cargo.lock with `cargo update --precise`. If a crate still
differs, fail and name it with Chromium's versions, since it needs an
exact pin. Then regenerate deps/rust/cargo-bazel-lock.json with
CARGO_BAZEL_REPIN, as build/deps/rust.MODULE.bazel requires after
Cargo.toml or Cargo.lock changes.

When Chromium locks several versions of a crate, the helper uses the
one that is semver-compatible with workerd's, under Cargo's caret
rules (including 0.0.x). Chromium's Cargo.lock and
deps/rust/Cargo.toml are read with tomllib.

`finish` runs this after the ICU update, and the new `rust-crates`
command runs it for the current V8 version. //ci:v8_update_test
covers the pin and lockfile moves, duplicate crate names in
Chromium's lockfile, and the failure when Cargo refuses a version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@npaun
npaun force-pushed the npaun/v8-rust-icu-auto/1-sync-chromium-crates branch from 0accb61 to d797e6c Compare October 28, 2026 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants