Skip to content

ci: pass environment to sudo explicitly instead of relying on -E - #568

Merged
zeroshade merged 1 commit into
columnar-tech:mainfrom
eitsupi:ci/sudo-explicit-env
Nov 6, 2026
Merged

zeroshade merged 1 commit into
columnar-tech:mainfrom
eitsupi:ci/sudo-explicit-env

Conversation

@eitsupi

@eitsupi eitsupi commented Nov 6, 2026

Copy link
Copy Markdown
Member

ubuntu-latest now runs on the ubuntu-26.04 image, where sudo ignores -E and prints "preserving the entire environment is not supported, '-E' is ignored" (example run). As a result, DBC_TEST_LEVEL_SYSTEM never 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 sudo through env explicitly. It also drops the unused -E from the release workflow, which already passes its variables that way.

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.
@eitsupi eitsupi changed the title ci: pass environment to sudo explicitly instead of relying on -E ci: pass environment to sudo explicitly instead of relying on -E Nov 6, 2026

@zeroshade zeroshade left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, HOME is /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.yml edit is untested here. It is safe anyway: that step already passes every variable through env, and the rust system-level job passes on 26.04 with -E ignored.

@zeroshade
zeroshade merged commit a8efc37 into columnar-tech:main Nov 6, 2026
13 checks passed
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