-
Notifications
You must be signed in to change notification settings - Fork 394
fix(R): detect x64 R on Windows ARM via exit codes #13822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
cderv
wants to merge
6
commits into
main
Choose a base branch
from
fix/windows-arm-r-error-code
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+41
−1
Conversation
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
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
8669ef6 to
fdb7f2e
Compare
Collaborator
Author
When x64 R crashes on Windows ARM, detect specific exit codes and provide helpful error message instead of generic "check your R installation". Detects two crash scenarios: - Native ARM hardware: -1073741569 (STATUS_NOT_SUPPORTED) - Windows ARM VM on Mac: -1073741819 (STATUS_ACCESS_VIOLATION) Both occur when rmarkdown package loads under x64 emulation. R script completes successfully and produces YAML before crashing during cleanup. These error codes are unique to x64 R on ARM Windows, so checking them directly is sufficient without needing to verify ARM hardware via Windows API. Closes #8730 Related: #13790
Add references to issue #8730 and quarto-windows-arm test repository in code comments to help future contributors understand the context.
Make error message more actionable: - Show detected error code - Explain x64 R on Windows ARM issue - Provide step-by-step fix instructions - Link to issue #8730 for context
Use errorOnce() instead of rethrowing WindowsArmX64RError to prevent duplicate error messages when printCallRDiagnostics() calls knitrCapabilities() again. Returns undefined like other knitrCapabilities errors without changing general error handling in callR().
Extract x64 R crash detection into helper function for better code organization. Function name clearly indicates it throws on detection.
1765bdd to
07470f5
Compare
Collaborator
Author
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.


When x64 R crashes on Windows ARM, Quarto shows a generic "check your R installation" error instead of explaining the actual problem. This leaves users stuck with no clear path forward.
Root Cause
x64 R running under emulation on Windows ARM crashes with specific exit codes when loading the rmarkdown package. The R script completes successfully and produces valid YAML output before crashing during process termination.
Two crash scenarios observed:
Fix
Detect these specific exit codes and throw
WindowsArmX64RErrorwith a helpful message directing users to install native ARM64 R.This approach is simpler than PR #13790's YAML parsing method - just 8 lines of error code checking vs 30+ lines of regex matching and YAML parsing.
Implementation
src/core/knitr.ts:WindowsArmX64RErrorclass for type-safe error handlingknitrCapabilities()fails on Windows ARMquarto checkto display to userTesting
Requires Windows ARM hardware to test:
Closes #8730
Related: #13790