Skip to content

Commit 237a56c

Browse files
David Tolnaymeta-codesync[bot]
authored andcommitted
Disregard build script sanitizer flag mismatch
Summary: Since {D108384430}, every `can_compile` in rustix's build script are newly detected as failing to compile in TSan mode because they fail with the following error: https://www.internalfb.com/code/fbsource/[1a8e7598a23c79d8a0a6cdd701a2861799dc6974]/third-party/rust/vendor/rustix-1.1.4/build.rs?lines=8%2C87-90%2C198%2C210-214 ```lang=log,counterexample error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `rust_out` | = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely = note: unset `-Zsanitizer` in this crate is incompatible with `-Zsanitizer=thread` in dependency `std` = help: set `-Zsanitizer=thread` in this crate or unset `-Zsanitizer` in `std` = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error ``` For rustc invocations made by build scripts this seems fine to ignore. Differential Revision: D108549896 fbshipit-source-id: 90059fd0a21d2d1cb0435236773d9e68a8b52f44
1 parent 9e40fd0 commit 237a56c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

prelude/rust/cargo_buildscript.bzl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,11 @@ def _cargo_buildscript_impl(ctx: AnalysisContext) -> list[Provider]:
268268

269269
# \037 == \x1f == the magic delimiter specified in the environment variable
270270
# reference above.
271-
env["CARGO_ENCODED_RUSTFLAGS"] = cmd_args(rust_toolchain_info.rustc_flags, delimiter = "\037")
271+
env["CARGO_ENCODED_RUSTFLAGS"] = cmd_args(
272+
rust_toolchain_info.rustc_flags,
273+
"-Cunsafe-allow-abi-mismatch=sanitizer",
274+
delimiter = "\037",
275+
)
272276

273277
host_triple = targets.exec_triple(ctx)
274278
if host_triple:

0 commit comments

Comments
 (0)