Repository navigation
ci: pass environment to sudo explicitly instead of relying on -E - #568
Merged
Merged
Conversation
On the ubuntu-26.04 runner image, sudo prints "preserving the entire environment is not supported, '-E' is ignored". DBC_TEST_LEVEL_SYSTEM then never reaches the system-level Go tests: the system suite is skipped and the env-level suite runs as root instead, where file permission tests fail. Pass the needed variables through env(1) so the step does not depend on sudo's -E support, and drop the unused -E from the release workflow, which already passes its variables this way.
-E
zeroshade
approved these changes
Nov 6, 2026
zeroshade
left a comment
Member
There was a problem hiding this comment.
The fix works. On the ubuntu-26.04 image this PR's CI runs TestSubcommandsSystem and it passes (169 results), and the '-E' is ignored warning is gone. On main the system suite was skipped and TestSubcommandsEnv failed under sudo. Also passing GOTOOLCHAIN is right: without it, Go running as root falls back from setup-go's local to auto.
Non-blocking notes:
- Without
-E,HOMEis/root, so the sudo step skips setup-go's restored module cache and downloads the modules again (about 42). That takes a few seconds and is closer to what a user does. Pointing root at the runner's cache would leave root-owned files in it, so I'd leave this as is. - The comment could name the cause, e.g.
# Ubuntu 26.04's sudo ignores -E. - No release workflow ran on this PR, so the
release.ymledit is untested here. It is safe anyway: that step already passes every variable throughenv, and the rust system-level job passes on 26.04 with-Eignored.
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.
ubuntu-latestnow runs on the ubuntu-26.04 image, wheresudoignores-Eand prints "preserving the entire environment is not supported, '-E' is ignored" (example run). As a result,DBC_TEST_LEVEL_SYSTEMnever reaches the system-level Go tests. The system suite is skipped, and the env-level suite runs as root instead. Its file permission tests then fail.This passes the needed variables to
sudothroughenvexplicitly. It also drops the unused-Efrom the release workflow, which already passes its variables that way.