-
-
Notifications
You must be signed in to change notification settings - Fork 682
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
Documentation to address errors like "/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found" #3167
Comments
I believe the issue here is that you don't have a statically linked binary. We already have documentation on how to do that here. What additional docs would you be interested in there being? |
Thanks for the link.
I suppose what I'm looking for is a guide to a reproducible build for code
that involves Go with or without C/C++ dependencies.
1) I can't tell if the host system changes the build output or not. e.g.,
is GLIBC being influenced by my machine?, is the host gcc or go toolchain
ever used?
2) Is there anything that can be put into WORKSPACE files to make
a build reproducible?
Just some information would be helpful for me, but I figure it will be more
useful for the community if that information makes it into the
documentation.
…On Wed, Jun 1, 2022 at 12:18 PM Andrew Z Allen ***@***.***> wrote:
I believe the issue here is that you don't have a statically linked
binary. We already have documentation on how to do that here
<https://github.com/bazelbuild/rules_go/blob/ba7bdfd6b5118d135ae3f7984c94103510bf4167/go/modes.rst#building-static-binaries>.
What additional docs would you be interested in there being?
—
Reply to this email directly, view it on GitHub
<#3167 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAUO53SZWPR7TM632HQMNTVM6ZSBANCNFSM5XQH4N5Q>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Why do you believe the builds are not reproducible? If you |
Please take a look at https://github.com/gonzojive/rules-go-cgo-glibc. On ubuntu 18.04, the output is
On 22.04:
|
I'm guessing there's a way to set it up so that a WORKSPACE-supplied gcc is used to make the build reproducible. It seems pretty complicated to accomplish that, however. |
If you use CGo, both vanilla Go and rules_go will pick up local libraries - without further setup, there simply isn't anything else to use to satisfy the libc requirement. If you want to be sure that you get a completely hermetic build with CGo, you have to:
|
Thanks so much - great information. Consider adding this answer to the official docs of rules_go (and probably rules_cc as well). |
I'm running into the error in the subject line when building locally and deploying in a docker container.
I can't tell if I need to do anything special to make rules_go build hermetically. Based on the output below, I'm guessing my host system's GLIBC is somehow affecting the binaries being compiled, but I'm not sure.
I thought rules_go and bazel mostly ignored the host system's installed libraries and toolchains. Maybe that is not the default behavior?
Relevant links:
GLIBC links:
What version of rules_go are you using?
v0.32.0
What version of gazelle are you using?
v0.25.0
What version of Bazel are you using?
7.1.1
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
Linux 22.04
Any other potentially useful information about your toolchain?
Local execution but running the cgo binary I'm building on Kubernetes using this
rules_docker
rule:What did you do?
I used
rules_k8s
to deploy a program to a cluster using a locally built docker image. I can provide more details later on. The project I'm working in is a lot like this one, except it uses cgo: https://github.com/gonzojive/beam-go-k8smy-image uses cgo
(I can provide more information if needed)
What did you expect to see?
Successful program execution.
What did you see instead?
Error when running the program in the cluster:
The text was updated successfully, but these errors were encountered: