cli/scripts/build
Sebastiaan van Stijn ee60191870
scripts/build/binary: disable pkcs11 on static builds with CGO_ENABLED=1
pkcs11 cannot be compiled statically if CGO is enabled (and glibc is used)
see 3897c3fa54/vendor/github.com/miekg/pkcs11/pkcs11.go (L75)
see https://github.com/docker/cli/pull/3490#issuecomment-1079711973

When trying to do otherwise, warnings are printed (and shouldn't be ignored,
similar to the `osusergo` build-tag):

    #32 [linux/amd64->s390x build 2/2] RUN --mount=type=bind,target=.,ro     --mount=type=cache,target=/root/.cache     --mount=from=dockercore/golang-cross:xx-sdk-extras,target=/xx-sdk,src=/xx-sdk     --mount=type=tmpfs,target=cli/winresources     xx-go --wrap &&     TARGET=/out ./scripts/build/binary &&     xx-verify $([ "static" = "static" ] && echo "--static") /out/docker
    #32 467.0 # github.com/docker/cli/cmd/docker
    #32 467.0 /usr/bin/s390x-linux-gnu-ld: /tmp/go-link-900380651/000018.o: in function `New':
    #32 467.0 /go/src/github.com/docker/cli/vendor/github.com/miekg/pkcs11/pkcs11.go:75: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    #32 467.0 /usr/bin/s390x-linux-gnu-ld: /tmp/go-link-900380651/000004.o: in function `_cgo_26061493d47f_C2func_getaddrinfo':
    #32 467.0 /tmp/go-build/cgo-gcc-prolog:58: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-28 09:02:49 +02:00
..
.variables
binary scripts/build/binary: disable pkcs11 on static builds with CGO_ENABLED=1 2025-08-28 09:02:49 +02:00
mkversioninfo
plugins
shell-completion