envconfig: Cannot run executables if subsystem doesn't match

Without this, building for iOS while using subsystem names instead of
`system = 'ios'` doesn't work correctly.
This commit is contained in:
Nirbheek Chauhan
2026-02-03 15:13:14 +05:30
committed by Dylan Baker
parent b234dbfa20
commit 61c5859b77

View File

@@ -751,7 +751,10 @@ def machine_info_can_run(machine_info: MachineInfo) -> bool:
detect_cpu_family() here because we always want to know the OS
architecture, not what the compiler environment tells us.
"""
if machine_info.system != detect_system():
system = detect_system()
if machine_info.system != system:
return False
if machine_info.subsystem != detect_subsystem(system):
return False
true_build_cpu_family = detect_cpu_family({})
assert machine_info.cpu_family is not None, 'called on incomplete machine_info'