Skip to content

Commit

Permalink
support loong64 platform.
Browse files Browse the repository at this point in the history
In Golang, the GOARCH defined for loongarch64 is loong64.

Related links:
	golang/go#46229
	golang/go#65398

Change-Id: Idd99c006e8c069f5936654bfafcccf4168f51876
Reviewed-on: https://chromium-review.googlesource.com/c/infra/luci/luci-py/+/5334945
Reviewed-by: Chan Li <[email protected]>
Commit-Queue: Vadim Shtayura <[email protected]>
Reviewed-by: Vadim Shtayura <[email protected]>
  • Loading branch information
abner-chenc authored and LUCI CQ committed Mar 12, 2024
1 parent 121afdf commit 7ba2d0f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions appengine/swarming/swarming_bot/api/os_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ def get_cipd_architecture():
return 'ppc64'
if cpu_type == 'riscv':
return 'riscv64' if get_cpu_bitness() == '64' else 'riscv'
if cpu_type == 'loongarch64':
return 'loong64'

# TODO(vadimsh): Detection of following architectures is likely broken:
# mips64, mips64le, mipsle, ppc64, ppc64le, s390x.
return cpu_type
Expand Down
1 change: 1 addition & 0 deletions appengine/swarming/swarming_bot/api/os_utilities_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def test_get_cipd_architecture(self):
('evbarm', '64', 'arm64'),
('evbarm', '32', 'armv6l'),
('riscv', '64', 'riscv64'),
('loongarch64', '64', 'loong64'),
]
for cpu_type, bitness, expected in cases:
self.mock(os_utilities, 'get_cpu_type', lambda: cpu_type)
Expand Down
2 changes: 2 additions & 0 deletions client/cipd.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ def get_platform():
arch = 'armv6l' if python_bits == 32 else 'arm64'
elif arch == 'powerpc64': # OpenBSD's name for ppc64
arch = 'ppc64'
elif arch == 'loongarch64':
arch = 'loong64'

elif not arch and os_name == 'windows':
# On some 32bit Windows7, platform.machine() returns None.
Expand Down

0 comments on commit 7ba2d0f

Please sign in to comment.