@@ -180,6 +180,11 @@ def load_profiles(directory: str):
180180 return profiles
181181
182182
183+ def remote_arch_required (remote : bool , arch : str | None , profile : str | None ) -> bool :
184+ """Remote targets cannot be fingerprinted for CPU architecture."""
185+ return bool (remote and not arch and not profile )
186+
187+
183188def select (profiles , version : str , branch : str , arch : str | None = None ):
184189 def fits (profile ):
185190 return arch is None or profile .get ("arch" ) == arch
@@ -544,7 +549,7 @@ def main() -> int:
544549 ap .add_argument ("--pin-max" , type = int , default = 32 ,
545550 help = "max keep-alive connections for remote auto-pinning" )
546551 ap .add_argument ("--arch" , choices = ("aarch64" , "amd64" ), default = None ,
547- help = "select the CPU architecture; auto-detected for local containers " )
552+ help = "CPU architecture; required for remote targets, auto-detected locally " )
548553 ap .add_argument ("--profile" , default = None ,
549554 help = "force a profile by name/path substring (needed when a version has several builds)" )
550555 ap .add_argument ("--no-color" , action = "store_true" )
@@ -594,6 +599,11 @@ def main() -> int:
594599 if detected_arch :
595600 args .arch = detected_arch
596601 ui .info (f"detected architecture: { detected_arch } " )
602+ if remote_arch_required (remote , args .arch , args .profile ):
603+ ui .crit ("remote target: CPU architecture cannot be detected" )
604+ ui .info ("pass --arch aarch64|amd64 (and --php-version if needed) or --profile NAME" )
605+ ui .result (False , "ARCH REQUIRED" , "remote target without --arch/--profile" )
606+ return 3
597607
598608 version , server , powered = fingerprint (args .target )
599609 if args .php_version :
0 commit comments