Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Makefile which ruins builds from vendor #17013

Merged
merged 2 commits into from
Mar 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion dev-tools/mage/gomod.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ var (
},
},
}
filesToRemove = []string{
filepath.Join("vendor", "github.com", "yuin", "gopher-lua", "parse", "Makefile"),
jsoriano marked this conversation as resolved.
Show resolved Hide resolved
}
)

// Vendor cleans up go.mod and copies the files not carried over from modules cache.
Expand Down Expand Up @@ -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
}
Expand All @@ -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
}
12 changes: 3 additions & 9 deletions libbeat/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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}
Expand Down
4 changes: 0 additions & 4 deletions vendor/github.com/yuin/gopher-lua/parse/Makefile

This file was deleted.