From 979304e493e857af4414694264691a2301638466 Mon Sep 17 00:00:00 2001 From: Jonathan Schwender Date: Thu, 29 May 2025 15:21:40 +0800 Subject: [PATCH] mach: Fix cross-build check when using asan When using asan the target_override is enabled, but we can also still be cross-compiling. Swapping the order fixes the cross-build detection in combination with asan. Signed-off-by: Jonathan Schwender --- python/servo/command_base.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/servo/command_base.py b/python/servo/command_base.py index abd193eda49..5c981515c8f 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -803,15 +803,16 @@ class CommandBase(object): "--manifest-path", path.join(self.context.topdir, "ports", "servoshell", "Cargo.toml"), ] - if target_override: - args += ["--target", target_override] - elif self.target.is_cross_build(): + + if self.target.is_cross_build(): args += ["--target", self.target.triple()] if type(self.target) in [AndroidTarget, OpenHarmonyTarget]: # Note: in practice `cargo rustc` should just be used unconditionally. assert command != "build", "For Android / OpenHarmony `cargo rustc` must be used instead of cargo build" if command == "rustc": args += ["--lib", "--crate-type=cdylib"] + elif target_override: + args += ["--target", target_override] features = []