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

v1.0.0 doesn't work on Ubuntu 18 #86

Open
zhanyong-wan opened this issue May 9, 2024 · 2 comments
Open

v1.0.0 doesn't work on Ubuntu 18 #86

zhanyong-wan opened this issue May 9, 2024 · 2 comments

Comments

@zhanyong-wan
Copy link

I'm upgrading Pinterest's thrift repo to thriftcheck 1.0.0. However the binary failed with

.../.thriftcheck_cache/thriftcheck-1.0.0: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /mnt/jenkins/workspace/github_schemas-test/.thriftcheck_cache/thriftcheck-1.0.0)
.../.thriftcheck_cache/thriftcheck-1.0.0: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /mnt/jenkins/workspace/github_schemas-test/.thriftcheck_cache/thriftcheck-1.0.0)

ldd --version shows that our Jenkins worker has

 ldd (Ubuntu GLIBC 2.27-3ubuntu1.6) 2.27

It would be great to statically link with GLIBC so that the generated binary doesn't depend on the GLIBC version on the user's machine.

@jparise
Copy link
Collaborator

jparise commented May 29, 2024

This might be related to CGO, which we could disable like this:

diff --git i/.goreleaser.yml w/.goreleaser.yml
index 86aa3d0..f13b53f 100644
--- i/.goreleaser.yml
+++ w/.goreleaser.yml
@@ -14,6 +14,8 @@ builds:
       - amd64
       - arm64
     main: ./cmd/
+    env:
+      - CGO_ENABLED=0
     ldflags:
       - "-s -w -X main.version={{ .Version }} -X main.revision={{ .ShortCommit }}"

I don't have an Ubuntu environment handy at the moment to try it myself, but we probably either need to do the above or find some other linker flag to adjust to request static GLIBC linking.

@jparise
Copy link
Collaborator

jparise commented Jun 10, 2024

I just built and released v1.0.1 with a more recent Go tool chain. That probably won't make a difference here, but it's worth checking if it helps move toward a resolution.

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

No branches or pull requests

2 participants