Can't pass -extldflags -static because it's not valid for go get
I would like to be able to statically build Caddy with https://github.com/mliezun/caddy-snake
Running `CGO_ENABLED=1 XCADDY_GO_BUILD_FLAGS='-extldflags -static' xcaddy build --output /caddy --with github.com/mliezun/caddy-snake`
results in
```
0.345 2025/06/30 11:34:32 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -v -extldflags -static github.com/caddyserver/caddy/v2
0.347 flag provided but not defined: -extldflags
```
Perhaps not all flags should be passed to `go get`, or there should be a way to tell xcaddy to link statically, or another environment variable should be used for LDFLAGS.
关闭于 2025-06-30 2 条评论