Repository navigation
Default rig to user mode in configure-test-env.ps1 - #15327
Merged
Merged
Conversation
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.
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. |
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)
5 tasks
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.
Follow-up to #15308 and #15319. On Windows, rig runs in admin mode by default, so
configure-test-env.ps1raises 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 forrig proj(r-lib/rig#503, "userig projin user mode").The script now sets
RIG_MODE=userwhen the variable is unset, so an explicitRIG_MODEor 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.cfgrecords the absolute path of the R thatrig proj syncselected.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 withoutRIG_MODE=user. The UAC prompt itself was not re-observed, because R was already installed by then.Checklist
I have (if applicable):
AI-assisted PR
Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.