Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Published 386 musl binary appears to be amd64 #35

Closed
tianon opened this issue Feb 9, 2022 · 1 comment · Fixed by #37
Closed

Published 386 musl binary appears to be amd64 #35

tianon opened this issue Feb 9, 2022 · 1 comment · Fixed by #37

Comments

@tianon
Copy link

tianon commented Feb 9, 2022

Hi! Building https://github.com/wallarm/api-firewall-docker/blob/5cd07f115f16d10095a385a73568a4e60caf278b/0.6.7/Dockerfile on i386 (docker build --platform linux/386) fails with /bin/sh: api-firewall: not found.

When downloading https://github.com/wallarm/api-firewall/releases/download/v0.6.7/api-firewall-386-musl.tar.gz in an amd64 container instead, I can successfully ldd (and run!) the binary:

$ docker run -it --rm alpine:3.15
/ # wget https://github.com/wallarm/api-firewall/releases/download/v0.6.7/api-firewall-386-musl.tar.gz
Connecting to github.com (192.30.255.113:443)
Connecting to objects.githubusercontent.com (185.199.111.133:443)
saving to 'api-firewall-386-musl.tar.gz'
api-firewall-386-mus 100% |********************************| 3589k  0:00:00 ETA
'api-firewall-386-musl.tar.gz' saved
/ # tar -xvf api-firewall-386-musl.tar.gz
./
./api-firewall
./LICENSE
/ # ldd api-firewall
	/lib/ld-musl-x86_64.so.1 (0x7f2461ac7000)
	libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f2461ac7000)
/ # ./api-firewall -v
Version: 0.6.7
Wallarm API-Firewall

I'm not 100% certain I'm looking in the right place, but it seems like

is maybe missing the same case block to set GOARCH=386 as build-x86: has?
case "${{ matrix.arch }}" in
"386")
export GOARCH=386
export GOHOSTARCH=amd64
export GOHOSTOS=linux
export GOOS=linux
;;
esac

Honestly, it should be pretty safe to just set GOARCH unilaterally -- if you're on amd64 and explicitly set GOARCH=amd64, it doesn't do anything (since that's the default detected value for that case). 😅

(Also, setting GOHOSTARCH and GOHOSTOS explicitly like that shouldn't be necessary.)

@MrEcco
Copy link
Contributor

MrEcco commented Feb 15, 2022

Thank you @tianon for your issue 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants