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 13:52:53+02:00
log25a375d35808cbc7b4817560f193efd29b51b724
tree2fdd1fed5e4a01a5469d49d3595117f9b91a9e23
parent5e96f6e102607aa5d014f1737fdbfe6ce7156475
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
...@@ -2368,6 +2368,16 @@ pub fn isNative(actual_target: *const std.Build.ResolvedTarget, host: *const std...@@ -2368,6 +2368,16 @@ pub fn isNative(actual_target: *const std.Build.ResolvedTarget, host: *const std
2368 if (actual.os.tag != host.os.tag)2368 if (actual.os.tag != host.os.tag)
2369 return false;2369 return false;
23702370
2371 // This check is really only necessary for the case where `host.cpu.arch.isAarch64()` and
2372 // `actual.cpu.arch.isArm()`. As they are wholly separate `std.Target` families with their own
2373 // feature bits, the logic below would produce complete nonsense.
2374 //
2375 // This does mean that we aren't actually checking feature compatibility between these two
2376 // families even though we should. That's not a problem currently, but in the future, we may
2377 // need to add a special code path just for this specific case...
2378 if (actual.cpu.arch.family() != host.cpu.arch.family())
2379 return true;
2380
2371 // Remove features that don't actually affect compatibility.2381 // Remove features that don't actually affect compatibility.
2372 const irrelevant: std.Target.Cpu.Feature.Set = switch (host.cpu.arch) {2382 const irrelevant: std.Target.Cpu.Feature.Set = switch (host.cpu.arch) {
2373 .x86_64 => std.Target.x86.featureSet(&.{2383 .x86_64 => std.Target.x86.featureSet(&.{