Commit b61f9d3
bazel-hermetic: read builtin for signature; indirect env lookup
Two style/robustness findings from the latest Gemini pass:
- Read the bazel signature with `read -r -n 2` instead of a `head`
subprocess; the redirection still follows the symlink via open(), so
no head/realpath/readlink is involved. Verified it reads the ELF magic
through a symlink and matches "#!" for a shebang wrapper.
- Preserve environment via pure-bash indirect expansion: `${!var+x}`
tests whether the named variable is set (set -u-safe) and `${!var}`
reads it — no eval, no subprocess.
Full stub-bazel harness still green: build/repo_env, bug-case exit,
info passthrough, and the non-bazelisk-wrapper fallback.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>1 parent 5f9a5d5 commit b61f9d3
1 file changed
Lines changed: 14 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
| |||
186 | 188 | | |
187 | 189 | | |
188 | 190 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
197 | 199 | | |
198 | 200 | | |
199 | 201 | | |
| |||
0 commit comments