Skip to content

Default configuration triggers its own deprecation warning for build.bin #884

@willie

Description

@willie

Describe the bug
When running air init, the tool prints a warning: [warning] build.bin is deprecated; set build.entrypoint instead, even though this warning is triggered by the default settings produced by defaultConfig() in runner/config.go.

To Reproduce

  • Run air init with no existing .air.toml in your repo.
  • Observe the warning: [warning] build.bin is deprecated; set build.entrypoint instead.
  • Inspect the code in defaultConfig() in runner/config.go, which sets Bin = "./tmp/main" and leaves Entrypoint empty by default.
  • The warning logic in warnDeprecatedBin triggers when Bin is set and Entrypoint is empty.
func defaultConfig() Config {
    build := cfgBuild{
        Cmd:          "go build -o ./tmp/main .",
        Bin:          "./tmp/main",    // <--- Deprecated field is set
        Entrypoint:   entrypoint{},    // <--- This being empty satisfies the warning condition
        // ...
    }
    // ...
}

func warnDeprecatedBin(cfg *Config) {
    if cfg == nil {
        return
    }
    if cfg.Build.Bin == "" || len(cfg.Build.Entrypoint) > 0 {
        return
    }
    fmt.Fprintln(os.Stdout, "[warning] build.bin is deprecated; set build.entrypoint instead")
}

Expected behavior
air init should not warn users about deprecated configuration in its default configuration. The tool's own defaults should not violate its own recommended practices.

Desktop:

  • OS: macOS 26.3
  • Air Version: 1.64.5

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions