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

Use go mod compat, drops support for reproducibility with go 1.16 #4810

Merged
merged 1 commit into from
Feb 7, 2022

Conversation

bogdandrutu
Copy link
Member

Signed-off-by: Bogdan Drutu bogdandrutu@gmail.com

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
@bogdandrutu bogdandrutu requested review from a team and Aneurysm9 February 5, 2022 02:01
@bogdandrutu bogdandrutu added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Feb 5, 2022
@codecov
Copy link

codecov bot commented Feb 5, 2022

Codecov Report

Merging #4810 (c3755d5) into main (7dcc512) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7dcc512...c3755d5. Read the comment docs.

@@ -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"
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor

@codeboten codeboten left a 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 🤔

@Aneurysm9
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants