authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-09-16 10:46:53+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-10-08 15:54:50+02:00
logc0b4688393fa1a96065c2407622fcb4663c350a3
tree8063ba1c5b0f7d642bdaadae7e4c5de9a7945e5d
parentc0ac79fdbef0de883f1659e2bef124093cbb8c4f
signature Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

test: don't compare aarch64/arm feature sets in isNative()

They are distinct families with their own feature bits.

1 files changed, 10 insertions(+), 0 deletions(-)

test/tests.zig+10
......@@ -2398,6 +2398,16 @@ pub fn isNative(actual_target: *const std.Build.ResolvedTarget, host: *const std
23982398 if (actual.os.tag != host.os.tag)
23992399 return false;
24002400
2401 // This check is really only necessary for the case where `host.cpu.arch.isAarch64()` and
2402 // `actual.cpu.arch.isArm()`. As they are wholly separate `std.Target` families with their own
2403 // feature bits, the logic below would produce complete nonsense.
2404 //
2405 // This does mean that we aren't actually checking feature compatibility between these two
2406 // families even though we should. That's not a problem currently, but in the future, we may
2407 // need to add a special code path just for this specific case...
2408 if (actual.cpu.arch.family() != host.cpu.arch.family())
2409 return true;
2410
24012411 // Remove features that don't actually affect compatibility.
24022412 const irrelevant: std.Target.Cpu.Feature.Set = switch (host.cpu.arch) {
24032413 .x86_64 => std.Target.x86.featureSet(&.{