-
Notifications
You must be signed in to change notification settings - Fork 658
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
Build error with golang:1.20-alpine3.17 platform=linux/arm64 using confluent-kafka-go v2.1.0 #981
Comments
this needs a bit more attention. wasted too much time on this. 🥲 |
Just try making the following changes
|
This approach doesn't work with librdkafka-dev v2.3.0, but was working with v2.2.0 |
The root cause appears to be that All the workarounds above seem to avoid solving this problem by instead installing a system To fix what I understand to be the root cause, we can:
I adapted the repro case from the original report for go1.21 + alpine3.18 with the requisite flags:
This works on my arm64/M1 Mac for |
As far as fixing the root cause bug; I'm not sure why there's now a hard link dependency on libsasl2.so. But I see that the Darwin cgo LDFLAGS have |
Kim, this is very helpful! Thanks for the research. |
It turns out the docs at https://github.com/confluentinc/librdkafka/wiki/Using-SASL-with-librdkafka#4-install-sasl-modules-on-client-host say:
So I think what happened is that @emasab who built librdkafka for 2.3.0 happens to have Cyrus SASL/libsasl2 installed in their environment, and thereby confluent-kafka-go got an indirect dependency on the Cyrus SASL distribution. I don't know anything about SASL, but it looks like librdkafka has minimal built-in support, so presumably earlier releases happened to build without the Cyrus dependency and only got the base support. |
Followup: we actually ran into a problem with the proposed workaround -- There's a supremely hacky way to work around this too, using a dangling
GCC complains with
but essentially fixes the unclosed group for you. |
And as a final workaround tip: you can use a more modern linker which doesn't have the input order requirements: lld or mold. Here's a Dockerfile to use
This gets rid of the warning from gcc/ld about the unclosed group. |
@kimgr appreaciate the detailed workarounds. Unfortunately, the last one does not work for me. It fails with the following error:
I have (An extra piece of information: I use xx to cross-compile which may be an issue here) #151 might also be related Based on your earlier comment, however, this might be an issue with the bundled libs, so I'm thinking about building them myself, making sure cyrus-sasl-dev is not present. If that is the problem, then I believe there should be a patch release fixing the libraries. |
You mentioned xx. I'm not familiar with it, but I'm assuming you've installed cyrus-sasl-dev using xx-apk in the build context? I wonder if a cross linker needs to be used too, or if you can somehow tell mold where to look for libraries for the target architecture. Sorry, I don't have any clue, really. |
Thank you all for raising awareness on this issue.
That didn't happen because we configure and build these static binaries in a Semaphore pipeline, not on our laptops. Then we import those binaries locally to push them to I believe the issue is here in the release pipeline: As it should be if attr in a.info and \
a.info[attr] == m.attributes[origattr]: because it's excluding the files the files that have the attribute That explains why the issue is present in 2.1.0 and 2.3.0 but not in 2.2.0 and 2.0.2. |
There's room for security improvements here. We have to make this step run on CI too. |
|
Confirmed that the only affected ones are these ones, by looking for
|
Raised this PR. And confirmed that the produced binaries don't include |
Closing this as it's fixed in 2.4.0 |
Description
ARM64 build using golang:1.20-alpine3.17 fails. AMD64 using confluent-kafka-go v2.1.0 build succeeds.
ARM64 and AMD64 with v2.0.2 are also successful.
How to reproduce
Checklist
Please provide the following information:
LibraryVersion()
):confluent-kafka-go v2.1.0
The text was updated successfully, but these errors were encountered: