-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Use go mod compat, drops support for reproducibility with go 1.16 #4810
Conversation
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Codecov Report
@@ Coverage Diff @@
## main #4810 +/- ##
=======================================
Coverage 90.76% 90.76%
=======================================
Files 180 180
Lines 10590 10590
=======================================
Hits 9612 9612
Misses 761 761
Partials 217 217 Continue to review full report at Codecov.
|
@@ -90,8 +90,7 @@ gofmt: | |||
.PHONY: gotidy | |||
gotidy: | |||
$(MAKE) for-all CMD="rm -fr go.sum" | |||
$(MAKE) for-all CMD="go mod tidy -go=1.16" | |||
$(MAKE) for-all CMD="go mod tidy -go=1.17" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the practical effects of having 1.16 and then 1.17 vs. just 1.17?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good luck with understanding that :) essentially go mod tidy
prints this helper:
To upgrade to the versions selected by go 1.16:
go mod tidy -go=1.16 && go mod tidy -go=1.17
If reproducibility with go 1.16 is not needed:
go mod tidy -compat=1.17
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it mean that projects depending on the otelcol as a library would have to use 1.17? I don't think that's what it means, but wanted to be sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't we already there by virtue of having a go 1.17
directive? I thought we were also using some 1.17 features/functions in places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the practical effects of having 1.16 and then 1.17 vs. just 1.17?
My understanding is that -go=1.16
will rewrite the mod/sum files as 1.16 would, with complete transitive dependency info and then -go=1.17
will rewrite from there to the condensed form with inlined indirect dependencies, but using the minimum version calculated from the previous 1.16 files. This ensures that the same versions are selected as would be by 1.16.
Using 1.17 directly does not calculate the versions that 1.16 would select and may result in different versions being selected, accounting for the differences that @codeboten mentioned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why this change seems to modify a bunch of the go.sum dependencies to drop the later versions 🤔
If I understand correctly, this is likely because the later versions were previously included as the minimum version satisfying a transitive dependency that is no longer included in the pruned transitive dependency graph, allowing a lower minimum version to be used. |
Signed-off-by: Bogdan Drutu bogdandrutu@gmail.com