Skip to content

feat(v8)!: synchronize Rust crates with major updates#1117

Open
Renegade334 wants to merge 2 commits into
nodejs:mainfrom
Renegade334:v8-crates
Open

feat(v8)!: synchronize Rust crates with major updates#1117
Renegade334 wants to merge 2 commits into
nodejs:mainfrom
Renegade334:v8-crates

Conversation

@Renegade334

@Renegade334 Renegade334 commented Jul 14, 2026

Copy link
Copy Markdown
Member

An implementation of nodejs/node#64191 (comment). Depends on #1116 and nodejs/node#64482.

Broadly speaking, the process is as follows:

  1. Checkout the third_party/rust repository alongside the other DEPS. Note that this never enters the Node.js git tree, as it's deliberately not exempt from .gitignore, but fetching it here can make use of the existing DEPS machinery.
  2. Use cargo tree to walk the temporal_capi dependency tree in third_party/rust/chromium_crates_io, and populate a list of transitive dependencies, so that we only vendor what we need for Temporal.
  3. Build a new Cargo.toml manifest, copying any custom configs for crates that appear in the temporal_capi dependency tree.
  4. Copy the vendored dependencies from third_party/rust/chromium_crates_io to deps/crates.
    • We don't use cargo vendor here, because Chromium uses its own gnrt toolchain to vendor its crate dependencies, which also applies any floating patches in third_party/rust/chromium_crates_io/patches. Using cargo vendor would fetch fresh copies from crates.io, and miss these patches.
    • The slight caveat is that, unlike cargo vendor, gnrt always adds some variation of the version string when naming the vendored crate directories. It doesn't matter for the rust build, since cargo doesn't care about the directory names, but it does mean that we need to update the temporal_capi include path in crates.gyp whenver we update the crates.
  5. Regenerate the lockfile.
  6. Update a standalone variable in crates.gyp containing the temporal_capi crate directory name, so that the V8 C++ build has the correct include path for the temporal_rs headers.
  7. 🏁

Example result: nodejs/node@f3bf260

Like Chromium, this approach doesn't add a rust-version to the crates manifest; Cargo will read this from the dependencies' manifests anyway. However, while it's not necessary for the build, I appreciate that it may be useful to see if our Rust requirement has changed, for updating BUILDING.md etc. If desired, we can either add this field or output the MSRV to terminal somehow; it'd just require interrogating each dependency's Cargo.toml while walking the tree.

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.06%. Comparing base (09c8ff9) to head (c5892a8).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1117   +/-   ##
=======================================
  Coverage   63.06%   63.06%           
=======================================
  Files          50       50           
  Lines        8288     8288           
=======================================
  Hits         5227     5227           
  Misses       3061     3061           

☔ 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.

@legendecas legendecas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this ready for review?

This is a breaking change, as Cargo is now a mandatory requirement for
running a major update.
@Renegade334

Copy link
Copy Markdown
Member Author

If you have any comments on the overall approach then fire away, but I'll mark as ready for review once the associated core PR is merged, so that people can do proper test runs.

@Renegade334

Copy link
Copy Markdown
Member Author

Like Chromium, this approach doesn't add a rust-version to the crates manifest; Cargo will read this from the dependencies' manifests anyway. However, while it's not necessary for the build, I appreciate that it may be useful to see if our Rust requirement has changed, for updating BUILDING.md etc. If desired, we can either add this field or output the MSRV to terminal somehow; it'd just require interrogating each dependency's Cargo.toml while walking the tree.

This wasn't actually much effort to implement, so I've added this in.

New example run: nodejs/node@2c67a51

@aduh95

aduh95 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

If you have any comments on the overall approach then fire away, but I'll mark as ready for review once the associated core PR is merged, so that people can do proper test runs.

FWIW having the other PR merged is not necessary for doing test runs, one can apply the patch on nodejs/node already. I'd like this PR to land soon so we can release 7.0.0 which is long overdue at this point (but since this is marked semver major, it makes sense to wait for it)

@Renegade334 Renegade334 marked this pull request as ready for review July 15, 2026 13:55
@Renegade334

Copy link
Copy Markdown
Member Author

Fair enough!

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.

4 participants