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

build: no longer use vendor directory #10898

Merged
merged 2 commits into from
Jul 14, 2021
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 3 additions & 0 deletions .changelog/10898.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
build: no longer use vendor directory
```
16 changes: 3 additions & 13 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,15 @@ check: ## Lint the source code
@if (git status -s | grep -q -e '\.hcl$$' -e '\.nomad$$'); then echo the following HCL files are out of sync; git status -s | grep -e '\.hcl$$' -e '\.nomad$$'; exit 1; fi

@echo "==> Check API package is isolated from rest"
@cd ./api && if go list --test -f '{{ join .Deps "\n" }}' . | grep github.com/hashicorp/nomad/ | grep -v -e /vendor/ -e /nomad/api/ -e nomad/api.test; then echo " /api package depends the ^^ above internal nomad packages. Remove such dependency"; exit 1; fi
@cd ./api && if go list --test -f '{{ join .Deps "\n" }}' . | grep github.com/hashicorp/nomad/ | grep -v -e /nomad/api/ -e nomad/api.test; then echo " /api package depends the ^^ above internal nomad packages. Remove such dependency"; exit 1; fi

@echo "==> Checking Go mod.."
@GO111MODULE=on $(MAKE) sync
@GO111MODULE=on $(MAKE) tidy
@if (git status --porcelain | grep -Eq "go\.(mod|sum)"); then \
echo go.mod or go.sum needs updating; \
git --no-pager diff go.mod; \
git --no-pager diff go.sum; \
exit 1; fi
@if (git status --porcelain | grep -Eq "vendor/github.com/hashicorp/nomad/.*\.go"); then \
echo "nomad go submodules are out of sync, try 'make sync':"; \
git status -s | grep -E "vendor/github.com/hashicorp/nomad/.*\.go"; \
exit 1; fi

@echo "==> Check raft util msg type mapping are in-sync..."
@go generate ./helper/raftutil/
Expand All @@ -187,7 +183,7 @@ checkproto: ## Lint protobuf files
generate-all: generate-structs proto generate-examples

.PHONY: generate-structs
generate-structs: LOCAL_PACKAGES = $(shell go list ./... | grep -v '/vendor/')
generate-structs: LOCAL_PACKAGES = $(shell go list ./...)
generate-structs: ## Update generated code
@echo "--> Running go generate..."
@go generate $(LOCAL_PACKAGES)
Expand All @@ -206,7 +202,6 @@ command/job_init.bindata_assetfs.go: command/assets/*
changelog:
@changelog-build -last-release $(LAST_RELEASE) -this-release HEAD \
-entries-dir .changelog/ -changelog-template ./.changelog/changelog.tmpl -note-template ./.changelog/note.tmpl


## We skip the terraform directory as there are templated hcl configurations
## that do not successfully compile without rendering
Expand All @@ -224,11 +219,6 @@ tidy:
@echo "--> Tidy nomad module"
@go mod tidy

.PHONY: sync
sync: tidy
@echo "--> Sync vendor directory"
@go mod vendor

.PHONY: dev
dev: GOOS=$(shell go env GOOS)
dev: GOARCH=$(shell go env GOARCH)
Expand Down
Loading