From 88e92754f12ad6d3518720e8c8d8489bb72de111 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 28 Jul 2021 13:22:56 +0200 Subject: [PATCH 1/3] plugins/buildx: enable go modules to fix invalid //import comment The buildkit vendor in buildx contains an incorrect `//import` comment, which causes compile to fail if go modules are disabled. Without `GO111MODULE` set (but with `-mod=vendor`: echo $GO111MODULE export PKG=github.com/docker/buildx export LDFLAGS="-X ${PKG}/version.Version=$(git describe --match 'v[0-9]*' --always --tags) -X ${PKG}/version.Revision=$(git rev-parse HEAD) -X ${PKG}/version.Package=${PKG}" GOFLAGS=-mod=vendor go build -o bin/docker-buildx -ldflags "${LDFLAGS}" ./cmd/buildx bin/docker-buildx version github.com/docker/buildx v0.6.0 d9ee3b134cbc2d09513fa7fee4176a3919e05887 When setting `GO111MODULE=off`, it fails on the incorrect import path in the vendored file (looks like GO111MODULE=on ignores import-path comments?): export GO111MODULE=off root@5a55ec1c1eed:/go/src/github.com/docker/buildx# GOFLAGS=-mod=vendor go build -o bin/docker-buildx -ldflags "${LDFLAGS}" ./cmd/buildx vendor/github.com/moby/buildkit/client/client.go:20:2: code in directory /go/src/github.com/docker/buildx/vendor/github.com/moby/buildkit/util/tracing/otlptracegrpc expects import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc" vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/connection/connection.go:33:2: found import comments "go.opentelemetry.io/otel/exporters/otlp/internal/otlpconfig" (options.go) and "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlpconfig" (optiontypes.go) in /go/src/github.com/docker/buildx/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlpconfig Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 5b9172b6b7c182efbb36c5d64ec5e7b85e7295ec) Signed-off-by: Sebastiaan van Stijn --- plugins/buildx.installer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/buildx.installer b/plugins/buildx.installer index 7585b9e3a5..e5736b0eb5 100755 --- a/plugins/buildx.installer +++ b/plugins/buildx.installer @@ -20,7 +20,7 @@ build() { local LDFLAGS LDFLAGS="-X ${PKG}/version.Version=$(git describe --match 'v[0-9]*' --always --tags)-docker -X ${PKG}/version.Revision=$(git rev-parse HEAD) -X ${PKG}/version.Package=${PKG}" set -x - GOFLAGS=-mod=vendor go build -o bin/docker-buildx -ldflags "${LDFLAGS}" ./cmd/buildx + GO111MODULE=on go build -mod=vendor -o bin/docker-buildx -ldflags "${LDFLAGS}" ./cmd/buildx ) } From 208a1f95a1ec98620e3974bffb653e20ee3afe88 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 20 Jul 2021 00:54:12 +0200 Subject: [PATCH 2/3] update buildx to v0.6.0 release notes: https://github.com/docker/buildx/releases/tag/v0.6.0 Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 7593a3f5fc1b4dc0b1dc4f4eef9840448418e2ec) Signed-off-by: Sebastiaan van Stijn --- plugins/buildx.installer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/buildx.installer b/plugins/buildx.installer index e5736b0eb5..0281565967 100755 --- a/plugins/buildx.installer +++ b/plugins/buildx.installer @@ -6,7 +6,7 @@ source "$(dirname "$0")/.common" PKG=github.com/docker/buildx GOPATH=$(go env GOPATH) REPO=https://${PKG}.git -: "${BUILDX_COMMIT=v0.5.1}" +: "${BUILDX_COMMIT=v0.6.0}" DEST=${GOPATH}/src/${PKG} build() { From 391f1fd05f2dba6b911e2329f4f5649316622a02 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 30 Jul 2021 20:13:28 +0200 Subject: [PATCH 3/3] update buildx to v0.6.1 release notes: https://github.com/docker/buildx/releases/tag/v0.6.1 Signed-off-by: CrazyMax (cherry picked from commit 2a17e901496d370370d0f42fd79eb162be85d678) Signed-off-by: Sebastiaan van Stijn --- plugins/buildx.installer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/buildx.installer b/plugins/buildx.installer index 0281565967..fb7455eaec 100755 --- a/plugins/buildx.installer +++ b/plugins/buildx.installer @@ -6,7 +6,7 @@ source "$(dirname "$0")/.common" PKG=github.com/docker/buildx GOPATH=$(go env GOPATH) REPO=https://${PKG}.git -: "${BUILDX_COMMIT=v0.6.0}" +: "${BUILDX_COMMIT=v0.6.1}" DEST=${GOPATH}/src/${PKG} build() {