Skip to content

tsan c++ and rust configurations - #7214

Merged
mikea merged 3 commits into
mainfrom
maizatskyi/2026-09-01-tsan-config
Sep 3, 2026
Merged

tsan c++ and rust configurations#7214
mikea merged 3 commits into
mainfrom
maizatskyi/2026-09-01-tsan-config

Conversation

@mikea

@mikea mikea commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

borrows the idea of recent build-std change downstream to build tsan-instrumented rust stdlib.

@mikea
mikea requested review from a team as code owners September 1, 2026 22:51
@mikea
mikea marked this pull request as draft September 1, 2026 22:54
@ask-bonk

ask-bonk Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@mikea Bonk workflow was cancelled.

View workflow run · To retry, trigger Bonk again.

@mikea
mikea force-pushed the maizatskyi/2026-09-01-tsan-config branch 3 times, most recently from 485397f to 2a2d699 Compare September 2, 2026 16:39
@mikea
mikea requested review from fhanau and npaun and a balanced review from Copilot September 2, 2026 16:55
Comment thread build/deps/rust.MODULE.bazel Outdated
Comment thread build/rust/BUILD.bazel
Comment thread src/rust/tsan-test/race.rs
@ask-bonk

ask-bonk Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

I'm Bonk, and I've done a quick review of your PR.

Adds C++ and Rust ThreadSanitizer build configurations and an instrumented Rust standard library.

  1. Low src/rust/tsan-test/race.rs:1 Missing required copyright and Apache-2.0 header. Posted a suggestion comment.

github run

@mikea
mikea marked this pull request as ready for review September 2, 2026 17:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The Rust toolchain omits rustc’s required codegen backend, and the test hard-codes main-repository runfile paths.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds Linux x86_64 TSan support across C++ and Rust, including an instrumented Rust standard library and integration test.

Changes:

  • Adds sanitizer platforms and Bazel configurations.
  • Builds a TSan-instrumented Rust standard library and toolchain.
  • Adds V8 compatibility patch and race-detection test.
File summaries
File Description
.bazelrc Configures ASan/TSan builds.
build/deps/rust.MODULE.bazel Exposes nightly Rust tools and sources.
build/deps/v8.MODULE.bazel Registers the V8 TSan patch.
build/platforms/BUILD.bazel Defines sanitizer constraints and platforms.
build/rust/BUILD.bazel Defines the custom TSan Rust toolchain.
build/rust/build_std.bzl Implements instrumented standard-library rules.
build/rust/build_std.sh Builds and stages instrumented Rust libraries.
patches/v8/0041-Fix-TSan-build-without-the-V8-sandbox.patch Guards sandbox-only V8 handling.
src/rust/tsan-test/BUILD.bazel Declares the TSan integration test.
src/rust/tsan-test/race.rs Provides a deliberate Rust data race.
src/rust/tsan-test/verify.sh Validates instrumentation and race reporting.
Review details

Suppressed comments (1)

src/rust/tsan-test/verify.sh:11

  • This second _main path has the same external-repository failure: under a parent Bazel workspace it does not resolve the :race runfile. Resolve it through TEST_WORKSPACE instead.
race="$TEST_SRCDIR/_main/src/rust/tsan-test/race"
  • Files reviewed: 11/11 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread build/rust/build_std.bzl
Comment thread src/rust/tsan-test/verify.sh Outdated
@mikea
mikea force-pushed the maizatskyi/2026-09-01-tsan-config branch 2 times, most recently from f1d93d4 to da9d022 Compare September 2, 2026 17:37
@mikea
mikea requested a review from npaun September 2, 2026 17:40
@mikea
mikea enabled auto-merge September 2, 2026 19:55
@mikea
mikea requested a balanced review from Copilot September 3, 2026 16:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Nightly updates can create mismatched compiler sources, and the integration test is not exercised by CI.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 16/16 changed files
  • Comments generated: 3
  • Review effort level: Balanced

Comment thread build/deps/update-deps.py
Comment thread build/rust/build_std.sh
Comment thread src/rust/tsan-test/BUILD.bazel
@mikea
mikea disabled auto-merge September 3, 2026 17:22
Comment thread build/rust/build_std.sh
Comment thread build/platforms/BUILD.bazel
@mikea
mikea force-pushed the maizatskyi/2026-09-01-tsan-config branch from da9d022 to e420e4d Compare September 3, 2026 22:05
@mikea
mikea enabled auto-merge September 3, 2026 22:05
@mikea
mikea force-pushed the maizatskyi/2026-09-01-tsan-config branch from e420e4d to c54e195 Compare September 3, 2026 22:27
@mikea
mikea merged commit 6678ee1 into main Sep 3, 2026
21 checks passed
@mikea
mikea deleted the maizatskyi/2026-09-01-tsan-config branch September 3, 2026 23:13
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