Skip to content

Commit 78a6187

Browse files
committed
Rerun the Metal build script when DEVELOPER_DIR changes
The script finds the Metal compiler through xcrun, which follows DEVELOPER_DIR. A build that ran while xcrun pointed at the Command Line Tools embedded empty placeholder metallibs, and setting DEVELOPER_DIR afterwards changed nothing until the crate was cleaned, because cargo did not know the script depends on that variable.
1 parent 0dbc46f commit 78a6187

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎crates/synapse-engine-owned/build.rs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ fn main() {
1313
] {
1414
println!("cargo:rerun-if-changed={source}");
1515
}
16+
// The Metal toolchain is located through xcrun, which follows DEVELOPER_DIR.
17+
// Without this line, a build that ran while xcrun pointed at the Command
18+
// Line Tools keeps its empty placeholder metallibs after DEVELOPER_DIR is
19+
// set, until the crate is cleaned.
20+
println!("cargo:rerun-if-env-changed=DEVELOPER_DIR");
1621

1722
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() != Ok("macos") {
1823
return;

0 commit comments

Comments
 (0)