Returns the target triple to be built and defined in the application manifest.
()
| 96 | |
| 97 | @cache |
| 98 | def get_target_triple() -> str: |
| 99 | """ |
| 100 | Returns the target triple to be built and defined in the application manifest. |
| 101 | """ |
| 102 | env = environ.get("AMAZON_Q_BUILD_TARGET_TRIPLE") |
| 103 | if env: |
| 104 | return env |
| 105 | elif isDarwin(): |
| 106 | return "universal-apple-darwin" |
| 107 | else: |
| 108 | match (platform.machine(), isMusl()): |
| 109 | case ("x86_64", True): |
| 110 | return "x86_64-unknown-linux-musl" |
| 111 | case ("x86_64", False): |
| 112 | return "x86_64-unknown-linux-gnu" |
| 113 | case ("aarch64", True): |
| 114 | return "aarch64-unknown-linux-musl" |
| 115 | case ("aarch64", False): |
| 116 | return "aarch64-unknown-linux-gnu" |
| 117 | case (other, _): |
| 118 | raise ValueError(f"Unsupported machine {other}") |
| 119 | |
| 120 | |
| 121 | if __name__ == "__main__": |