Commit 3d795c8
bazel-hermetic: preserve bazelisk/token env; robust id -un fallback
Two findings from the latest Gemini pass:
- Preserve BAZELISK_HOME, BAZELISK_BASE_URL, BAZELISK_GITHUB_TOKEN and
GITHUB_TOKEN through the pruned env. These are cache-location / mirror /
auth configuration (same class as the proxy and TLS vars already
passed), and they matter when the resolved bazel is a bazelisk wrapper
used directly via the fallback path: a custom cache dir, an enterprise
mirror, or GitHub rate-limit tokens would otherwise be lost.
- USER/LOGNAME fall back to `id -un 2>/dev/null || echo nobody`. In a
minimal container running under an arbitrary UID with no /etc/passwd
entry, `id -un` fails; under set -e the bare `$(id -un)` aborted the
exec. Verified with a stubbed failing id: the script now completes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>1 parent 1c303c7 commit 3d795c8
1 file changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
182 | 184 | | |
183 | 185 | | |
184 | 186 | | |
185 | | - | |
| 187 | + | |
| 188 | + | |
186 | 189 | | |
187 | 190 | | |
188 | 191 | | |
| |||
222 | 225 | | |
223 | 226 | | |
224 | 227 | | |
225 | | - | |
226 | | - | |
| 228 | + | |
| 229 | + | |
227 | 230 | | |
228 | 231 | | |
229 | 232 | | |
| |||
0 commit comments