From c133c047e67fc9d0098a968c34fa4d47d5b9d562 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Tue, 29 Dec 2020 23:18:24 +0000 Subject: [PATCH] Move codecgen exe inside build_in_container It calls 'go', which may not be present outside the build container --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cfd42d1ab..5231a76cc 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,6 @@ GIT_REVISION=$(shell git rev-parse HEAD) WEAVENET_VERSION=2.1.3 RUNSVINIT=vendor/github.com/peterbourgon/runsvinit/runsvinit CODECGEN_DIR=vendor/github.com/ugorji/go/codec/codecgen -CODECGEN_EXE=$(CODECGEN_DIR)/bin/codecgen_$(shell go env GOHOSTOS)_$(shell go env GOHOSTARCH) CODECGEN_UID=0 GET_CODECGEN_DEPS=$(shell find $(1) -maxdepth 1 -type f -name '*.go' -not -name '*_test.go' -not -name '*.codecgen.go' -not -name '*.generated.go') CODECGEN_TARGETS=report/report.codecgen.go render/detailed/detailed.codecgen.go @@ -103,6 +102,8 @@ else $(SCOPE_EXE): time $(GO) build $(GO_BUILD_FLAGS) -o $@ ./$(@D) +CODECGEN_EXE=$(CODECGEN_DIR)/bin/codecgen_$(shell go env GOHOSTOS)_$(shell go env GOHOSTARCH) + %.codecgen.go: $(CODECGEN_EXE) rm -f $@; $(GO_HOST) build $(GO_BUILD_FLAGS) ./$(@D) # workaround for https://github.com/ugorji/go/issues/145 cd $(@D) && $(WITH_GO_HOST_ENV) GO111MODULE=off $(shell pwd)/$(CODECGEN_EXE) -d $(CODECGEN_UID) -rt $(GO_BUILD_TAGS) -u -o $(@F) $(notdir $(call GET_CODECGEN_DEPS,$(@D)))