From d41ebeaab32397da4c7f38476a2cb71bd92ef71c Mon Sep 17 00:00:00 2001 From: Torin Sandall Date: Thu, 3 Dec 2020 10:12:00 -0500 Subject: [PATCH] Makefile: Future proof the wasm runtime flag Signed-off-by: Torin Sandall --- Makefile | 14 +++++++------- build/check-vet.sh | 2 +- build/run-goimports.sh | 2 +- resolver/wasm/nop.go | 2 +- resolver/wasm/wasm.go | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index d0e4bef1d2..478b87cbf0 100644 --- a/Makefile +++ b/Makefile @@ -5,15 +5,15 @@ VERSION := $(shell ./build/get-build-version.sh) CGO_ENABLED ?= 1 -WASMER_ENABLED ?= 1 +WASM_ENABLED ?= 1 # Force modules on and to use the vendor directory. GO := CGO_ENABLED=$(CGO_ENABLED) GO111MODULE=on GOFLAGS=-mod=vendor go GO_TEST_TIMEOUT := -timeout 30m GO_TAGS := -tags= -ifeq ($(WASMER_ENABLED),1) -GO_TAGS = -tags=opa_wasmer +ifeq ($(WASM_ENABLED),1) +GO_TAGS = -tags=opa_wasm endif GOVERSION := $(shell cat ./.go-version) @@ -221,7 +221,7 @@ CI_GOLANG_DOCKER_MAKE := $(DOCKER) run \ -w /src \ -e GOCACHE=/src/.go/cache \ -e CGO_ENABLED=$(CGO_ENABLED) \ - -e WASMER_ENABLED=$(WASMER_ENABLED) \ + -e WASM_ENABLED=$(WASM_ENABLED) \ -e FUZZ_TIME=$(FUZZ_TIME) \ -e TELEMETRY_URL=$(TELEMETRY_URL) \ golang:$(GOVERSION) \ @@ -248,17 +248,17 @@ build-docker: ensure-release-dir .PHONY: build-linux build-linux: ensure-release-dir - @$(MAKE) build GOOS=linux CGO_ENABLED=0 WASMER_ENABLED=0 + @$(MAKE) build GOOS=linux CGO_ENABLED=0 WASM_ENABLED=0 mv opa_linux_$(GOARCH) $(RELEASE_DIR)/ .PHONY: build-darwin build-darwin: ensure-release-dir - @$(MAKE) build GOOS=darwin CGO_ENABLED=0 WASMER_ENABLED=0 + @$(MAKE) build GOOS=darwin CGO_ENABLED=0 WASM_ENABLED=0 mv opa_darwin_$(GOARCH) $(RELEASE_DIR)/ .PHONY: build-windows build-windows: ensure-release-dir - @$(MAKE) build GOOS=windows CGO_ENABLED=0 WASMER_ENABLED=0 + @$(MAKE) build GOOS=windows CGO_ENABLED=0 WASM_ENABLED=0 mv opa_windows_$(GOARCH) $(RELEASE_DIR)/opa_windows_$(GOARCH).exe .PHONY: ensure-release-dir diff --git a/build/check-vet.sh b/build/check-vet.sh index bf9a4e54c3..38eeddc58f 100755 --- a/build/check-vet.sh +++ b/build/check-vet.sh @@ -12,7 +12,7 @@ function opa::check_vet() { rc=0 exit_code=0 for pkg in $(opa::go_packages); do - go vet -tags=opa_wasmer $pkg || rc=$? + go vet -tags=opa_wasm $pkg || rc=$? if [[ $rc != 0 ]]; then exit_code=1 fi diff --git a/build/run-goimports.sh b/build/run-goimports.sh index c697b07391..e52c13fe49 100755 --- a/build/run-goimports.sh +++ b/build/run-goimports.sh @@ -1,3 +1,3 @@ #!/bin/sh -GOFLAGS=-mod=vendor GO111MODULE=on GOOS="" GOARCH="" go run -tags=wasmer ./vendor/golang.org/x/tools/cmd/goimports -local github.com/open-policy-agent/opa $@ +GOFLAGS=-mod=vendor GO111MODULE=on GOOS="" GOARCH="" go run -tags=opa_wasm ./vendor/golang.org/x/tools/cmd/goimports -local github.com/open-policy-agent/opa $@ diff --git a/resolver/wasm/nop.go b/resolver/wasm/nop.go index c9a09ed59f..8da686be4d 100644 --- a/resolver/wasm/nop.go +++ b/resolver/wasm/nop.go @@ -2,7 +2,7 @@ // Use of this source code is governed by an Apache2 // license that can be found in the LICENSE file. -// +build !opa_wasmer +// +build !opa_wasm package wasm diff --git a/resolver/wasm/wasm.go b/resolver/wasm/wasm.go index b9931ba02a..67a22ba183 100644 --- a/resolver/wasm/wasm.go +++ b/resolver/wasm/wasm.go @@ -2,7 +2,7 @@ // Use of this source code is governed by an Apache2 // license that can be found in the LICENSE file. -// +build opa_wasmer +// +build opa_wasm package wasm