Move codecgen exe inside build_in_container

It calls 'go', which may not be present outside the build container
This commit is contained in:
Bryan Boreham
2020-12-29 23:18:24 +00:00
parent 9ab9692699
commit c133c047e6

View File

@@ -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)))