diff --git a/hatch_build.py b/hatch_build.py index 87531cf..ae1b3d5 100644 --- a/hatch_build.py +++ b/hatch_build.py @@ -29,7 +29,7 @@ def initialize(self, version: str, build_data: dict[str, Any]) -> None: target_arch = os.environ.get("CIBW_ARCHS", platform.machine()).lower() target_os_info = os.environ.get("CIBW_PLATFORM", sys.platform).lower() - if target_arch not in ["x86_64", "arm64", "aarch64", "i386"]: + if target_arch not in ["x86_64", "arm64", "aarch64", "i386", "amd64"]: raise NotImplementedError(f"no support arch: {target_arch}") if not any(os_name in target_os_info for os_name in ["linux", "darwin", "macos", "win"]): @@ -38,9 +38,14 @@ def initialize(self, version: str, build_data: dict[str, Any]) -> None: # 检查系统和架构的组合 if target_os_info in ["win"] and target_arch == "x86_64": target_arch = "amd64" - elif target_os_info in ["linux"] and target_arch == "arm64": - target_arch = "aarch64" + elif target_os_info in ["linux"]: + if target_arch == "arm64": + target_arch = "aarch64" + elif target_arch == "amd64": + target_arch = "x86_64" if target_os_info in ["darwin", "macos"]: + if target_arch == "amd64": + target_arch = "x86_64" target_os_info = f"macosx_{'10_9' if target_arch == 'x86_64' else '11_0'}" if target_arch == "aarch64": target_arch = "arm64"