Skip to content

fix(glibc): Ensuring nrdiag uses pure Go#252

Merged
daffinito merged 4 commits into
mainfrom
daffi/glibc-again
Aug 13, 2025
Merged

fix(glibc): Ensuring nrdiag uses pure Go#252
daffinito merged 4 commits into
mainfrom
daffi/glibc-again

Conversation

@daffinito

@daffinito daffinito commented Aug 11, 2025

Copy link
Copy Markdown
Contributor

Issue

#248

When running the build script locally and testing, I do not receive any errors on any linux distros and the binary is statically linked

$ ldd nrdiag_x64
	not a dynamic executable

However the binaries that are being built by our release pipeline result in the following errors on Rocky Linux 8:

./nrdiag: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by ./nrdiag)
./nrdiag: /lib64/libc.so.6: version `GLIBC_2.32' not found (required by ./nrdiag)

which is caused by them being dynamically linked:

$ ldd nrdiag
./nrdiag: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by ./nrdiag)
./nrdiag: /lib64/libc.so.6: version `GLIBC_2.32' not found (required by ./nrdiag)
	linux-vdso.so.1 (0x00007ffd281ec000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f6869ace000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f6869ea4000)

Implementation Details

  • Moved the CGO_ENABLED=0 setting to the go build calls directly
  • Added netgo tag to ensure pure go is used for net library
  • Added check to lint.yml to fail PR if any package that uses cgo is used

How to Test

I was unable to reproduce the issue when building locally, even using tools like act to try and reproduce the github actions.

@nr-linbaker nr-linbaker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, TY!

@daffinito daffinito merged commit 61b810e into main Aug 13, 2025
18 checks passed
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