gha: add linux/arm/v5 to list of platforms#5388
gha: add linux/arm/v5 to list of platforms#5388thaJeztah wants to merge 4 commits intodocker:masterfrom
Conversation
|
Heh. Looks like alpine doesn't support v5 anymore? |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Dockerfile
Outdated
| # gcc is installed for libgcc only | ||
| RUN xx-apk add --no-cache musl-dev gcc | ||
| RUN xx-apk add --no-cache musl-dev libgcc |
There was a problem hiding this comment.
Interesting; this is causing failures on arm/v6 and arm/v7; it looks like we're explicitly disabling CGO (CGO_ENABLED=0), but then try to compile with -buildmode=pie - seems like something is off somewhere.
> [build-plugins 1/1] RUN --mount=ro --mount=type=cache,target=/root/.cache xx-go --wrap && TARGET=/out ./scripts/build/plugins e2e/cli-plugins/plugins/*:
0.127 Building static docker-helloworld
0.127 + CGO_ENABLED=0
0.127 + GO111MODULE=auto
0.127 + go build -o /out/plugins-linux-arm/docker-helloworld -tags ' osusergo' -ldflags ' -X "github.com/docker/cli/cli/version.GitCommit=5c123b1" -X "github.com/docker/cli/cli/version.BuildTime=2024-09-02T13:52:17Z" -X "github.com/docker/cli/cli/version.Version=pr-5387" -extldflags -static' -buildmode=pie github.com/docker/cli/cli-plugins/examples/helloworld
0.135 -buildmode=pie requires external (cgo) linking, but cgo is not enabled
The -buildmode=pie is probably set through GO_BUILDMODE ?
Lines 8 to 19 in b0c41b7
There was a problem hiding this comment.
Interestingly; doesn't fail on other PRs - wondering now what's causing that issue;
#18 [build-plugins 1/1] RUN --mount=ro --mount=type=cache,target=/root/.cache xx-go --wrap && TARGET=/out ./scripts/build/plugins e2e/cli-plugins/plugins/*
#18 0.126 Building static docker-helloworld
#18 0.126 + CGO_ENABLED=0
#18 0.126 + GO111MODULE=auto
#18 0.126 + go build -o /out/plugins-linux-arm/docker-helloworld -tags ' osusergo' -ldflags ' -X "github.com/docker/cli/cli/version.GitCommit=0cebca4" -X "github.com/docker/cli/cli/version.BuildTime=2024-09-02T14:50:36Z" -X "github.com/docker/cli/cli/version.Version=pr-5389" -extldflags -static' -buildmode=pie github.com/docker/cli/cli-plugins/examples/helloworld
#18 19.75 # github.com/docker/cli/cli-plugins/examples/helloworld
#18 19.75 loadinternal: cannot find runtime/cgo
#18 19.85 Building static docker-badmeta
#18 19.85 + CGO_ENABLED=0
#18 19.85 + GO111MODULE=auto
scripts/build/plugins
Outdated
|
|
||
| echo "Building $GO_LINKMODE $(basename "${TARGET_PLUGIN}")" | ||
| (set -x ; CGO_ENABLED=0 GO111MODULE=auto go build -o "${TARGET_PLUGIN}" -tags "${GO_BUILDTAGS}" -ldflags "${GO_LDFLAGS}" ${GO_BUILDMODE} "github.com/docker/cli/${p}") | ||
| (set -x ; CGO_ENABLED=0 GO111MODULE=auto go build -o "${TARGET_PLUGIN}" -tags "${GO_BUILDTAGS}" -ldflags "${GO_LDFLAGS}" "github.com/docker/cli/${p}") |
There was a problem hiding this comment.
Heh, so this fixed the plugins being compiled, but looks like the binary itself does still require gcc, not just libgcc ?
> [build 2/2] RUN --mount=type=bind,target=.,ro --mount=type=cache,target=/root/.cache --mount=type=tmpfs,target=cli/winresources xx-go --wrap && TARGET=/out ./scripts/build/binary && xx-verify $([ "static" = "static" ] && echo "--static") /out/docker:
0.113 + go build -o /out/docker-linux-arm-v6 -tags ' osusergo pkcs11' -ldflags ' -X "github.com/docker/cli/cli/version.GitCommit=7e15277994" -X "github.com/docker/cli/cli/version.BuildTime=2024-09-02T14:39:44Z" -X "github.com/docker/cli/cli/version.Version=pr-5388" -extldflags -static' '-buildmode=pie' github.com/docker/cli/cmd/docker
29.74 # github.com/docker/cli/cmd/docker
29.74 /usr/local/go/pkg/tool/linux_amd64/link: running armv6-alpine-linux-musleabihf-clang failed: exit status 1
29.74 clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
29.74 ld.lld: error: cannot open crtbeginT.o: No such file or directory
29.74 ld.lld: error: unable to find library -lgcc
29.74 ld.lld: error: unable to find library -lgcc_eh
29.74 ld.lld: error: cannot open crtend.o: No such file or directory
29.74 clang: error: linker command failed with exit code 1 (use -v to see invocation)
07d689f to
a829217
Compare
We include this in the moby/moby repo, but it looks like we didn't for the CLI. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The comment describes we need gcc for libgcc only, so we may as well install that. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The `.variables` sets `CGO_ENABLED=1` on arm; https://github.com/docker/cli/blob/b0c41b78d8c80c5f8faa736cf3c74dc31092e443/scripts/build/.variables#L57-L68 And if enabled, it sets `-buildmode=pie`; https://github.com/docker/cli/blob/b0c41b78d8c80c5f8faa736cf3c74dc31092e443/scripts/build/.variables#L79-L88 But that looks to be conflicting with the hard-coded `CGO_ENABLED=0` in this script. > [build-plugins 1/1] RUN --mount=ro --mount=type=cache,target=/root/.cache xx-go --wrap && TARGET=/out ./scripts/build/plugins e2e/cli-plugins/plugins/*: 0.127 Building static docker-helloworld 0.127 + CGO_ENABLED=0 0.127 + GO111MODULE=auto 0.127 + go build -o /out/plugins-linux-arm/docker-helloworld -tags ' osusergo' -ldflags ' -X "github.com/docker/cli/cli/version.GitCommit=5c123b1" -X "github.com/docker/cli/cli/version.BuildTime=2024-09-02T13:52:17Z" -X "github.com/docker/cli/cli/version.Version=pr-5387" -extldflags -static' -buildmode=pie github.com/docker/cli/cli-plugins/examples/helloworld 0.135 -buildmode=pie requires external (cgo) linking, but cgo is not enabled Remove `GO_BUILDMODE` from this script so that we don't try to build with `-buildmode=pie`. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This reverts commit df2a797. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
We include this in the moby/moby repo, but it looks like we didn't for the CLI.
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)