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

FFI Library Can't Be Loaded on Ubuntu 18.04 LTS #202

Closed
adamrodger opened this issue Jun 19, 2022 · 14 comments
Closed

FFI Library Can't Be Loaded on Ubuntu 18.04 LTS #202

adamrodger opened this issue Jun 19, 2022 · 14 comments

Comments

@adamrodger
Copy link
Contributor

The libpact_ffi.so file requires GLIBC 2.28 and 2.29 by the looks of things, which is missing on Ubuntu 18.04 containers. See pact-foundation/pact-net#402 for further details.

From inside an Ubuntu 18.04 container:

# ldd bin/Debug/net6.0/runtimes/linux-x64/native/libpact_ffi.so

bin/Debug/net6.0/runtimes/linux-x64/native/libpact_ffi.so: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.29' not found (required by bin/Debug/net6.0/runtimes/linux-x64/native/libpact_ffi.so)
bin/Debug/net6.0/runtimes/linux-x64/native/libpact_ffi.so: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by bin/Debug/net6.0/runtimes/linux-x64/native/libpact_ffi.so)
        linux-vdso.so.1 (0x00007fff635f6000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f612634e000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f612612f000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6125d91000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f6125b8d000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f612579c000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f61276ca000)
@adamrodger
Copy link
Contributor Author

Ubuntu 18.04 appears to support up to libc 2.27: https://www.ubuntuupdates.org/package/core/bionic/main/updates/glibc

@mefellows
Copy link
Member

We have a similar issue with the current most popular Node Image (16) - see pact-foundation/pact-js#888.

It works on the latest (Node 18) however many will still be stuck on older versions. I'm comfortable recommending against Alpine and have recently improved our official guidance on that, but I wonder if we aren't using any particular features of glibc, could we link against an older version to increase compatibility across the ecosystems?

@omajid
Copy link

omajid commented Aug 16, 2022

Hey folks. I did a run down of which Linux distributions include which version of glibc:

Distribution glibc version
Arch Linux 2.36
Alpine 3.13 N/A
CentOS 7 2.17
CentOS Stream 8 2.28
CentOS Stream 9 2.34
Debian 9 (Stretch) 2.24
Debian 10 (Buster) 2.28
Debian 11 (Bullseye) 2.31
Fedora 35 2.34
Homebrew 2.23
OpenSUSE Leap 15.3 2.31
OpenSUSE Tumbleweed 2.35
RHEL 7 2.17
RHEL 8 2.28
RHEL 9 2.34
Ubuntu 18.04 2.27
Ubuntu 20.04 2.31
Ubuntu 22.04 2.35

You can see that requiring glibc 2.29 leaves out a number of large and popular distirubtions, including CentOS 7, CentOS 8, Debian 9, Debian 10, RHEL 7, RHEL 8, Ubuntu 18.04.

Would it be possible to revisit this decision and make the ffi library more compatible? IIRC, it's a matter of rebuilding in an environment that has an old version of glibc. Is there something I can do to help make that happen?

@mefellows
Copy link
Member

At the very least, this build would need to be ported to run on an older OS. As a starting point, pinning it to 20.04 would mean we don't make the problem worse when GH automatically migrates us to the latest.

It looks like GH have deprecated the Ubuntu 18.04 release, so presumably the only option will be to create our own runner, probably on CentOS 7 if you want to go back as far as possible and stick with an open distro.

I think SmartBear (my and several other Core Maintainers current employer) will be willing to foot the bill, but somebody needs to do the work to create an image that would work.

@rholshausen
Copy link
Contributor

Library built on Ubuntu 18.04 seems to work on 20.04 and 22.04.

@omajid
Copy link

omajid commented Aug 19, 2022

We could just continue to run the build on ubuntu-latest VM, but run the builds (ci or otherwise) inside a container. That will allow us to easily run CI on multiple Linux distributions too. I am prototyping that now.

@rholshausen
Copy link
Contributor

Using an official Rust Debian stretch image, the built shared lib works on Ubuntu 18.04.

@mefellows
Copy link
Member

mefellows commented Aug 19, 2022 via email

@omajid
Copy link

omajid commented Aug 19, 2022

Thanks, @rholshausen! I think that gets us to glibc 2.24, which means that only CentOS 7 and RHEL 7 from the matrix above are not covered. I suppose that's something we can live with?

Is there anything remaining here that I can help with?

@mefellows
Copy link
Member

I think it's a great start and is going to make a big difference already.

Building on a centos 7 image would get us the best traction obviously, but I don't think it's urgent just yet. Perhaps we wait for demand on those images before we go back that far? I'd prefer to run on a debian based image if possible.

@omajid
Copy link

omajid commented Aug 19, 2022

That works for me. (I reserve the right to change my mind 😉 )

Do you know when I should expect a release that works with glibc 2.24?

I see https://github.com/pact-foundation/pact-reference/releases/tag/libpact_ffi-v0.3.8. Thanks!

@mefellows
Copy link
Member

mefellows commented Aug 19, 2022 via email

@rholshausen
Copy link
Contributor

Ok, release build has completed.

@omajid Thanks for all the help. Your table of versions was really useful.

@rholshausen
Copy link
Contributor

Closing this, as I think it is reasonable to have the min version run on Centos/RHEL 8.

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

4 participants