From 768e4c4735bca9159d02286edee246df66780037 Mon Sep 17 00:00:00 2001 From: Ivan Andreev Date: Sun, 29 Nov 2020 19:52:10 +0300 Subject: [PATCH] build: Temporary fix for Windows build errors Applies a temporary fix similar to https://github.com/grafana/grafana/pull/28557 before go 1.15.6+ fixes https://github.com/golang/go/issues/40795 --- .github/workflows/build.yml | 3 +++ Makefile | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ed1b37b95..9e27a0e7a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,6 +46,7 @@ jobs: go: '1.15.x' gotags: cmount build_flags: '-include "^windows/amd64" -cgo' + build_args: '-buildmode exe' quicktest: true racequicktest: true deploy: true @@ -57,6 +58,7 @@ jobs: goarch: '386' cgo: '1' build_flags: '-include "^windows/386" -cgo' + build_args: '-buildmode exe' quicktest: true deploy: true @@ -109,6 +111,7 @@ jobs: run: | echo 'GOTAGS=${{ matrix.gotags }}' >> $GITHUB_ENV echo 'BUILD_FLAGS=${{ matrix.build_flags }}' >> $GITHUB_ENV + echo 'BUILD_ARGS=${{ matrix.build_args }}' >> $GITHUB_ENV if [[ "${{ matrix.goarch }}" != "" ]]; then echo 'GOARCH=${{ matrix.goarch }}' >> $GITHUB_ENV ; fi if [[ "${{ matrix.cgo }}" != "" ]]; then echo 'CGO_ENABLED=${{ matrix.cgo }}' >> $GITHUB_ENV ; fi diff --git a/Makefile b/Makefile index ac1b65a76..823bdf8c9 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ endif .PHONY: rclone test_all vars version rclone: - go build -v --ldflags "-s -X github.com/rclone/rclone/fs.Version=$(TAG)" $(BUILDTAGS) + go build -v --ldflags "-s -X github.com/rclone/rclone/fs.Version=$(TAG)" $(BUILDTAGS) $(BUILD_ARGS) mkdir -p `go env GOPATH`/bin/ cp -av rclone`go env GOEXE` `go env GOPATH`/bin/rclone`go env GOEXE`.new mv -v `go env GOPATH`/bin/rclone`go env GOEXE`.new `go env GOPATH`/bin/rclone`go env GOEXE`