Rename get_cpu_arch to get_target_cpu_arch - #5464
Draft
JuanMBriones wants to merge 1 commit into
Draft
JuanMBriones wants to merge 1 commit into
JuanMBriones wants to merge 1 commit into
Conversation
JuanMBriones
force-pushed
the
rename_get_cpu_arch
branch
from
September 11, 2026 08:29
e094843 to
cc8580a
Compare
g-ortuno
requested changes
Sep 11, 2026
JuanMBriones
force-pushed
the
rename_get_cpu_arch
branch
2 times, most recently
from
September 14, 2026 22:31
a9768d0 to
c6aea43
Compare
JuanMBriones
commented
Sep 14, 2026
JuanMBriones
force-pushed
the
rename_get_cpu_arch
branch
from
September 14, 2026 22:35
c6aea43 to
fc8d6fc
Compare
`get_cpu_arch` method might be a bit confusing, `get_target_cpu_arch` is a bit more descriptive. - Ran `python butler.py py_unittest -t core -p commands_test.py` (passed). - Ran `python butler.py py_unittest -t core -p settings_test.py` (passed). - Ran `python butler.py py_unittest -t core -p environment_test.py` (passed). Bug: 559993851 Signed-off-by: Manuel Briones <manuelbriones@google.com>
JuanMBriones
force-pushed
the
rename_get_cpu_arch
branch
from
September 14, 2026 22:37
fc8d6fc to
ef7abd9
Compare
g-ortuno
requested changes
Sep 15, 2026
| def get_cpu_arch(): | ||
| """Return cpu architecture.""" | ||
| def get_target_cpu_arch(): | ||
| """Return target cpu architecture.""" |
Collaborator
There was a problem hiding this comment.
Suggested change
| """Return target cpu architecture.""" | |
| """Return target cpu architecture, i.e. the cpu architecture where the fuzzer will run."" |
|
|
||
|
|
||
| def get_host_cpu_arch(): | ||
| """Helper method. Returns cpu architecture by parsing platform name.""" |
Collaborator
There was a problem hiding this comment.
Suggested change
| """Helper method. Returns cpu architecture by parsing platform name.""" | |
| """Returns cpu architecture of the current host.""" |
| return get_host_cpu_arch() | ||
|
|
||
|
|
||
| def get_host_cpu_arch(): |
Collaborator
There was a problem hiding this comment.
Thanks for adding this method. Could we replace calls to platform_util.machine().lower() or similar with this method?
Contributor
Author
There was a problem hiding this comment.
Thanks for the suggestion:D
Shall we create a new PR for fixing this Tech Debt?
I see several places where we use it, and worse when we are treating the platform on upper case (lol, we should create multiple conventions for CF repo)
Functions calling this function: machine
File Function Line
0 socks.py getpeername 369 machine (note: getproxypeername returns the proxy)
1 __init__.py version 1140 list(platform.architecture()) + [platform.machine()])
2 test_contracts.py test_cpu_count 240 @unittest.skipIf(MACOS and platform.machine() == 'arm64',
3 test_memleaks.py fewtimes_if_linux 369 @unittest.skipIf(MACOS and platform.machine() == 'arm64',
4 test_osx.py cpu_count 149 @unittest.skipIf(platform.machine() == 'arm64', "skipped due to #1892")
5 test_system.py assertGreater 516 @unittest.skipIf(MACOS and platform.machine() == 'arm64',
6 markers.py format_full_version 249 "platform_machine": platform.machine(),
7 markers.py format_full_version 183 "platform_machine": platform.machine(),
8 test_windows_wrappers.py win_launcher_exe 58 if (platform.machine() == "ARM64":
9 environment.py get_host_cpu_arch 236 machine = platform_util.machine().lower()
a common.py get_platform 222 if (platform.machine() == 'arm64' or platform.processor() == 'arm':
b socks.py getpeername 369 machine (note: getproxypeername returns the proxy)
c __init__.py version 1140 list(platform.architecture()) + [platform.machine()])
d test_contracts.py test_cpu_count 240 @unittest.skipIf(MACOS and platform.machine() == 'arm64',
e test_memleaks.py fewtimes_if_linux 369 @unittest.skipIf(MACOS and platform.machine() == 'arm64',
f test_osx.py cpu_count 149 @unittest.skipIf(platform.machine() == 'arm64', "skipped due to #1892")
g test_system.py assertGreater 516 @unittest.skipIf(MACOS and platform.machine() == 'arm64',
h markers.py format_full_version 249 "platform_machine": platform.machine(),
i markers.py format_full_version 183 "platform_machine": platform.machine(),
j test_windows_wrappers.py win_launcher_exe 58 if (platform.machine() == "ARM64":
Collaborator
There was a problem hiding this comment.
Fair, what do you think about only fixing the ones we added in the previous CL? I think that would be the one in src/clusterfuzz/_internal/bot/tasks/update_task.py?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
get_cpu_archmethod might be a bit confusing,get_target_cpu_archis a bitmore descriptive.
python butler.py py_unittest -t core -p commands_test.py(passed).python butler.py py_unittest -t core -p settings_test.py(passed).python butler.py py_unittest -t core -p environment_test.py(passed).Bug: 559993851
Signed-off-by: Manuel Briones manuelbriones@google.com