Skip to content

Default rig to user mode in configure-test-env.ps1 - #15327

Merged
cderv merged 1 commit into
mainfrom
fix/configure-test-env-rig-user-mode
Nov 10, 2026
Merged

cderv merged 1 commit into
mainfrom
fix/configure-test-env-rig-user-mode

Conversation

@cderv

@cderv cderv commented Nov 10, 2026

Copy link
Copy Markdown
Member

Follow-up to #15308 and #15319. On Windows, rig runs in admin mode by default, so configure-test-env.ps1 raises a UAC elevation prompt when it installs R. User mode installs R into the user profile without elevation, and it is what rig's maintainer recommends for rig proj (r-lib/rig#503, "use rig proj in user mode").

The script now sets RIG_MODE=user when the variable is unset, so an explicit RIG_MODE or a rig config still wins, and removes it again at the end so dot-sourcing the script does not change the caller's shell. The tests do not need the variable: tests/.rvenv/rvenv.cfg records the absolute path of the R that rig proj sync selected.

Only the PowerShell script changes. On Linux, rig's user mode installs portable R builds, which rig documents as less tested than the distro builds. CI is unaffected, since it does not call this script.

On Windows with rig in admin mode, the script selected R 4.6.2 under %APPDATA%\rig\data\r, synced the lock and installed dev knitr and rmarkdown, and a knitr smoke-all document passed with and without RIG_MODE=user. The UAC prompt itself was not re-observed, because R was already installed by then.

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
  • Codebase grounding: local clone, Context7 MCP
  • 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.

rig defaults to admin mode, where installing R elevates and raises a UAC prompt on every setup run on Windows. User mode installs R in the user profile without elevation, which is also what the rig maintainer recommends for `rig proj` (r-lib/rig#503).

The script sets RIG_MODE=user only when it is unset, so an explicit RIG_MODE or a rig config still wins, and removes it again at the end so dot-sourcing the script does not change the caller's shell. The selected R is recorded as an absolute path in `.rvenv/rvenv.cfg`, so the tests do not need the variable.

Only the PowerShell script changes. On Linux, user mode installs portable R builds that rig documents as less tested than the distro builds.

Checked on Windows: with RIG_MODE unset the script selects R 4.6.2 under %APPDATA%\rig\data\r, syncs the lock and installs dev knitr and rmarkdown, and leaves RIG_MODE unset in the calling shell. A knitr smoke-all document passes with and without RIG_MODE=user.
@posit-snyk-bot

posit-snyk-bot commented Nov 10, 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 1ad9b3d into main Nov 10, 2026
52 checks passed
@cderv
cderv deleted the fix/configure-test-env-rig-user-mode branch November 10, 2026 12:22
cderv added a commit that referenced this pull request Nov 10, 2026
rig defaults to admin mode, where installing R elevates and raises a UAC prompt on every setup run on Windows. User mode installs R in the user profile without elevation, which is also what the rig maintainer recommends for `rig proj` (r-lib/rig#503).

The script sets RIG_MODE=user only when it is unset, so an explicit RIG_MODE or a rig config still wins, and removes it again at the end so dot-sourcing the script does not change the caller's shell. The selected R is recorded as an absolute path in `.rvenv/rvenv.cfg`, so the tests do not need the variable.

Only the PowerShell script changes. On Linux, user mode installs portable R builds that rig documents as less tested than the distro builds.

Checked on Windows: with RIG_MODE unset the script selects R 4.6.2 under %APPDATA%\rig\data\r, syncs the lock and installs dev knitr and rmarkdown, and leaves RIG_MODE unset in the calling shell. A knitr smoke-all document passes with and without RIG_MODE=user.

(cherry picked from commit 1ad9b3d)
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