Check that `library/profiler_builtins` actually found some source files · patricklam/verify-rust-std@eb747e5

Original file line numberDiff line numberDiff line change

@@ -84,12 +84,16 @@ fn main() {

8484

let root = Path::new("../../src/llvm-project/compiler-rt");

8585
8686

let src_root = root.join("lib").join("profile");

87+

assert!(src_root.exists(), "profiler runtime source directory not found: {src_root:?}");

88+

let mut n_sources_found = 0u32;

8789

for src in profile_sources {

8890

let path = src_root.join(src);

8991

if path.exists() {

9092

cfg.file(path);

93+

n_sources_found += 1;

9194

}

9295

}

96+

assert!(n_sources_found > 0, "couldn't find any profiler runtime source files in {src_root:?}");

9397
9498

cfg.include(root.join("include"));

9599

cfg.warnings(false);