Skip to content

fix(internal/version): Check status of build info to avoid panic if not there.#3538

Merged
darccio merged 2 commits into
DataDog:mainfrom
arguile-:buildinfo
May 21, 2025
Merged

fix(internal/version): Check status of build info to avoid panic if not there.#3538
darccio merged 2 commits into
DataDog:mainfrom
arguile-:buildinfo

Conversation

@arguile-

Copy link
Copy Markdown
Contributor

internal/version: check debug.ReadBuildInfo status to avoid panic

The status of the debug.ReadBuildInfo was previously silently ignored which caused a panic at runtime for binaries that don't support it. Build systems like Bazel do not add this information.

No tests were added as the FindV1Version is not currently tested and debug.ReadBuildInfo is not easy to fake. Changes out of scope of this fix would be need to support that.

@arguile-
arguile- requested review from a team as code owners May 21, 2025 15:39
@arguile- arguile- changed the title Check status of build info to avoid panic if not there. fix(internal/version): Check status of build info to avoid panic if not there. May 21, 2025
@darccio

darccio commented May 21, 2025

Copy link
Copy Markdown
Member

Thanks for the PR, @arguile-! In our tests in environments using Bazel this issue didn't raise. We agree that this fix is good for cases where debug info is not present.

Comment thread internal/version/version.go
Comment thread internal/version/version.go
@darccio
darccio merged commit d3a2c04 into DataDog:main May 21, 2025
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.

2 participants