Skip to content

Commit 99322a5

Browse files
committed
extend sanitizers stamp calculation
Signed-off-by: onur-ozkan <[email protected]>
1 parent 216969b commit 99322a5

File tree

1 file changed

+13
-7
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+13
-7
lines changed

src/bootstrap/src/core/build_steps/llvm.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,18 +1121,24 @@ impl Step for Sanitizers {
11211121

11221122
let out_dir = builder.native_dir(self.target).join("sanitizers");
11231123
let runtimes = supported_sanitizers(&out_dir, self.target, &builder.config.channel);
1124-
if runtimes.is_empty() {
1124+
1125+
if builder.config.dry_run() || runtimes.is_empty() {
11251126
return runtimes;
11261127
}
11271128

11281129
let LlvmResult { llvm_config, .. } = builder.ensure(Llvm { target: builder.config.build });
1129-
if builder.config.dry_run() {
1130-
return runtimes;
1131-
}
11321130

1133-
let stamp = BuildStamp::new(&out_dir)
1134-
.with_prefix("sanitizers")
1135-
.with_stamp(builder.in_tree_llvm_info.sha().map(String::from).unwrap_or_default());
1131+
static STAMP_HASH_MEMO: OnceLock<String> = OnceLock::new();
1132+
let smart_stamp_hash = STAMP_HASH_MEMO.get_or_init(|| {
1133+
generate_smart_stamp_hash(
1134+
builder,
1135+
&builder.config.src.join("src/llvm-project/compiler-rt"),
1136+
builder.in_tree_llvm_info.sha().unwrap_or_default(),
1137+
)
1138+
});
1139+
1140+
let stamp =
1141+
BuildStamp::new(&out_dir).with_prefix("sanitizers").with_stamp(smart_stamp_hash);
11361142

11371143
if stamp.is_up_to_date() {
11381144
if stamp.stamp.is_empty() {

0 commit comments

Comments
 (0)