fullstorydev / grpcurl

Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers
MIT License
10.36k stars 497 forks source link

Disable CGO for improved compatibility across distros #420

Closed gpassini closed 8 months ago

gpassini commented 8 months ago

This PR disables CGO so we recover the same behaviour we had in v1.8.7, where we don't have any dependencies on C libraries expected to be found in the environment, and was raised in https://github.com/fullstorydev/grpcurl/issues/404#issuecomment-1762593336.

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 grpcurl)
    linux-vdso.so.1 (0x00007ffe121e7000)
    libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f2346e02000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2346de0000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2346c0c000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f2346e26000)

After

ldd $(which grpcurl)
    not a dynamic executable
dragonsinth commented 8 months ago

420 🔥