{"record":{"id":"7a1a24be4ab70749","repo":"rust-lang/rust","slug":"unrecognized-target-triple-triple","errorCode":null,"errorMessage":"Unrecognized target triple {triple}","messagePattern":"Unrecognized target triple (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/ci/docker/scripts/fuchsia-test-runner.py","lineNumber":143,"sourceCode":"    @staticmethod\n    def tmp_dir() -> Path:\n        if TestEnvironment.__tmp_dir:\n            return TestEnvironment.__tmp_dir\n        tmp_dir = os.environ.get(\"TEST_TOOLCHAIN_TMP_DIR\")\n        if tmp_dir is not None:\n            TestEnvironment.__tmp_dir = Path(tmp_dir).absolute()\n        else:\n            TestEnvironment.__tmp_dir = Path(__file__).parent.joinpath(\"tmp~\")\n        return TestEnvironment.__tmp_dir\n\n    @staticmethod\n    def triple_to_arch(triple) -> str:\n        if \"x86_64\" in triple:\n            return \"x64\"\n        elif \"aarch64\" in triple:\n            return \"arm64\"\n        else:\n            raise Exception(f\"Unrecognized target triple {triple}\")\n\n    @classmethod\n    def env_file_path(cls) -> Path:\n        return cls.tmp_dir().joinpath(\"test_env.json\")\n\n    @classmethod\n    def from_args(cls, args):\n        local_pb_path = args.local_product_bundle_path\n        if local_pb_path is not None:\n            local_pb_path = Path(local_pb_path).absolute()\n\n        return cls(\n            rust_build_dir=Path(args.rust_build).absolute(),\n            sdk_dir=Path(args.sdk).absolute(),\n            target=args.target,\n            toolchain_dir=Path(args.toolchain_dir).absolute(),\n            local_pb_path=local_pb_path,\n            use_local_pb=args.use_local_product_bundle_if_exists,","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/src/ci/docker/scripts/fuchsia-test-runner.py#L125-L161","documentation":"Raised by TestEnvironment.triple_to_arch() in fuchsia-test-runner.py at line 143. This static method maps a Rust target triple to a Fuchsia architecture name: 'x86_64' substrings map to 'x64', 'aarch64' substrings map to 'arm64'. Any other triple string raises an Exception because the Fuchsia emulator and product bundle selection only support these two architectures. The triple comes from the required --target argument (line 1192-1196).","triggerScenarios":"triple_to_arch(self.target) is called at line 501 (for product_name: 'minimal.' + arch) and line 795 (target_arch parameter). If self.target (from args.target) contains neither 'x86_64' nor 'aarch64', the else branch at line 142-143 raises. The --target argument is required and validated only by argparse as present, not by value.","commonSituations":"Passing a Fuchsia-incompatible target triple to the test runner (e.g. 'x86_64-unknown-linux-gnu' instead of 'x86_64-unknown-fuchsia'); a typo in the triple; using a RISC-V or other unsupported architecture triple; or a pipeline/ci script passing the host triple instead of the Fuchsia target triple.","solutions":["Ensure --target is one of the two supported Fuchsia triples: 'x86_64-unknown-fuchsia' or 'aarch64-unknown-fuchsia'.","Check the CI script or Makefile that invokes fuchsia-test-runner.py for the correct --target value.","If you genuinely need a new architecture, extend triple_to_arch() with the mapping and ensure Fuchsia product bundles exist for it."],"exampleFix":"# before\npython3 fuchsia-test-runner.py start --target x86_64-unknown-linux-gnu ...\n# after\npython3 fuchsia-test-runner.py start --target x86_64-unknown-fuchsia ...","handlingStrategy":"validation","validationCode":"# Before passing a triple to the test runner, validate it\nSUPPORTED_TRIPLES = {'x86_64-unknown-fuchsia', 'aarch64-unknown-fuchsia'}\n\ndef validate_fuchsia_triple(triple):\n    if 'x86_64' not in triple and 'aarch64' not in triple:\n        raise ValueError(\n            f'Unsupported triple: {triple}. '\n            f'Use one of: {SUPPORTED_TRIPLES}'\n        )\n    return 'x64' if 'x86_64' in triple else 'arm64'","typeGuard":null,"tryCatchPattern":"try:\n    arch = TestEnvironment.triple_to_arch(target_triple)\nexcept Exception as e:\n    if 'Unrecognized target triple' in str(e):\n        print(f'Use x86_64-unknown-fuchsia or aarch64-unknown-fuchsia.')\n    raise","preventionTips":["Always use the full Fuchsia target triple: 'x86_64-unknown-fuchsia' or 'aarch64-unknown-fuchsia'.","Don't pass host triples (e.g. 'x86_64-unknown-linux-gnu') to the Fuchsia test runner.","Validate the --target argument in CI scripts before invoking the runner."],"tags":["ci","fuchsia","target-triple","architecture","python"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}