Merge pull request #1597 from ma-molecula/ma/darwin-arm64

CLOUD-69 add darwin-arm64 support
This commit is contained in:
Mahesh Arumugam 2021-05-24 12:56:20 -07:00 committed by GitHub
commit aed8727aea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 4 deletions

1
.gitignore vendored
View file

@ -10,3 +10,4 @@ release-pilosa-fsck.*.*.tar.gz
/tourna.log.*
pilosa
*.dot
.idea/

View file

@ -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.15.8
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
@ -114,12 +114,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 +189,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

View file

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// +build !arm64
// +build darwin linux,!arm64
package server
@ -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)
}

View file

@ -12,13 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// +build linux,arm64
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)
}