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

remove unneeeded build info function in Identify #1378

Closed
wants to merge 2 commits into from

Conversation

marten-seemann
Copy link
Contributor

I'm now sure if this is actually the correct fix, but it makes our tests pass with Go 1.18.

debug.ReadBuildInfo didn't work in Go 1.17 (ok was always false). In Go 1.18 is now suddenly works, and is failing the TestIDService test.

debug.ReadBuildInfo didn't work in Go 1.17 (ok was always false). In Go
1.18 is now suddenly works, and is failing the TestIDService test.
Copy link
Contributor

@vyzo vyzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this changes the user agent, anyway around it?

@marten-seemann
Copy link
Contributor Author

I don't think it does, as the init was never actually executed because ReadBuildInfo returned false. But then I'm not sure why it was introduced in the first place. @Stebalien?

Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is meant for setting the user agent when included in a dependency of another go module (e.g., go-ipfs). For cases like that, I believe it actually works (I thought I tested it). I believe the correct fix is to check if bi.Main.Path is empty.

@Stebalien
Copy link
Member

(we should maybe document that...)

@marten-seemann
Copy link
Contributor Author

This is meant for setting the user agent when included in a dependency of another go module (e.g., go-ipfs). For cases like that, I believe it actually works (I thought I tested it).

That makes sense. And even better, we can now use the vcs infos that Go 1.18 makes accessible (see https://blog.carlmjohnson.net/post/2021/golang-118-minor-features/). I'll make another PR.

@marten-seemann
Copy link
Contributor Author

There we go: #1381

@marten-seemann marten-seemann deleted the remove-identify-build-info branch April 10, 2022 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants