purpleidea / mgmt

Next generation distributed, event-driven, parallel config management!
https://purpleidea.com/tags/mgmtconfig/
GNU General Public License v3.0
3.47k stars 308 forks source link

Build fails with invalid value for flag -ldflags #752

Closed saraedum closed 3 months ago

saraedum commented 3 months ago

Versions:

Description:

I tried to follow the quickstart instructions. But buildah build -f Dockerfile-fedora.build -t mgmt_build fails with

STEP 14/15: RUN make build
go: updates to go.mod needed; to update it:
    go mod tidy
Generating: lexer...
Generating: parser...
Generating: interpolation...
Generating: type kind strings...
Generating: funcs...
go: downloading github.com/iancoleman/strcase v0.3.0
Building: mgmt, os/arch: linux-amd64, version: 0.0.26-1-g964b1dc5...
time env GOOS=linux GOARCH=amd64 go build -trimpath -ldflags=="-X main.program=mgmt -X main.version=0.0.26-1-g964b1dc5 -s -w " -o build/mgmt-linux-amd64
invalid value "=-X main.program=mgmt -X main.version=0.0.26-1-g964b1dc5 -s -w " for flag -ldflags: missing <pattern> in <pattern>=<value>
usage: go build [-o output] [build flags] [packages]
purpleidea commented 3 months ago

The docker build is really unmaintained as I don't think anyone is using it, so it likely rotted. I'd recommend just doing make in a vm. Maybe something about buildah is different? Do you see the same issue with regular docker?

saraedum commented 3 months ago

Maybe something about buildah is different? Do you see the same issue with regular docker?

docker build -t mgmt-debian -f docker/Dockerfile . seem to work.

purpleidea commented 3 months ago

TBQH, I never use docker, so I usually just merge whatever the last person says was necessary for anything docker related =D