Skip to content

bunfig: load global ~/.bunfig.toml for runtime commands; fall back past $XDG_CONFIG_HOME - #34987

Closed
robobun wants to merge 10 commits into
mainfrom
claude/farm/55a9ccd1/global-bunfig-runtime
Closed

bunfig: load global ~/.bunfig.toml for runtime commands; fall back past $XDG_CONFIG_HOME#34987
robobun wants to merge 10 commits into
mainfrom
claude/farm/55a9ccd1/global-bunfig-runtime

[autofix.ci] apply automated fixes

f1836bb
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 21, 2026 in 35m 52s

Code review found 1 important issue

Found 4 candidates, confirmed 4. See review comments for details.

Details

Severity Count
🔴 Important 1
🟡 Nit 3
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important src/options_types/command_tag.rs:90-93 Standalone --compile binaries now read the end-user's ~/.bunfig.toml (and crash if it's malformed)
🟡 Nit src/options_types/command_tag.rs:90-93 Two more global→local dual-parse merge gaps: [test].retry×rerunEach hard-fails; [serve.static].bunfig_path desyncs from

Annotations

Check failure on line 93 in src/options_types/command_tag.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

Standalone --compile binaries now read the end-user's ~/.bunfig.toml (and crash if it's malformed)

Flipping `RunCommand.read_global_config()` to `LOADS_CONFIG[self]` also affects standalone `--compile` binaries: `boot_standalone` at `run_command.rs:1149` calls `load_config_path(RunCommand, …)` directly, so with the default `autoloadBunfig: true` a distributed executable now reads the *end-user's* `$XDG_CONFIG_HOME/.bunfig.toml` / `~/.bunfig.toml` — applying their `preload`/`define`/`smol`/`[run]` to the shipped app, and hard-crashing via `report_bunfig_load_failure → Global::crash()` if that 

Check warning on line 93 in src/options_types/command_tag.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

Two more global→local dual-parse merge gaps: [test].retry×rerunEach hard-fails; [serve.static].bunfig_path desyncs from serve_plugins

Two more same-class merge gaps beyond the `jsx.runtime` one above: **(1)** the `[test].rerunEach`/`retry` mutual-exclusion checks in `bunfig.rs` read `self.ctx.test_options.retry`/`.repeat_count` (persisted from the global parse) rather than the current file's keys, so global `[test] retry=3` + local `[test] rerunEach=2` now hard-fails `bun test` with an error located in the local file that has no `retry` key — check `test_.get(b"retry")` instead, or zero the counterpart when one is set. **(2)**