Fix ir run on rig-managed Windows - #41
Merged
Merged
Conversation
t-kalinowski
reviewed
Jun 4, 2026
Two Windows-only failures blocked `ir run` (#32). The no-`--r-version` path resolved the bare name `Rscript`, which on a rig-managed Windows install is only `Rscript.bat` (from `rig system make-links`). `std::process::Command` resolves `.exe` only and won't spawn a `.bat`, so the run failed before reaching R. Resolve the default install's real `Rscript.exe` from `rig list --json` instead — the same mechanism the `--r-version` path already uses — keeping `IR_RSCRIPT` as the top override and falling back to bare `Rscript` off rig. The script path was canonicalised for CWD-independence, but on Windows `fs::canonicalize` yields a `\\?\C:\...` verbatim path that quarto's Deno `expandGlobSync` cannot stat (`os error 123`). The path is now passed through untouched: R and quarto inherit `ir`'s working directory, so a relative path resolves as the user typed it. An existence check keeps the clear "cannot read script" error.
This was referenced Jun 4, 2026
Collaborator
Author
|
The None of those touch this PR's diff ( |
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.
On a rig-managed Windows machine,
ir runfails before reaching R, and even with an explicit--r-versionthe.qmdrender aborts in quarto. Two separate Windows-only bugs (#32).Default-R resolution hits the
.batshimWith no
--r-version, resolution falls back to the bare nameRscript. On a rig-managed Windows box the onlyRscriptonPATHisRscript.bat(fromrig system make-links), andstd::process::Commandresolves.exeonly — it won't spawn a.bat:The default install's real
Rscript.exeis now resolved fromrig list --json("default": true→ itsbinary), the same mechanism the--r-versionpath already uses.IR_RSCRIPTstays the top override; non-rig systems and Unix fall back to bareRscriptunchanged.Canonicalised script paths break quarto
The script path was canonicalised for CWD-independence. On Windows
fs::canonicalizereturns a\\?\C:\...verbatim path that Rscript tolerates but quarto's DenoexpandGlobSynccannot stat:The path is now passed through untouched. R and quarto both inherit
ir's working directory, so a relative path resolves exactly as the user typed it — no canonicalisation, no verbatim prefix. An existence check keeps the clear "cannot read script" error.Verified locally on a rig-managed Windows box: a default-R
.Rrun and a--r-version.qmdrender both succeed with the fixes.Fixes #32