mirror of
https://github.com/oven-sh/bun
synced 2026-03-02 05:21:05 +01:00
## Summary
- **SetupBuildkite.cmake**: The Buildkite API returns build JSON that
includes commit messages. Semicolons in commit messages (e.g. `fix:
handle edge cases; add tests`) cause CMake's unquoted `string(JSON ...
GET ${VAR} ...)` calls to split the JSON at every `;` (CMake's list
separator), resulting in garbled arguments and `FATAL_ERROR`. Fix:
escape semicolons before parsing and quote all JSON variable expansions.
- **Globals.cmake**: The `optionx()` macro reads environment variables
with `$ENV{...}` without quoting, so any env var containing a semicolon
would be split into a CMake list. Fix: quote the expansion.
- **Options.cmake / BuildBun.cmake**: Quote `REVISION`, `VERSION`,
`CODEGEN_PATH`, and other variables passed as `-D` flags to the Zig
build, preventing semicolons or special characters from splitting them.
- **utils.mjs `toYaml()`**: The YAML serializer only quoted strings
containing `:`, `#`, `'`, `"`, `\n`, `*`. Missing: `;`, `[`, `]`, `{`,
`}`, `&`, `!`, `|`, `>`, `%`, `@`, `` ` ``, `,`, `\`. Also now properly
escapes backslashes before quotes in double-quoted YAML strings.
## Test plan
- [x] `bun bd` builds successfully with these changes
- [x] Verified `toYaml()` correctly quotes strings with special
characters and leaves plain strings unquoted
- [ ] CI should pass with a commit message containing semicolons (this
PR's own CI run serves as a test)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>