Resolve the name of the current machine's host platform. This is conceptually a simplified machine triple.
()
| 30 | |
| 31 | |
| 32 | def current_host_platform() -> str: |
| 33 | """Resolve the name of the current machine's host platform. |
| 34 | |
| 35 | This is conceptually a simplified machine triple. |
| 36 | """ |
| 37 | machine = platform.machine() |
| 38 | if sys.platform == "linux": |
| 39 | if machine == "x86_64": |
| 40 | return "linux_x86_64" |
| 41 | elif machine == "aarch64": |
| 42 | return "linux_aarch64" |
| 43 | else: |
| 44 | raise Exception(f"unsupported Linux host platform: {machine}") |
| 45 | elif sys.platform == "darwin": |
| 46 | if machine == "arm64": |
| 47 | return "macos_arm64" |
| 48 | elif machine == "x86_64": |
| 49 | return "macos_x86_64" |
| 50 | else: |
| 51 | raise Exception(f"unhanded macOS machine type: {machine}") |
| 52 | else: |
| 53 | raise Exception(f"unsupported host platform: {sys.platform}") |
| 54 | |
| 55 | |
| 56 | def default_target_triple() -> str: |
no outgoing calls
no test coverage detected