robobun
f0295ce0a5
Fix bunfig.toml parsing with UTF-8 BOM ( #23276 )
...
Fixes #23275
### What does this PR do?
This PR fixes a bug where `bunfig.toml` files starting with a UTF-8 BOM
(byte order mark, `U+FEFF` or bytes `0xEF 0xBB 0xBF`) would fail to
parse with an "Unexpected" error.
The fix uses Bun's existing `File.toSource()` function with
`convert_bom: true` option when loading config files. This properly
detects and strips the BOM before parsing, matching the behavior of
other file readers in Bun (like the JavaScript lexer which treats
`0xFEFF` as whitespace).
**Changes:**
- Modified `src/cli/Arguments.zig` to use `bun.sys.File.toSource()` with
BOM conversion instead of manually reading the file
- Simplified the config loading code by removing intermediate file
handle and buffer logic
### How did you verify your code works?
Added comprehensive regression tests in
`test/regression/issue/23275.test.ts` that verify:
1. ✅ `bunfig.toml` with UTF-8 BOM parses correctly without errors
2. ✅ `bunfig.toml` without BOM still works (regression test)
3. ✅ `bunfig.toml` with BOM and actual config content parses the content
correctly
All three tests pass with the debug build:
```
3 pass
0 fail
11 expect() calls
Ran 3 tests across 1 file. [6.41s]
```
🤖 Generated with [Claude Code](https://claude.com/claude-code )
---------
Co-authored-by: Claude Bot <claude-bot@bun.sh >
Co-authored-by: Claude <noreply@anthropic.com >
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-10-05 17:22:37 -07:00
..
2025-07-15 22:02:03 -07:00
2024-09-03 21:32:52 -07:00
2024-09-12 16:44:03 -07:00
2025-05-08 23:22:16 -07:00
2024-09-03 21:32:52 -07:00
2024-09-11 17:33:01 -07:00
2025-01-31 22:39:43 -08:00
2025-09-24 15:19:16 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2025-08-06 06:44:46 -07:00
2025-02-15 01:16:28 -08:00
2025-02-26 16:02:15 -08:00
2024-09-03 21:32:52 -07:00
2025-05-08 23:22:16 -07:00
2025-05-08 23:22:16 -07:00
2025-07-14 00:47:53 -07:00
2025-05-08 23:22:16 -07:00
2025-01-28 17:23:57 -08:00
2025-02-19 20:21:52 -08:00
2025-05-08 23:22:16 -07:00
2025-06-03 13:23:12 -07:00
2025-09-20 00:35:42 -07:00
2025-06-03 23:41:37 -07:00
2025-09-17 03:33:14 -07:00
2025-09-30 19:41:35 -07:00
2025-08-18 16:47:45 -07:00
2025-09-06 01:40:36 -07:00
2025-08-25 17:37:12 -07:00
2025-09-20 00:35:42 -07:00
2025-09-20 00:35:42 -07:00
2025-09-20 00:35:42 -07:00
2025-09-20 00:35:42 -07:00
2024-09-03 21:32:52 -07:00
2024-08-31 02:29:16 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-11-21 17:46:45 -08:00
2024-01-23 20:03:56 -08:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2025-07-14 00:47:53 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2025-09-20 00:35:42 -07:00
2024-09-03 21:32:52 -07:00
2025-07-14 00:47:53 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-08-30 20:14:47 -07:00
2024-12-10 12:43:17 -08:00
2024-12-10 12:43:17 -08:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2025-01-17 22:08:07 -08:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-10-04 18:14:20 -07:00
2025-09-02 23:30:52 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2025-09-20 00:35:42 -07:00
2025-09-20 00:35:42 -07:00
2025-05-08 23:22:16 -07:00
2024-09-03 21:32:52 -07:00
2024-06-14 01:50:36 -07:00
2025-09-26 03:54:41 -07:00
2025-09-20 00:35:42 -07:00
2025-09-07 21:43:38 -07:00
2024-09-03 21:32:52 -07:00
2025-09-20 00:35:42 -07:00
2025-09-20 00:35:42 -07:00
2025-09-20 00:35:42 -07:00
2025-09-30 21:47:31 -07:00
2025-09-24 15:19:16 -07:00
2025-09-20 00:35:42 -07:00
2025-09-20 00:35:42 -07:00
2025-09-02 03:26:51 -07:00
2025-05-08 23:22:16 -07:00
2025-09-20 00:35:42 -07:00
2025-07-14 20:50:32 -07:00
2025-05-08 23:22:16 -07:00
2025-05-08 23:22:16 -07:00
2025-05-08 23:22:16 -07:00
2025-05-08 23:22:16 -07:00
2025-05-08 23:22:16 -07:00
2025-05-08 23:22:16 -07:00
2025-07-20 23:38:24 -07:00
2025-05-08 23:22:16 -07:00
2025-03-03 21:38:05 -08:00
2025-09-03 18:57:39 -07:00
2025-09-03 18:57:39 -07:00
2025-09-03 18:57:39 -07:00
2025-09-03 18:57:39 -07:00
2025-05-26 21:18:22 -07:00
2025-05-08 23:22:16 -07:00
2025-08-01 19:30:51 -07:00
2025-08-06 06:39:25 -07:00
2025-09-02 01:59:06 -07:00
2025-05-16 22:30:58 -07:00
2025-09-20 00:35:42 -07:00
2025-09-20 00:35:42 -07:00
2025-09-20 00:35:42 -07:00
2025-09-20 00:35:42 -07:00
2025-09-15 14:24:03 -07:00
2025-09-20 00:35:42 -07:00
2025-09-20 00:35:42 -07:00
2025-09-20 00:35:42 -07:00
2025-09-20 00:35:42 -07:00
2025-09-02 03:26:25 -07:00
2025-07-03 01:06:22 -07:00
2025-09-20 00:35:42 -07:00
2025-09-20 00:35:42 -07:00
2025-09-20 00:35:42 -07:00
2025-09-20 00:35:42 -07:00
2025-09-20 00:35:42 -07:00
2025-07-23 22:31:42 -07:00
2025-09-08 20:59:24 -07:00
2025-08-14 16:34:38 -07:00
2025-08-15 22:35:38 -07:00
2025-08-15 21:25:54 -07:00
2025-09-20 00:35:42 -07:00
2025-09-20 00:35:42 -07:00
2025-08-15 20:59:50 -07:00
2025-08-27 15:31:28 -07:00
2025-09-15 23:37:10 -07:00
2025-09-26 04:59:07 -07:00
2025-09-07 17:42:09 -07:00
2025-09-08 14:12:00 -07:00
2025-09-14 04:14:48 -07:00
2025-09-24 18:25:39 -07:00
2025-09-24 18:25:39 -07:00
2025-09-24 18:29:15 -07:00
2025-09-25 23:52:56 -07:00
2025-09-27 00:55:54 -07:00
2025-10-03 15:55:57 -07:00
2025-10-05 17:22:37 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-10-14 13:43:06 -07:00
2025-05-08 23:22:16 -07:00
2025-05-08 23:22:16 -07:00
2025-05-08 23:22:16 -07:00
2024-11-18 19:29:55 -08:00
2024-03-30 20:57:40 -07:00
2025-08-26 16:51:41 -07:00
2025-09-22 22:22:58 -07:00
2025-09-22 22:22:58 -07:00
2025-08-09 05:11:50 -07:00
2025-09-04 18:17:14 -07:00
2025-05-08 23:22:16 -07:00
2025-07-15 22:02:03 -07:00
2025-07-15 22:02:03 -07:00
2025-03-04 14:16:18 -08:00
2025-09-26 22:21:00 -07:00
2025-07-25 13:59:33 -07:00
2025-08-15 22:35:38 -07:00
2025-09-20 00:29:15 -07:00
2025-09-02 01:53:39 -07:00
2025-07-25 22:22:04 -07:00
2025-08-19 18:47:04 -07:00
2025-08-18 03:04:37 -07:00
2025-09-19 17:32:12 -07:00
2025-08-18 16:47:45 -07:00
2025-09-12 23:44:48 -07:00
2025-07-15 22:31:54 -07:00
2025-09-10 18:47:50 -07:00
2025-08-19 18:08:00 -07:00
2025-07-15 16:20:34 -07:00
2025-07-15 16:20:34 -07:00
2025-08-22 22:39:47 -07:00
2025-08-28 17:16:37 -07:00
2025-07-20 23:02:10 -07:00
2025-08-09 06:40:36 -07:00
2025-08-30 01:05:51 -07:00
2025-09-13 01:00:57 -07:00
2025-09-13 01:00:57 -07:00
2025-09-13 01:00:57 -07:00
2025-07-17 04:33:30 -07:00
2025-08-20 00:02:14 -07:00
2025-09-24 16:29:05 -07:00