Commit 372d35b
authored
Fix Homebrew container install user (#467)
## Summary
Run the Homebrew setup commands in the `homebrew/brew` container as the
`linuxbrew` user instead of root, while discovering the `brew`
executable from the container PATH at runtime.
The container job still runs as root so GitHub Actions checkout/tooling
can write to the mounted workspace, but recent `homebrew/brew` images
have been brittle when `brew install` itself runs as root. PR #466 is
currently failing before Rust setup/tests with Homebrew crashing while
pouring the `ca-certificates` bottle:
```text
undefined method '[]' for nil
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/bottles.rb:127:in 'Utils::Bottles.load_tab'
```
This PR keeps the existing container shape but switches the install step
to:
```bash
brew_bin="$(command -v brew)"
su linuxbrew -c "${brew_bin} update || true"
su linuxbrew -c "${brew_bin} install python@3.12 python@3.11"
```
That avoids hardcoding the Linuxbrew prefix while still avoiding
root-owned Homebrew install behavior.
## Validation
This is a CI-only workaround. The useful validation is the
`ci-homebrew-container` Actions job on this PR.1 parent 2ff10b0 commit 372d35b
1 file changed
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
414 | 414 | | |
415 | 415 | | |
416 | 416 | | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
421 | 423 | | |
422 | 424 | | |
423 | 425 | | |
| |||
0 commit comments