Skip to content

Conversation

@cderv
Copy link
Collaborator

@cderv cderv commented Dec 12, 2025

When x64 R fails on Windows ARM, parse YAML output to detect the architecture mismatch and provide a specific error message with ARM64 R download links instead of the generic "check your R installation" message.

Also adds platform information to quarto check output with warning when x64 R is detected on ARM Windows.

This is draft PR because I need to check this work as expected in windows ARM runner

When x64 R fails on Windows ARM, parse YAML output to detect the architecture
mismatch and provide a specific error message with ARM64 R download links
instead of the generic "check your R installation" message.

Also adds platform information to quarto check output with warning when
x64 R is detected on ARM Windows.
@posit-snyk-bot
Copy link
Collaborator

posit-snyk-bot commented Dec 12, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

cderv and others added 5 commits December 12, 2025 19:06
and general instructions for installing ARM64 R on Windows ARM rather than using specific links.
x64 R on Windows ARM is intermittently unstable under emulation - the same
command can succeed on first call but crash on second call. Previous detection
only ran when capabilities check failed, missing successful checks.

Now detects x64-on-ARM in both success and failure paths, ensuring consistent
error message regardless of intermittent emulation behavior.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Eliminates code duplication by extracting checkWindowsArmR() helper:
- Single source of truth for platform check
- Called in both success and failure paths
- Fixed error handling to preserve helpful error messages
- Removed dead warning code from knitrCapabilitiesMessage

Behavior unchanged: still throws error on x64 R detection.
Replace string matching with type-safe instanceof checks:
- Add WindowsArmX64RError custom error class
- Update checkWindowsArmR() to throw custom error
- Replace e.message.includes() checks with instanceof

More robust and follows TypeScript best practices.
Catch WindowsArmX64RError in knitrCb before withSpinner can swallow it,
then display the custom error message instead of the generic message.

This ensures users see the helpful x64-on-ARM error with download links
instead of "Please check your installation of R."
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.

3 participants