Commit c4caac7
fix: use = syntax in go_build_options ldflags to avoid word-splitting
The release workflow was passing `-ldflags '-X ...'` via `go_build_options`,
which gets set as the `GO_BUILD_OPTIONS` environment variable. In
`build_and_release.sh`, this variable is expanded unquoted (`${GO_BUILD_OPTIONS}`),
so bash word-splits it on spaces. Single quotes inside an unquoted variable
expansion are literal characters, not shell quotes - causing `'-X` (with the
literal quote character) to be passed as the value for `-ldflags`, which is
invalid.
Fix: use `-ldflags=-X=path.Var=value` (no spaces, single token) so bash word
splitting produces exactly one argument. The `=` syntax is supported by both
the Go build tool (for `-ldflags`) and the Go linker (for `-X`).
Co-authored-by: skarim <1701557+skarim@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-stack/sessions/7f8aece9-d05c-478e-8864-ff0b5e00b3a81 parent 5cb96cf commit c4caac7
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
0 commit comments