Skip to content

Improve platform architecture detection for arm on Linux and Windows#290

Merged
camdecoster merged 5 commits into
plotly:mainfrom
juliabeliaeva:julia/platform-detection
Jun 24, 2026
Merged

Improve platform architecture detection for arm on Linux and Windows#290
camdecoster merged 5 commits into
plotly:mainfrom
juliabeliaeva:julia/platform-detection

Conversation

@juliabeliaeva

@juliabeliaeva juliabeliaeva commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

This PR allows better detection of arm processors on Linux and Windows to prevent downloading incorrect binaries and to show a better error message.

Closes #289.

@camdecoster camdecoster self-assigned this May 28, 2026
@camdecoster

Copy link
Copy Markdown
Contributor

Thanks for the PR! I'll try to review this soon.

@camdecoster camdecoster left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great change! I'd like a couple of changes, but this is an improvement.

Comment thread src/choreographer/cli/_cli_utils.py Outdated
arch_detected = "arm" if platform.processor() == "arm" else "x"
def get_google_platform_string() -> str | None:
arch_size_detected = "64" if sys.maxsize > 2 ** 32 else "32"
is_x86 = platform.processor() not in {"arm", "aarch64"}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please refactor your PR to use platform.machine() instead? platform.processor() on my Linux machine just returns an empty string. In that case, is_x86 would be True which would lead to the incorrect download.

Comment thread src/choreographer/cli/_cli_utils.py Outdated
chrome_platform_detected = get_google_platform_string()
if chrome_platform_detected in supported_platform_strings:
return chrome_platform_detected
return ""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's return None instead of an empty string to match the type annotation.

Suggested change
return ""
return None

def get_google_supported_platform_string() -> str | None:
arch_size_detected = "64" if sys.maxsize > 2**32 else "32"
arch_detected = "arm" if platform.processor() == "arm" else "x"
def get_google_platform_string() -> str | None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def get_google_platform_string() -> str | None:
# Returns the detected platform string, including ones not in
# supported_platform_strings (e.g. linux-arm64, win-arm64) so callers
# can surface them in error messages.
def get_google_platform_string() -> str | None:

@camdecoster camdecoster merged commit 57f3f8c into plotly:main Jun 24, 2026
4 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linux arm 64 architecture is not detected

2 participants