Skip to content

Fix R tests on Windows when the rig Rscript wrapper is quarantined - #15419

Merged
cderv merged 1 commit into
mainfrom
fix/run-tests-rig-wrapper-fallback
Nov 24, 2026
Merged

cderv merged 1 commit into
mainfrom
fix/run-tests-rig-wrapper-fallback

Conversation

@cderv

@cderv cderv commented Nov 23, 2026

Copy link
Copy Markdown
Member

On Windows, endpoint security software can quarantine the Rscript.exe wrapper that rig proj sync writes in tests/.rvenv/bin. rig builds a new one for each project, so it is an unknown executable every time. run-tests.ps1 still pointed QUARTO_R there, and every R test failed with Failed to spawn '...\.rvenv\bin\Rscript': File not found.

The wrapper only sets the project library variables and starts the R recorded in tests/.rvenv/rvenv.cfg. When Rscript.exe is missing, run-tests.ps1 now does the same itself and prints a warning. With the wrapper present, nothing changes.

Checklist

I have (if applicable):

  • referenced the GitHub issue this PR closes
  • updated the appropriate changelog in the PR
  • ensured the present test suite passes
  • added new tests
  • created a separate documentation PR in Quarto's website repo and linked it to this PR
AI-assisted PR
  • AI tool used: Claude Code (Opus)
  • Codebase grounding: local clone
  • Human review: I have reviewed, tested, and verified the AI-generated content before submitting.

Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.

run-tests.ps1 pointed QUARTO_R at tests/.rvenv/bin as soon as the
directory existed. rig builds the R.exe and Rscript.exe wrappers there
for each project, so each new checkout gets an executable nobody has
seen before, and endpoint security software can quarantine it
(CrowdStrike Falcon removed Rscript.exe minutes after `rig proj sync`).
Every R test then failed with "Failed to spawn ...\.rvenv\bin\Rscript:
File not found", and rig has no option to skip the wrappers.

The wrappers only set RVENV, R_LIBS_USER, R_LIBS, R_LIBS_SITE and
R_REPOSITORIES (the same variables as rig's Activate.ps1) and start the
R recorded as r-binary in .rvenv/rvenv.cfg. When Rscript.exe is
missing, run-tests.ps1 now sets those variables itself, points QUARTO_R
at that R, and warns. Every variable it sets is restored after the run.

With the wrapper present the behaviour is unchanged, so CI runners are
not affected.
@posit-snyk-bot

posit-snyk-bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

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

Status Scan Engine 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
cderv merged commit 139e6d6 into main Nov 24, 2026
52 checks passed
@cderv
cderv deleted the fix/run-tests-rig-wrapper-fallback branch November 24, 2026 10:50
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.

2 participants