AIR tests: the metallib half of the committed-fixtures test is skipped where the SDK's linker refuses the fixtures' AIR version

The remote CI's macOS leg (macos-26) has failed "Test metal2vulkan" on master since at least
959a4ccbcd (runs 46004353737, 46104484064, 46893773054): container::tests::
committed_air_fixtures_parse_and_link asserted the link succeeded, and that runner's xcrun metallib
answers "air version set to 2.9.0 (!10 = !{i32 2, i32 9, i32 0}), but expecting 2.8 in fbd_vertex".
The fixtures are compiled by the SDK scripts/regen-air-fixtures ran on, newer than the runner's, and
that linker cannot link them at all. The parse half still runs on every host; the link half is skipped
with a SKIPPED line naming the linker's answer, as it already is where xcrun metallib is absent. Any
other link failure still fails the test with the linker's stderr.

Verified: not run here (the M3 runs no tests, and its SDK links AIR 2.9); the next remote macOS run
shows it.
This commit is contained in:
Anees Iqbal committed 2026-12-02 06:50:40 -08:00
1 parent 56cf3dbd1b
commit 01d80f2d65
1 file changed
+15 -3
+15 -3
View File
@@ -1101,16 +1101,28 @@ fn committed_air_fixtures_parse_and_link() {
return;
}
let out = std::env::temp_dir().join(format!("m2v-container-{}.metallib", std::process::id()));
let status = std::process::Command::new("xcrun")
let linked = std::process::Command::new("xcrun")
.args(["-sdk", "macosx", "metallib"])
.args(&airs)
.arg("-o")
.arg(&out)
.status()
.output()
.unwrap();
let bytes = std::fs::read(&out);
let _ = std::fs::remove_file(&out);
assert!(status.success());
let stderr = String::from_utf8_lossy(&linked.stderr);
// The fixtures are compiled by the SDK `scripts/regen-air-fixtures` ran on; an older SDK's
// linker refuses their newer AIR version ("air version set to 2.9.0 ..., but expecting 2.8").
// That linker cannot link them at all, so the half that compares with Apple's link is skipped
// there; the parse half above has run.
if !linked.status.success()
&& stderr.contains("air version set to")
&& stderr.contains("but expecting")
{
eprintln!("SKIPPED metallib half: this SDK's metallib links an older AIR version than the fixtures': {}", stderr.trim());
return;
}
assert!(linked.status.success(), "xcrun metallib: {stderr}");
let bytes = bytes.unwrap();
let lib = metallib(&bytes);
assert_eq!(lib.functions.len(), entries);