Add tool dependencies to go.mod#230
Merged
andrewkroh merged 1 commit intoelastic:masterfrom Jan 21, 2021
Merged
Conversation
Member
Author
|
This is intended to fix the failing build of master. Like https://beats-ci.elastic.co/job/Ingest-manager/job/elastic-package/job/master/16/. |
Collaborator
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
|
Changes in tools and their dependencies can cause previously passing builds to start failing because of 'make check'. This adds the project's tool dependencies to go.mod so this no longer happens. An alternative would be invoke use `GO111MODULE=off go get` when fetching tool dependencies in the Makefile since this would not modify go.mod. The root of the problem is the Makefile calls `go get -u` which adds the tool dependency to go.mod AND updates any transitive dependencies of the tool. Then `go mod tidy` is executed which removes the entries from go.mod but leaves behind the go.sum updates to the transitive dependencies that the project uses. Since go.sum is modified `make check` fails. Reference: https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module
b29ff7f to
49a661c
Compare
mtojek
approved these changes
Jan 20, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes in tools and their dependencies can cause previously passing
builds to start failing because of 'make check'. This adds the project's tool
dependencies to go.mod so this no longer happens. An alternative would
be invoke use
GO111MODULE=off go getwhen fetching tool dependenciesin the Makefile since this would not modify go.mod.
The root of the problem is the Makefile calls
go get -uwhich adds the tooldependency to go.mod AND updates any transitive dependencies of the tool.
Then
go mod tidyis executed which removes the entries from go.mod butleaves behind the go.sum updates to the transitive dependencies that the
project uses. Since go.sum is modified
make checkfails.Reference: https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module