From c0b4688393fa1a96065c2407622fcb4663c350a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 16 Sep 2026 10:46:53 +0200 Subject: [PATCH] test: don't compare aarch64/arm feature sets in isNative() They are distinct families with their own feature bits. --- test/tests.zig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/tests.zig b/test/tests.zig index 89a95c9f32aa2b15bdc11f0f581d3395daebc8e6..f0d3de2cdf38af1a9b5638e760102f1f6c11a243 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -2398,6 +2398,16 @@ pub fn isNative(actual_target: *const std.Build.ResolvedTarget, host: *const std if (actual.os.tag != host.os.tag) return false; + // This check is really only necessary for the case where `host.cpu.arch.isAarch64()` and + // `actual.cpu.arch.isArm()`. As they are wholly separate `std.Target` families with their own + // feature bits, the logic below would produce complete nonsense. + // + // This does mean that we aren't actually checking feature compatibility between these two + // families even though we should. That's not a problem currently, but in the future, we may + // need to add a special code path just for this specific case... + if (actual.cpu.arch.family() != host.cpu.arch.family()) + return true; + // Remove features that don't actually affect compatibility. const irrelevant: std.Target.Cpu.Feature.Set = switch (host.cpu.arch) { .x86_64 => std.Target.x86.featureSet(&.{ -- 2.54.0