diff --git a/dev-tools/mage/gomod.go b/dev-tools/mage/gomod.go index 9d785b47971..ae136665b1b 100644 --- a/dev-tools/mage/gomod.go +++ b/dev-tools/mage/gomod.go @@ -46,6 +46,9 @@ var ( }, }, } + filesToRemove = []string{ + filepath.Join("vendor", "github.com", "yuin", "gopher-lua", "parse", "Makefile"), + } ) // Vendor cleans up go.mod and copies the files not carried over from modules cache. @@ -75,7 +78,7 @@ func Vendor() error { // copy packages which require the whole tree for _, p := range copyAll { - path, err := gotool.ListModuleVendorDir(p.name) + path, err := gotool.ListModuleCacheDir(p.name) if err != nil { return err } @@ -90,5 +93,13 @@ func Vendor() error { } } } + + for _, p := range filesToRemove { + p = filepath.Join(repo.RootDir, p) + err = os.RemoveAll(p) + if err != nil { + return err + } + } return nil } diff --git a/libbeat/scripts/Makefile b/libbeat/scripts/Makefile index 9785754b0df..7f279bf531a 100755 --- a/libbeat/scripts/Makefile +++ b/libbeat/scripts/Makefile @@ -129,20 +129,14 @@ include $(ES_BEATS)/dev-tools/make/mage.mk .DEFAULT_GOAL := ${BEAT_NAME} -${BEAT_NAME}: $(GOFILES_ALL) update-yacc-vendor ## @build build the beat application +${BEAT_NAME}: $(GOFILES_ALL) ## @build build the beat application go build $(GOBUILD_FLAGS) # Create test coverage binary -${BEAT_NAME}.test: $(GOFILES_ALL) update-yacc-vendor +${BEAT_NAME}.test: $(GOFILES_ALL) @go build -o /dev/null @go test $(RACE) -c -coverpkg ${GOPACKAGES_COMMA_SEP} -# Avoid running yacc to generate a parser for dependency. -.PHONY: update-yacc-vendor -update-yacc-vendor: - touch -c ../vendor/github.com/yuin/gopher-lua/parse/parser.go.y - touch -c ../vendor/github.com/yuin/gopher-lua/parse/parser.go - .PHONY: crosscompile crosscompile: ## @build Cross-compile beat for the OS'es specified in GOX_OS variable. The binaries are placed in the build/bin directory. crosscompile: $(GOFILES) @@ -195,7 +189,7 @@ ci: ## @build Shortcut for continuous integration. This should always run befor # Preparation for tests .PHONY: prepare-tests -prepare-tests: update-yacc-vendor +prepare-tests: mkdir -p ${COVERAGE_DIR} # gotestcover is needed to fetch coverage for multiple packages go ${INSTALL_CMD} ${COVERAGE_TOOL_REPO} diff --git a/vendor/github.com/yuin/gopher-lua/parse/Makefile b/vendor/github.com/yuin/gopher-lua/parse/Makefile deleted file mode 100644 index b5b69096086..00000000000 --- a/vendor/github.com/yuin/gopher-lua/parse/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -all : parser.go - -parser.go : parser.go.y - go tool yacc -o $@ parser.go.y; [ -f y.output ] && ( rm -f y.output )