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

[BUG] compile error after dependency update to version 1.70.1 #3011

Closed
mibo-fdc opened this issue Dec 5, 2024 · 5 comments
Closed

[BUG] compile error after dependency update to version 1.70.1 #3011

mibo-fdc opened this issue Dec 5, 2024 · 5 comments
Labels
bug unintended behavior that has to be fixed

Comments

@mibo-fdc
Copy link

mibo-fdc commented Dec 5, 2024

Version of dd-trace-go
1.70.1

Describe what happened:
After dependency upgrades this compile error is raised from the package:
gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer

gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer

../../../../../go/pkg/mod/gopkg.in/!data!dog/[email protected]/ddtrace/tracer/tracer.go:339:34: cannot use t.statsd (variable of type "gopkg.in/DataDog/dd-trace-go.v1/internal".StatsdClient) as runtimemetrics.partialStatsdClientInterface value in argument to runtimemetrics.Start: "gopkg.in/DataDog/dd-trace-go.v1/internal".StatsdClient does not implement runtimemetrics.partialStatsdClientInterface (missing method DistributionSamples)

Describe what you expected:
No compiler error. It seems to be dependency-related, but the error is from the library itself. I see no combination of dependency updates that causes this.

Steps to reproduce the issue:
Dependency update with go get -u ./... and go mod tidy. After this, the error above occurred in the builds.

Additional environment details (Version of Go, Operating System, etc.):
Go 1.23.4, across operation systems (this error also occurs on CI/Linux and on macOS)

@mibo-fdc mibo-fdc added the bug unintended behavior that has to be fixed label Dec 5, 2024
@github-actions github-actions bot added the needs-triage New issues that have not yet been triaged label Dec 5, 2024
@darccio
Copy link
Member

darccio commented Dec 5, 2024

@mibo-fdc Thanks for reaching out. The root cause for this error is go get -u ./... upgrading to the latest commit in github.com/DataDog/go-runtime-metrics-internal that introduced a breaking change. It's happening also in our smoke tests since today.

A workaround for this is to run go get github.com/DataDog/go-runtime-metrics-internal@194426bbbd59 in the meantime.

@mibo-fdc
Copy link
Author

mibo-fdc commented Dec 5, 2024

Thanks for the fast response. I tried your workaround, but the error stays the same.

I know have
github.com/DataDog/go-runtime-metrics-internal v0.0.0-20241106155157-194426bbbd59 // indirect
in the go.mod as an indirect dependency. This should be enough to fix the issue?

@darccio
Copy link
Member

darccio commented Dec 5, 2024

@mibo-fdc It should be enough. See the screenshot below:

Image

Did you run again go get -u ./... after pinning the version? Another way to ensure the library is properly pinned is using a replace directive like this:

go mod edit -replace=github.com/DataDog/go-runtime-metrics-internal=github.com/DataDog/go-runtime-metrics-internal@194426bbbd59
go mod tidy

I did it locally and it also worked (after running again go get -u ./...):

Image

@darccio darccio removed the needs-triage New issues that have not yet been triaged label Dec 5, 2024
@mibo-fdc
Copy link
Author

mibo-fdc commented Dec 5, 2024

No, I did not update the version again after the go get.
However, with the version pinning, it works. Thanks for the help!

felixge added a commit that referenced this issue Dec 6, 2024
As suggested in
DataDog/go-runtime-metrics-internal#10
the go-runtime-metrics-internal has been tagged with explicit versions.

This should have already fixed #3011 as future `go get -u ./...`
invocations should resolve to v0.0.2.

Relevant quote from the go module reference at
https://go.dev/ref/mod#version-queries:

> The string latest, which selects the highest available release
> version. If there are no release versions, latest selects the highest
> pre-release version. If there are no tagged versions, latest selects a
> pseudo-version for the commit at the tip of the repository’s default
> branch.

Fixes #3011
felixge added a commit that referenced this issue Dec 6, 2024
As suggested in
DataDog/go-runtime-metrics-internal#10
the go-runtime-metrics-internal has been tagged with explicit versions.

This should have already fixed #3011 as future `go get -u ./...`
invocations should resolve to v0.0.3 (same as v0.0.1).

Relevant quote from the go module reference at
https://go.dev/ref/mod#version-queries:

> The string latest, which selects the highest available release
> version. If there are no release versions, latest selects the highest
> pre-release version. If there are no tagged versions, latest selects a
> pseudo-version for the commit at the tip of the repository’s default
> branch.

Fixes #3011
felixge added a commit that referenced this issue Dec 6, 2024
As suggested in
DataDog/go-runtime-metrics-internal#10
the go-runtime-metrics-internal has been tagged with explicit versions.

This should have already fixed #3011 as future `go get -u ./...`
invocations should resolve to v0.0.3 (same as v0.0.1). See the issue
above for more details.

Fixes #3011
@felixge
Copy link
Member

felixge commented Dec 6, 2024

This should be fixed now. See this comment for more details and how we're planning to prevent this kind of issue from appearing again in the future. Sorry for the trouble this caused 🙇

@felixge felixge closed this as completed Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unintended behavior that has to be fixed
Projects
None yet
Development

No branches or pull requests

3 participants