From 0523088fedc3aa259b595c45dd86891a544c29ac Mon Sep 17 00:00:00 2001 From: Mahesh Arumugam Date: Wed, 19 May 2021 10:41:36 -0700 Subject: [PATCH 1/8] add darwin-arm64 support --- Makefile | 8 ++++++++ server/dup.go | 2 +- server/dup_arm64.go | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 101746299..3211dc301 100644 --- a/Makefile +++ b/Makefile @@ -13,8 +13,13 @@ BRANCH_ID := $(BRANCH)-$(GOOS)-$(GOARCH) BUILD_TIME := $(shell date -u +%FT%T%z) SHARD_WIDTH = 20 COMMIT := $(shell git describe --exact-match >/dev/null 2>&1 || git rev-parse --short HEAD) +<<<<<<< HEAD LDFLAGS="-X github.com/pilosa/pilosa/v2.Version=$(VERSION) -X github.com/pilosa/pilosa/v2.BuildTime=$(BUILD_TIME) -X github.com/pilosa/pilosa/v2.Variant=$(VARIANT) -X github.com/pilosa/pilosa/v2.Commit=$(COMMIT) -X github.com/pilosa/pilosa/v2.TrialDeadline=$(TRIAL_DEADLINE)" GO_VERSION=1.15.8 +======= +LDFLAGS="-X github.com/pilosa/pilosa/v2.Version=$(VERSION) -X github.com/pilosa/pilosa/v2.BuildTime=$(BUILD_TIME) -X github.com/pilosa/pilosa/v2.Variant=$(VARIANT) -X github.com/pilosa/pilosa/v2.Commit=$(COMMIT) -X github.com/pilosa/pilosa/v2.LatticeCommit=$(LATTICE_COMMIT) -X github.com/pilosa/pilosa/v2.TrialDeadline=$(TRIAL_DEADLINE)" +GO_VERSION=1.16 +>>>>>>> f47d7a1b (add darwin-arm64 support) DOCKER_BUILD= # set to 1 to use `docker-build` instead of `build` when creating a release BUILD_TAGS += shardwidth$(SHARD_WIDTH) TEST_TAGS = roaringparanoia @@ -114,12 +119,14 @@ endif # Create release build tarballs for all supported platforms. DEPRECATED: Use `docker-release` release: check-clean generate-statik-docker $(MAKE) release-build GOOS=darwin GOARCH=amd64 + $(MAKE) release-build GOOS=darwin GOARCH=arm64 $(MAKE) release-build GOOS=linux GOARCH=amd64 # Create release build tarballs for all supported platforms. Same as `release`, but without embedded Lattice UI. release-sans-ui: check-clean rm -f statik/statik.go $(MAKE) release-build GOOS=darwin GOARCH=amd64 + $(MAKE) release-build GOOS=darwin GOARCH=arm64 $(MAKE) release-build GOOS=linux GOARCH=amd64 # try (e.g.) internal/clustertests/docker-compose-replication2.yml @@ -187,6 +194,7 @@ generate: generate-protoc generate-statik generate-stringer generate-pql docker-release: $(MAKE) docker-build GOOS=linux GOARCH=amd64 $(MAKE) docker-build GOOS=darwin GOARCH=amd64 + $(MAKE) docker-build GOOS=darwin GOARCH=arm64 # Build a release in Docker docker-build: vendor diff --git a/server/dup.go b/server/dup.go index 63d871054..af2116329 100644 --- a/server/dup.go +++ b/server/dup.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build !arm64 +// +build darwin linux,amd64 package server diff --git a/server/dup_arm64.go b/server/dup_arm64.go index 726890fec..8e45eaa76 100644 --- a/server/dup_arm64.go +++ b/server/dup_arm64.go @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +// +build !darwin,arm64 + package server import ( From 25ddc2d3a00ff50d211916776d359b6f0761a300 Mon Sep 17 00:00:00 2001 From: Mahesh Arumugam Date: Wed, 19 May 2021 10:53:13 -0700 Subject: [PATCH 2/8] fixing the build tags --- Makefile | 5 ----- server/dup_arm64.go | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 3211dc301..eafad6b96 100644 --- a/Makefile +++ b/Makefile @@ -13,13 +13,8 @@ BRANCH_ID := $(BRANCH)-$(GOOS)-$(GOARCH) BUILD_TIME := $(shell date -u +%FT%T%z) SHARD_WIDTH = 20 COMMIT := $(shell git describe --exact-match >/dev/null 2>&1 || git rev-parse --short HEAD) -<<<<<<< HEAD LDFLAGS="-X github.com/pilosa/pilosa/v2.Version=$(VERSION) -X github.com/pilosa/pilosa/v2.BuildTime=$(BUILD_TIME) -X github.com/pilosa/pilosa/v2.Variant=$(VARIANT) -X github.com/pilosa/pilosa/v2.Commit=$(COMMIT) -X github.com/pilosa/pilosa/v2.TrialDeadline=$(TRIAL_DEADLINE)" -GO_VERSION=1.15.8 -======= -LDFLAGS="-X github.com/pilosa/pilosa/v2.Version=$(VERSION) -X github.com/pilosa/pilosa/v2.BuildTime=$(BUILD_TIME) -X github.com/pilosa/pilosa/v2.Variant=$(VARIANT) -X github.com/pilosa/pilosa/v2.Commit=$(COMMIT) -X github.com/pilosa/pilosa/v2.LatticeCommit=$(LATTICE_COMMIT) -X github.com/pilosa/pilosa/v2.TrialDeadline=$(TRIAL_DEADLINE)" GO_VERSION=1.16 ->>>>>>> f47d7a1b (add darwin-arm64 support) DOCKER_BUILD= # set to 1 to use `docker-build` instead of `build` when creating a release BUILD_TAGS += shardwidth$(SHARD_WIDTH) TEST_TAGS = roaringparanoia diff --git a/server/dup_arm64.go b/server/dup_arm64.go index 8e45eaa76..9cda77144 100644 --- a/server/dup_arm64.go +++ b/server/dup_arm64.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build !darwin,arm64 +// +build linux,arm64 package server From b6098f05e6e4f5ab726f6c21816eb7149e6d45c6 Mon Sep 17 00:00:00 2001 From: Mahesh Arumugam Date: Wed, 19 May 2021 11:15:12 -0700 Subject: [PATCH 3/8] fixing the build for linux,arm --- server/dup.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/dup.go b/server/dup.go index af2116329..747f26297 100644 --- a/server/dup.go +++ b/server/dup.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build darwin linux,amd64 +// +build darwin linux,!arm64 package server From ce2b07b65062fe3c1ac5bd7a681c22b2f7f0bd35 Mon Sep 17 00:00:00 2001 From: Mahesh Arumugam Date: Wed, 19 May 2021 13:27:42 -0700 Subject: [PATCH 4/8] move to go 1.16.4 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index eafad6b96..f38ffac3b 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ BUILD_TIME := $(shell date -u +%FT%T%z) SHARD_WIDTH = 20 COMMIT := $(shell git describe --exact-match >/dev/null 2>&1 || git rev-parse --short HEAD) LDFLAGS="-X github.com/pilosa/pilosa/v2.Version=$(VERSION) -X github.com/pilosa/pilosa/v2.BuildTime=$(BUILD_TIME) -X github.com/pilosa/pilosa/v2.Variant=$(VARIANT) -X github.com/pilosa/pilosa/v2.Commit=$(COMMIT) -X github.com/pilosa/pilosa/v2.TrialDeadline=$(TRIAL_DEADLINE)" -GO_VERSION=1.16 +GO_VERSION=1.16.4 DOCKER_BUILD= # set to 1 to use `docker-build` instead of `build` when creating a release BUILD_TAGS += shardwidth$(SHARD_WIDTH) TEST_TAGS = roaringparanoia From 277eba9895118da36961a453a9f3734e092f9ad9 Mon Sep 17 00:00:00 2001 From: Mahesh Arumugam Date: Wed, 19 May 2021 13:33:05 -0700 Subject: [PATCH 5/8] update comment --- server/dup.go | 3 ++- server/dup_arm64.go | 7 ++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/server/dup.go b/server/dup.go index 747f26297..55c918758 100644 --- a/server/dup.go +++ b/server/dup.go @@ -20,7 +20,8 @@ import ( "syscall" ) -// dup is an alias for syscall.Dup2 on most platforms or syscall.Dup3 on ARM64 +// dup is an alias for syscall.Dup2 on darwin-amd64, darwin-arm64, +// linux-amd64, linux-arm or syscall.Dup3 on linux-arm64 func (m *Command) dup(oldfd int, newfd int) error { return syscall.Dup2(oldfd, newfd) } diff --git a/server/dup_arm64.go b/server/dup_arm64.go index 9cda77144..f3ee31c02 100644 --- a/server/dup_arm64.go +++ b/server/dup_arm64.go @@ -16,11 +16,8 @@ package server -import ( - "syscall" -) - -// dup is an alias for syscall.Dup2 on most platforms or syscall.Dup3 on ARM +// dup is an alias for syscall.Dup2 on darwin-amd64, darwin-arm64, +// linux-amd64, linux-arm or syscall.Dup3 on linux-arm64 func (m *Command) dup(oldfd int, newfd int) error { return syscall.Dup3(oldfd, newfd, 0) } From 2679fa6cfdf718635f0bcb4242c488ab504185f7 Mon Sep 17 00:00:00 2001 From: Mahesh Arumugam Date: Wed, 19 May 2021 13:48:49 -0700 Subject: [PATCH 6/8] restore import syscall, accidentally removed in previous commit --- server/dup_arm64.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/dup_arm64.go b/server/dup_arm64.go index f3ee31c02..bdcc249f0 100644 --- a/server/dup_arm64.go +++ b/server/dup_arm64.go @@ -16,6 +16,10 @@ package server +import ( + "syscall" +) + // dup is an alias for syscall.Dup2 on darwin-amd64, darwin-arm64, // linux-amd64, linux-arm or syscall.Dup3 on linux-arm64 func (m *Command) dup(oldfd int, newfd int) error { From f57abbf7fcd46f2d0928d779bae8f47f19329abb Mon Sep 17 00:00:00 2001 From: Mahesh Arumugam Date: Fri, 21 May 2021 08:18:44 -0700 Subject: [PATCH 7/8] go version set to 1.16.3 in makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f38ffac3b..b35b39fee 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ BUILD_TIME := $(shell date -u +%FT%T%z) SHARD_WIDTH = 20 COMMIT := $(shell git describe --exact-match >/dev/null 2>&1 || git rev-parse --short HEAD) LDFLAGS="-X github.com/pilosa/pilosa/v2.Version=$(VERSION) -X github.com/pilosa/pilosa/v2.BuildTime=$(BUILD_TIME) -X github.com/pilosa/pilosa/v2.Variant=$(VARIANT) -X github.com/pilosa/pilosa/v2.Commit=$(COMMIT) -X github.com/pilosa/pilosa/v2.TrialDeadline=$(TRIAL_DEADLINE)" -GO_VERSION=1.16.4 +GO_VERSION=1.16.3 DOCKER_BUILD= # set to 1 to use `docker-build` instead of `build` when creating a release BUILD_TAGS += shardwidth$(SHARD_WIDTH) TEST_TAGS = roaringparanoia From 9dc750df976e37aefc50d27c414c2dc25b0c86e9 Mon Sep 17 00:00:00 2001 From: Mahesh Arumugam Date: Mon, 24 May 2021 12:18:56 -0700 Subject: [PATCH 8/8] add .idea to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 82a553aed..d53a2e53c 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ release-pilosa-fsck.*.*.tar.gz /tourna.log.* pilosa *.dot +.idea/