-
Notifications
You must be signed in to change notification settings - Fork 13
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
multi arch support #25
Conversation
crazy-max
commented
Sep 23, 2022
•
edited
Loading
edited
- buildx
- compose
- containerd
- credential-helpers
- docker-cli
- docker-engine
- scan
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Looks like the base go image (
Repro with $ docker run --rm -t --platform linux/s390x golang:bullseye go env
Unable to find image 'golang:bullseye' locally
bullseye: Pulling from library/golang
cf58bfabf9fb: Pull complete
ce515b66a74a: Pull complete
36bf6be09afa: Pull complete
ff4c0b442ebb: Pull complete
de9b6d274b98: Pull complete
85cd147201cd: Pull complete
e1b78db19f94: Pull complete
Digest: sha256:d92ddd8ad9d960c67dc34cffc2ed7b0ef399be2549505bf5ef94a7f4ca016a05
Status: Downloaded newer image for golang:bullseye
GO111MODULE=""
GOARCH="s390x"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="s390x"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_s390x"
GOVCS=""
GOVERSION="go1.19.1"
GCCGO="gccgo"
AR="ar"
CC="s390x-linux-gnu-gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -march=z196 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build671129115=/tmp/go-build -gno-record-gcc-switches" Looks good with other platforms. I guess that's because for Edit: Hum doesn't look like it: https://github.com/docker-library/golang/blob/2a6ba509d511d58eeb14b81888133745bfe7ef5b/1.18/bullseye/Dockerfile#L56. Maybe you have an idea @tianon? cc @thaJeztah |
Sorry, not sure I understand what's the failure/problem is? The --- /dev/fd/63 2022-09-23 12:42:00.406387513 -0700
+++ /dev/fd/62 2022-09-23 12:42:00.406387513 -0700
@@ -1,12 +1,12 @@
GO111MODULE=""
-GOARCH="amd64"
+GOARCH="s390x"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
-GOHOSTARCH="amd64"
+GOHOSTARCH="s390x"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/go/pkg/mod"
@@ -19,13 +19,12 @@
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
-GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
+GOTOOLDIR="/usr/local/go/pkg/tool/linux_s390x"
GOVCS=""
GOVERSION="go1.19.1"
GCCGO="gccgo"
-GOAMD64="v1"
AR="ar"
-CC="gcc"
+CC="s390x-linux-gnu-gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
@@ -36,4 +35,4 @@
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
-GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3686874489=/tmp/go-build -gno-record-gcc-switches"
+GOGCCFLAGS="-fPIC -m64 -march=z196 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build4014933557=/tmp/go-build -gno-record-gcc-switches" (https://packages.debian.org/search?searchon=contents&keywords=s390x-linux-gnu-gcc) |
Thanks for looking into it @tianon
The issue is the following when building on native s390x platform (rhel dist) with
Imo it should be Looks to be already reported 👀: golang/go#16443 (comment) |
Looks to work now with this hack:
But don't really like it 😅 |
golang/go#53383 (comment) is a more recent (and still open!) discussion of the same 👀 |
Ah yes indeed spot on! |
evaluating compatible platforms of target package with ones provided by each project. if PKG_SUPPORTED_PLATFORMS is empty, we assume we want to build all platforms supported by the project (static pkg) Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
So IIUC, the problem is that the Golang team uses cross-compiling, and because of that their cross-compile toolchain is baked into the code at compile time? |
@thaJeztah Yes |