Skip to content

Disable CGO for improved compatibility across distros#276

Merged
gpassini merged 1 commit intomasterfrom
disable_cgo
Oct 24, 2023
Merged

Disable CGO for improved compatibility across distros#276
gpassini merged 1 commit intomasterfrom
disable_cgo

Conversation

@gpassini
Copy link
Contributor

@gpassini gpassini commented Oct 24, 2023

This PR disables CGO so we don't have any dependencies on C libraries expected to be found in the environment, in order to achieve a better compatibility across distros.

Tested by running make install before and after the changes and inspecting the produced binary from a Linux machine (Debian in this case).
Before

ldd $(which grpcui)
	linux-vdso.so.1 (0x00007ffe2cb2e000)
	libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007fcc13946000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fcc13924000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fcc13750000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fcc1396a000)

After

ldd $(which grpcui)
	not a dynamic executable

Follow-up of the same changes in grpcurl: fullstorydev/grpcurl#420

@gpassini gpassini merged commit 73a517a into master Oct 24, 2023
@gpassini gpassini deleted the disable_cgo branch October 24, 2023 18:26
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