From b404517388bd4b036f693b96dd73d1b0a1aff642 Mon Sep 17 00:00:00 2001 From: Christian Kaps <307006+akkie@users.noreply.github.com> Date: Tue, 27 Apr 2021 08:08:52 +0200 Subject: [PATCH] Use `go mod tidy` before make (#799) * Use `go mod tidy` before make I have the issue with go 1.16 that I cannot build dapr because of a lot of errors with the message: ``` missing go.sum entry for module providing package ... ``` Maybe it's because of this issue: https://github.com/golang/go/issues/44129 Executing `go mod tidy` fixed it for me. * Update mod tidy check equal to the one used in dapr/dapr Co-authored-by: Yaron Schneider Co-authored-by: Phil Kedy Co-authored-by: Artur Souza --- .github/workflows/components-contrib.yml | 6 +++--- Makefile | 7 ++++--- docs/developing-component.md | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/components-contrib.yml b/.github/workflows/components-contrib.yml index b4265c4b6..453feadf0 100644 --- a/.github/workflows/components-contrib.yml +++ b/.github/workflows/components-contrib.yml @@ -54,9 +54,9 @@ jobs: uses: golangci/golangci-lint-action@v2.2.1 with: version: ${{ env.GOLANGCI_LINT_VER }} - - name: Run make go.mod check-diff - if: matrix.target_arch != 'arm' - run: make go.mod check-diff + - name: Run go mod tidy check diff + if: matrix.target_arch == 'amd64' && matrix.target_os == 'linux' + run: make modtidy check-diff - name: Run make test env: COVERAGE_OPTS: "-coverprofile=coverage.txt -covermode=atomic" diff --git a/Makefile b/Makefile index c9df1a202..c6c57309b 100644 --- a/Makefile +++ b/Makefile @@ -64,10 +64,10 @@ lint: $(GOLANGCI_LINT) run --timeout=20m ################################################################################ -# Target: go.mod # +# Target: modtidy # ################################################################################ -.PHONY: go.mod -go.mod: +.PHONY: modtidy +modtidy: go mod tidy ################################################################################ @@ -76,6 +76,7 @@ go.mod: .PHONY: check-diff check-diff: git diff --exit-code ./go.mod # check no changes + git diff --exit-code ./go.sum # check no changes ################################################################################ # Target: conf-tests # diff --git a/docs/developing-component.md b/docs/developing-component.md index 92279fc1a..eecc128cd 100644 --- a/docs/developing-component.md +++ b/docs/developing-component.md @@ -62,6 +62,7 @@ go mod edit -replace github.com/dapr/components-contrib=../components-contrib 4. Register your component in dapr [main.go](https://github.com/dapr/dapr/blob/d17e9243b308e830649b0bf3af5f6e84fd543baf/cmd/daprd/main.go#L153-L226)(e.g. binding) 5. Build debuggable dapr binary ```bash +go mod tidy make DEBUG=1 build ``` 6. Replace the installed daprd with the test binary (then dapr cli will use the test binary)