From ef97bc49f164ea5671e57b0ed3c177930034c0c6 Mon Sep 17 00:00:00 2001 From: gouzi <530971494@qq.com> Date: Tue, 15 Apr 2025 20:28:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=8D=BB=20fix:=20add=20amd64=20in=20ar?= =?UTF-8?q?ch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hatch_build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hatch_build.py b/hatch_build.py index 87531cf..e0a0a99 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"]): From 07cce9f66537ab78f09881d66e6cc1ee34e7e46a Mon Sep 17 00:00:00 2001 From: gouzi <530971494@qq.com> Date: Tue, 15 Apr 2025 20:31:11 +0800 Subject: [PATCH 2/2] add more os check --- hatch_build.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hatch_build.py b/hatch_build.py index e0a0a99..ae1b3d5 100644 --- a/hatch_build.py +++ b/hatch_build.py @@ -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"