Skip to content

[codex] Auto-use sudo in Linux setup scripts#444

Merged
DorianZheng merged 1 commit into
mainfrom
codex/auto-use-sudo-in-linux-setup
Apr 20, 2026
Merged

[codex] Auto-use sudo in Linux setup scripts#444
DorianZheng merged 1 commit into
mainfrom
codex/auto-use-sudo-in-linux-setup

Conversation

@DorianZheng

Copy link
Copy Markdown
Member

Summary

This changes the Linux setup scripts to auto-use sudo when the current shell is not already running as root.

What Changed

  • added shared setup_sudo, require_root_or_sudo, and run_with_sudo helpers in scripts/setup/setup-common.sh
  • switched the Ubuntu, manylinux, and musllinux setup flows to route package-manager and /usr/local writes through the shared sudo helper
  • removed the duplicated Ubuntu-only sudo detection now that the behavior lives in shared setup code

Why

make setup on manylinux failed immediately for non-root users because the manylinux setup script invoked yum, pip3, unzip, and tar directly, unlike the Ubuntu setup flow which already auto-used sudo. This makes the Linux setup behavior consistent across supported distributions.

User Impact

Non-root users can run make setup on manylinux and musllinux the same way they do on Ubuntu, with sudo applied automatically when system package installation or writes to /usr/local are required.

Validation

  • bash -n scripts/setup/setup-common.sh
  • bash -n scripts/setup/setup-manylinux.sh
  • bash -n scripts/setup/setup-musllinux.sh
  • bash -n scripts/setup/setup-ubuntu.sh
  • git diff --check

@DorianZheng DorianZheng marked this pull request as ready for review April 20, 2026 02:19
@DorianZheng DorianZheng merged commit 1a07099 into main Apr 20, 2026
@DorianZheng DorianZheng deleted the codex/auto-use-sudo-in-linux-setup branch April 20, 2026 02:19
@DorianZheng DorianZheng restored the codex/auto-use-sudo-in-linux-setup branch April 20, 2026 03:10
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.

1 participant