From a19cf063b56c36917a6548f6123170f9ea7e6ebf Mon Sep 17 00:00:00 2001 From: Joe Stevens Date: Tue, 4 Jun 2019 00:59:40 -0700 Subject: [PATCH] Fixes for multiplatform dev and testing from forks (#7734) Add support for correct dependency URLs on all platforms only build mountinfo.go on linux make testfile path relative to support fork work --- Makefile | 7 +++++-- pkg/mountinfo/mountinfo.go | 2 ++ pkg/s3select/select_test.go | 4 +--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 54603baf7..65edfe3fa 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,9 @@ PWD := $(shell pwd) GOPATH := $(shell go env GOPATH) LDFLAGS := $(shell go run buildscripts/gen-ldflags.go) +GOOS := $(shell go env GOOS) +GOOSALT := $(shell if [ ${GOOS} == 'darwin' ]; then echo 'mac'; else echo ${GOOS}; fi;) + TAG ?= $(USER) BUILD_LDFLAGS := '$(LDFLAGS)' @@ -14,8 +17,8 @@ checks: getdeps: @mkdir -p ${GOPATH}/bin @which golint 1>/dev/null || (echo "Installing golint" && go get -u golang.org/x/lint/golint) - @which staticcheck 1>/dev/null || (echo "Installing staticcheck" && wget --quiet -O ${GOPATH}/bin/staticcheck https://github.com/dominikh/go-tools/releases/download/2019.1/staticcheck_linux_amd64 && chmod +x ${GOPATH}/bin/staticcheck) - @which misspell 1>/dev/null || (echo "Installing misspell" && wget --quiet https://github.com/client9/misspell/releases/download/v0.3.4/misspell_0.3.4_linux_64bit.tar.gz && tar xf misspell_0.3.4_linux_64bit.tar.gz && mv misspell ${GOPATH}/bin/misspell && chmod +x ${GOPATH}/bin/misspell && rm -f misspell_0.3.4_linux_64bit.tar.gz) + @which staticcheck 1>/dev/null || (echo "Installing staticcheck" && wget --quiet -O ${GOPATH}/bin/staticcheck https://github.com/dominikh/go-tools/releases/download/2019.1/staticcheck_${GOOS}_amd64 && chmod +x ${GOPATH}/bin/staticcheck) + @which misspell 1>/dev/null || (echo "Installing misspell" && wget --quiet https://github.com/client9/misspell/releases/download/v0.3.4/misspell_0.3.4_${GOOSALT}_64bit.tar.gz && tar xf misspell_0.3.4_${GOOSALT}_64bit.tar.gz && mv misspell ${GOPATH}/bin/misspell && chmod +x ${GOPATH}/bin/misspell && rm -f misspell_0.3.4_${GOOSALT}_64bit.tar.gz) crosscompile: @(env bash $(PWD)/buildscripts/cross-compile.sh) diff --git a/pkg/mountinfo/mountinfo.go b/pkg/mountinfo/mountinfo.go index ff45c416a..1156a3d2c 100644 --- a/pkg/mountinfo/mountinfo.go +++ b/pkg/mountinfo/mountinfo.go @@ -1,3 +1,5 @@ +// +build linux + /* * MinIO Cloud Storage, (C) 2017 MinIO, Inc. * diff --git a/pkg/s3select/select_test.go b/pkg/s3select/select_test.go index 61a27ace9..11148b0e9 100644 --- a/pkg/s3select/select_test.go +++ b/pkg/s3select/select_test.go @@ -18,12 +18,10 @@ package s3select import ( "bytes" - "go/build" "io" "io/ioutil" "net/http" "os" - "path" "reflect" "testing" ) @@ -174,7 +172,7 @@ func TestParquetInput(t *testing.T) { `) getReader := func(offset int64, length int64) (io.ReadCloser, error) { - testdataFile := path.Join(build.Default.GOPATH, "src/github.com/minio/minio/pkg/s3select/testdata.parquet") + testdataFile := "testdata.parquet" file, err := os.Open(testdataFile) if err != nil { return nil, err