setup-r-dependencies: switch back to classic sudo on runners with sudo-rs - #1096
setup-r-dependencies: switch back to classic sudo on runners with sudo-rs#1096jeroen wants to merge 1 commit into
Conversation
sudo-rs, the default sudo on Ubuntu 25.10+ (and thus ubuntu-26.04
GitHub-hosted runners), does not support bare -E:
sudo: preserving the entire environment is not supported, '-E' is ignored
With the environment dropped, R_LIB_FOR_PAK is empty inside the sudo'd
R process, so the pak installation fails.
Switch the sudo alternative back to classic sudo (/usr/bin/sudo.ws)
when it is available, and add ubuntu-26.04 and ubuntu-26.04-arm to the
test matrix.
Fixes #1094
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v2-branch #1096 +/- ##
==========================================
Coverage 83.33% 83.33%
==========================================
Files 3 3
Lines 12 12
==========================================
Hits 10 10
Misses 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
A more sustainable fix might be |
|
Of course, missed the earlier PR. The |
|
It seems pretty fragile to pass a subset of env vars. There is no security issue here, we should keep using |
Alternative solution for #1094 (see also #1095).
sudo-rs, the default sudo on Ubuntu 25.10+ (and thus ubuntu-26.04 GitHub-hosted runners), does not support bare
-E:With the environment dropped,
R_LIB_FOR_PAKis empty inside the sudo'd R process, so the pak installation fails.Instead of changing the sudo invocation, this switches the
sudoalternative back to classic sudo before installing pak:This is guarded by a check that
/usr/bin/sudo.wsexists, so it is a no-op on runners that ship classic sudo only.Also adds
ubuntu-26.04andubuntu-26.04-armto the test matrix so this is exercised in CI.Fixes #1094
🤖 Generated with Claude Code