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

Dependents are required to set toolchain directive in go.mod #6216

Closed
bobrik opened this issue Jan 26, 2025 · 3 comments
Closed

Dependents are required to set toolchain directive in go.mod #6216

bobrik opened this issue Jan 26, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@bobrik
Copy link

bobrik commented Jan 26, 2025

A similar issue was reported in #5660, when toolchain was present directly. It was addressed in #5784 and a check was added in #5983.

Unfortunately, since then #5920 changed some go directives from go 1.22 to go 1.22.0, which has a similar effect of forcing consumers to add a toolchain directive, see: grpc-ecosystem/grpc-gateway#5094. See cloudflare/ebpf_exporter#520 for an example of what happens downstream.

From the looks of it open-telemetry/opentelemetry-go and open-telemetry/opentelemetry-go-instrumentation depend on each other and one can no longer simply truncate go directives, as go mod tidy would add toolchain back due to dependencies using go 1.22.0.

I'm not sure how to fix this.

@bobrik bobrik added the bug Something isn't working label Jan 26, 2025
@pellared
Copy link
Member

pellared commented Jan 26, 2025

Please try simply removing the toolchain directive after running go mid tidy.

You can also look at:

I also want to say that it looks like the Go team is going to recommend using the patch version in the go directive:

@bobrik
Copy link
Author

bobrik commented Jan 26, 2025

Please try simply removing the toolchain directive after running go mid tidy.

The next run of go mod tidy or dependabot will just add it back.

I also want to say that it looks like the Go team is going to recommend using the patch version in the go directive:

That's disappointing. I'm not sure if there's anything that can be done here other than requiring the oldest toolchain possible.

@bobrik
Copy link
Author

bobrik commented Jan 26, 2025

Please try simply removing the toolchain directive after running go mid tidy.

go 1.22 forces toolchain, while go 1.22.0 doesn't. I'll do that.

@bobrik bobrik closed this as completed Jan 26, 2025
@pellared pellared closed this as not planned Won't fix, can't repro, duplicate, stale Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants