Skip to content

Commit c6ab651

Browse files
authored
Fix the architecture detection mechanism (#4319)
* Fix the archiotecture detection mechanism * lower * arm * more * cleanup * fmt
1 parent 08f06bf commit c6ab651

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

python-sdk/kiota-gen.py

+12-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,16 @@
1010
import xml.etree.ElementTree as ET
1111

1212
KIOTA_OS_NAMES = {"Windows": "win", "Darwin": "osx", "Linux": "linux"}
13-
KIOTA_ARCH_NAMES = {"32bit": "x86", "64bit": "x64"}
13+
KIOTA_ARCH_NAMES = {
14+
"x86_64": "x64",
15+
"amd64": "x64",
16+
"i386": "x86",
17+
"x86": "x86",
18+
"x86_64": "x64",
19+
"amd64": "x64",
20+
"aarch64": "arm64",
21+
"arm64": "arm64",
22+
}
1423

1524

1625
def generate_kiota_client_files(setup_kwargs):
@@ -19,14 +28,12 @@ def generate_kiota_client_files(setup_kwargs):
1928
print("Unsupported operating system.")
2029
exit(1)
2130

22-
kiota_arch_name = KIOTA_ARCH_NAMES.get(platform.architecture()[0], None)
31+
machine = platform.machine().lower()
32+
kiota_arch_name = KIOTA_ARCH_NAMES.get(machine, None)
2333
if kiota_arch_name is None:
2434
print("Unsupported architecture.")
2535
exit(1)
2636

27-
if platform.processor()[0] == "arm" and kiota_arch_name == "x64":
28-
kiota_arch_name = "arm64"
29-
3037
kiota_release_name = f"{kiota_os_name}-{kiota_arch_name}.zip"
3138
# Detecting the Kiota version from a .csproj file so that it can be updated by automatic tool (e.g. Dependabot)
3239
kiota_version = (

0 commit comments

Comments
 (0)