tsan c++ and rust configurations - #7214
Conversation
|
@mikea Bonk workflow was cancelled. View workflow run · To retry, trigger Bonk again. |
485397f to
2a2d699
Compare
| tags = ["manual"], | ||
| target_compatible_with = ["//build/platforms:sanitizer_thread"], | ||
| target_triple = _TARGET_TRIPLE, | ||
| visibility = ["//src/rust/tsan-test:__pkg__"], |
There was a problem hiding this comment.
TIL you could have weird visibility expressions like this.
|
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.
|
There was a problem hiding this comment.
🟡 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
_mainpath has the same external-repository failure: under a parent Bazel workspace it does not resolve the:racerunfile. Resolve it throughTEST_WORKSPACEinstead.
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.
2a2d699 to
f1d93d4
Compare
f1d93d4 to
da9d022
Compare
borrows the idea of recent build-std change downstream to build tsan-instrumented rust stdlib.