diff --git a/.bingo/Variables.mk b/.bingo/Variables.mk index 94c5d9bced2..f442f5340bc 100644 --- a/.bingo/Variables.mk +++ b/.bingo/Variables.mk @@ -47,12 +47,6 @@ $(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod @echo "(re)installing $(GOBIN)/golangci-lint-v1.43.0" @cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.43.0 "github.com/golangci/golangci-lint/cmd/golangci-lint" -GOX := $(GOBIN)/gox-v1.0.1 -$(GOX): $(BINGO_DIR)/gox.mod - @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. - @echo "(re)installing $(GOBIN)/gox-v1.0.1" - @cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=gox.mod -o=$(GOBIN)/gox-v1.0.1 "github.com/mitchellh/gox" - HUGO := $(GOBIN)/hugo-v0.91.0 $(HUGO): $(BINGO_DIR)/hugo.mod @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. @@ -106,4 +100,3 @@ $(REFLEX): $(BINGO_DIR)/reflex.mod @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. @echo "(re)installing $(GOBIN)/reflex-v0.3.1" @cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=reflex.mod -o=$(GOBIN)/reflex-v0.3.1 "github.com/cespare/reflex" - diff --git a/.bingo/gox.mod b/.bingo/gox.mod deleted file mode 100644 index c48c4a9fa34..00000000000 --- a/.bingo/gox.mod +++ /dev/null @@ -1,5 +0,0 @@ -module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT - -go 1.17 - -require github.com/mitchellh/gox v1.0.1 diff --git a/.bingo/gox.sum b/.bingo/gox.sum deleted file mode 100644 index 0b5dfc49612..00000000000 --- a/.bingo/gox.sum +++ /dev/null @@ -1,6 +0,0 @@ -github.com/hashicorp/go-version v1.0.0 h1:21MVWPKDphxa7ineQQTrCU5brh7OuVVAzGOCnnCPtE8= -github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/mitchellh/gox v1.0.1 h1:x0jD3dcHk9a9xPSDN6YEL4xL6Qz0dvNYm8yZqui5chI= -github.com/mitchellh/gox v1.0.1/go.mod h1:ED6BioOGXMswlXa2zxfh/xdd5QhwYliBFn9V18Ap4z4= -github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= diff --git a/.bingo/variables.env b/.bingo/variables.env index b54bcc82b4b..1deb407f41e 100644 --- a/.bingo/variables.env +++ b/.bingo/variables.env @@ -18,8 +18,6 @@ CALENS="${GOBIN}/calens-v0.2.0" GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.43.0" -GOX="${GOBIN}/gox-v1.0.1" - HUGO="${GOBIN}/hugo-v0.91.0" MOCKERY="${GOBIN}/mockery-v2.9.4" @@ -37,4 +35,3 @@ PROTOC_GEN_MICROWEB="${GOBIN}/protoc-gen-microweb-v0.0.0-20211219183901-997c02ca PROTOC_GEN_OPENAPIV2="${GOBIN}/protoc-gen-openapiv2-v2.7.2" REFLEX="${GOBIN}/reflex-v0.3.1" - diff --git a/.make/release.mk b/.make/release.mk index 6f99abec746..4c655230593 100644 --- a/.make/release.mk +++ b/.make/release.mk @@ -11,26 +11,118 @@ release-dirs: # docker specific packaging flags DOCKER_LDFLAGS += -X "$(OCIS_REPO)/ocis-pkg/config/defaults.BaseDataPathType=path" -X "$(OCIS_REPO)/ocis-pkg/config/defaults.BaseDataPathValue=/var/lib/ocis" -release-linux-docker-amd64: $(GOX) release-dirs - @$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS) $(DOCKER_LDFLAGS)' -os 'linux' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME) -release-linux-docker-arm: $(GOX) release-dirs - @$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS) $(DOCKER_LDFLAGS)' -os 'linux' -arch 'arm' -output '$(DIST)/binaries/$(EXECUTABLE)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME) +release-linux-docker-amd64: release-dirs + GOOS=linux \ + GOARCH=amd64 \ + go build \ + -tags 'netgo $(TAGS)' \ + -buildmode=pie \ + -trimpath \ + -ldflags '-extldflags "-static" $(LDFLAGS) $(DOCKER_LDFLAGS)' \ + -o '$(DIST)/binaries/$(EXECUTABLE)-linux-amd64' \ + ./cmd/$(NAME) -release-linux-docker-arm64: $(GOX) release-dirs - @$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS) $(DOCKER_LDFLAGS)' -os 'linux' -arch 'arm64' -output '$(DIST)/binaries/$(EXECUTABLE)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME) +release-linux-docker-arm: release-dirs + GOOS=linux \ + GOARCH=arm \ + go build \ + -tags 'netgo $(TAGS)' \ + -trimpath \ + -ldflags '-extldflags "-static" $(LDFLAGS) $(DOCKER_LDFLAGS)' \ + -o '$(DIST)/binaries/$(EXECUTABLE)-linux-arm' \ + ./cmd/$(NAME) + + @# https://github.com/golang/go/issues/50405 + @# -buildmode=pie not easily doable for arm + +release-linux-docker-arm64: release-dirs + GOOS=linux \ + GOARCH=arm64 \ + go build \ + -tags 'netgo $(TAGS)' \ + -buildmode=pie \ + -trimpath \ + -ldflags '-extldflags "-static" $(LDFLAGS) $(DOCKER_LDFLAGS)' \ + -o '$(DIST)/binaries/$(EXECUTABLE)-linux-arm64' \ + ./cmd/$(NAME) .PHONY: release-linux -release-linux: $(GOX) release-dirs - @$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'linux' -arch 'amd64 386 arm64 arm' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME) +release-linux: release-dirs + GOOS=linux \ + GOARCH=amd64 \ + go build \ + -tags 'netgo $(TAGS)' \ + -buildmode=pie \ + -trimpath \ + -ldflags '-extldflags "-static" $(LDFLAGS)' \ + -o '$(DIST)/binaries/$(EXECUTABLE)-linux-amd64' \ + ./cmd/$(NAME) + + GOOS=linux \ + GOARCH=386 \ + go build \ + -tags 'netgo $(TAGS)' \ + -trimpath \ + -ldflags '-extldflags "-static" $(LDFLAGS)' \ + -o '$(DIST)/binaries/$(EXECUTABLE)-linux-386' \ + ./cmd/$(NAME) + + GOOS=linux \ + GOARCH=arm64 \ + go build \ + -tags 'netgo $(TAGS)' \ + -buildmode=pie \ + -trimpath \ + -ldflags '-extldflags "-static" $(LDFLAGS)' \ + -o '$(DIST)/binaries/$(EXECUTABLE)-linux-arm64' \ + ./cmd/$(NAME) + + GOOS=linux \ + GOARCH=arm \ + go build \ + -tags 'netgo $(TAGS)' \ + -trimpath \ + -ldflags '-extldflags "-static" $(LDFLAGS)' \ + -o '$(DIST)/binaries/$(EXECUTABLE)-linux-arm' \ + ./cmd/$(NAME) + + @# https://github.com/golang/go/issues/50405 + @# -buildmode=pie not easily doable for arm .PHONY: release-windows -release-windows: $(GOX) release-dirs - @$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'windows' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME) +release-windows: release-dirs + GOOS=windows \ + GOARCH=amd64 \ + go build \ + -tags 'netgo $(TAGS)' \ + -buildmode=pie \ + -trimpath \ + -ldflags '-extldflags "-static" $(LDFLAGS)' \ + -o '$(DIST)/binaries/$(EXECUTABLE)-windows-amd64' \ + ./cmd/$(NAME) .PHONY: release-darwin -release-darwin: $(GOX) release-dirs - @$(GOX) -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -os 'darwin' -arch 'amd64 arm64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME) +release-darwin: release-dirs + GOOS=darwin \ + GOARCH=amd64 \ + go build \ + -tags 'netgo $(TAGS)' \ + -buildmode=pie \ + -trimpath \ + -ldflags '$(LDFLAGS)' \ + -o '$(DIST)/binaries/$(EXECUTABLE)-darwin-amd64' \ + ./cmd/$(NAME) + + GOOS=darwin \ + GOARCH=arm64 \ + go build \ + -tags 'netgo $(TAGS)' \ + -buildmode=pie \ + -trimpath \ + -ldflags '$(LDFLAGS)' \ + -o '$(DIST)/binaries/$(EXECUTABLE)-darwin-arm64' \ + ./cmd/$(NAME) .PHONY: release-copy release-copy: