air icon indicating copy to clipboard operation
air copied to clipboard

v1.62.0 breaks `--build.bin` backwards compatibility

Open momin-javed opened this issue 8 months ago • 3 comments

I am running:

# air --build.bin "appname cmdname"

It is erroring while previously it used to work with v1.61.7

/bin/sh: /go/src/github.com/orgname/appname/appname cmdname: not found

momin-javed avatar May 31 '25 09:05 momin-javed

it happens on my project as well, suddenly my docker won't work when I rebuild the container

downgrade to RUN go install github.com/air-verse/[email protected] fixed this issues

[build]
  bin = "./tmp/main serve --config config_local.yaml"
  cmd = "go build -o ./tmp/main ."

ardasatata avatar Jun 02 '25 08:06 ardasatata

Same for me, downgraded for now.

marcomayer avatar Jun 02 '25 13:06 marcomayer

Moving args to args_bin solved the issue for me:

[build]  
bin = "tmp/main"  
args_bin = ["args"]

Possibly introduced by this commit? https://github.com/air-verse/air/commit/a830e5a27ac354edcd6c6d190dd678a78bc06035

sdkawata avatar Jun 09 '25 01:06 sdkawata

Also broke in my project.

Before Update (broken):

[build]
bin = "./tmp/main app serve"

Working after update

[build]
full_bin = "tmp/main app serve"

I think this breaking change was done to make file paths with spaces work. The shell tries to execute the entire bin as a path with spaces, but the error message No such file or directory which the shell gives is pretty confusing to user's updating especially so because the current readme provides an unrelated fix for the issue.

I think full_bin is the same as the old functionality and might not work for users with spaces in their directory, so using args as recommended by the above comments is probably better.

Pjt727 avatar Jul 10 '25 13:07 Pjt727

Do you still have this issue in the latest version of air?

xiantang avatar Nov 10 '25 14:11 xiantang

https://github.com/air-verse/air/issues/824 see this issue.

xiantang avatar Nov 17 '25 12:11 xiantang