Skip to content

Keep Linux conda package backward compatible with older glibc/libstdc++ (e.g. Ubuntu 20) - #48

Open
ChaotX wants to merge 2 commits into
KxSystems:mainfrom
ChaotX:pr/ubuntu20-compat
Open

ChaotX wants to merge 2 commits into
KxSystems:mainfrom
ChaotX:pr/ubuntu20-compat

Conversation

@ChaotX

@ChaotX ChaotX commented Oct 2, 2026 •

Copy link
Copy Markdown

Closes #47

The Linux conda build currently picks up glibc/libstdc++ versions newer
than some target environments (e.g. Ubuntu 20) provide, causing load
failures at runtime.

Pins the conda sysroot glibc floor and cxx_compiler_version, and sets
LD_LIBRARY_PATH via activate/deactivate scripts so the package's own
libarrow/libstdc++ are preferred over the host's older ones.

…++ (e.g. Ubuntu 20)

Pin the conda sysroot glibc floor and cxx_compiler_version, and set
LD_LIBRARY_PATH on activate/deactivate so the package's own
libarrow/libstdc++ are preferred over the host's older ones.
zvenczel-kx
zvenczel-kx previously approved these changes Oct 14, 2026

@zvenczel-kx zvenczel-kx left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@nmcdonnell-kx
nmcdonnell-kx self-requested a review October 14, 2026 10:44
@nmcdonnell-kx

Copy link
Copy Markdown
Collaborator

Hold off - there's a few things I need to cover

Comment thread recipe/activate.sh Resolved
Comment thread recipe/activate.sh Resolved
Comment thread recipe/variants.yaml
c_stdlib:
- sysroot
c_stdlib_version:
- "2.17"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't quite understand this.
You should be picking up the conda versions of libgcc/libstdc++ at build and runtime (not the system ones)
What's the issue?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is about glibc, which conda does not ship. The sysroot used at build time sets the minimum glibc the module's .so needs on the host. Before the pin, our CI on Ubuntu 20.04 (glibc 2.31) failed with:

no kexport: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by .../lib/q/mod/kx/arrow/clib.li64.so)

With c_stdlib: sysroot / c_stdlib_version: "2.17" the module needs at most GLIBC_2.14 (checked with readelf -V on the built clib.li64.so), and the package declares __glibc >=2.17. A newer glibc is backward compatible, so it still works on 22.04, 24.04 and later.

On libgcc/libstdc++: at runtime the env's copies are used. The related change is the cxx_compiler_version: "10.4" pin in variants-linux.yaml. I built the package with and without it:

  • Without the pin (gcc 16.2), the module needs GLIBCXX_3.4.31 and the package requires libstdcxx >=16 and libgcc >=16.
  • With the pin (gcc 10.4), the module needs only GLIBCXX_3.4.21 and the package requires libstdcxx-ng >=12 and libgcc-ng >=12.

So the pin lowers both the module's own libstdc++ symbol requirement and the minimum runtime dependency, which keeps the package installable next to other packages in older envs. The glibc requirement is identical in both builds.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspected you might be referring to glibc (i.e. libc.so) but wasn't quite sure.
That's one on the core libraries which conda doesn't provide - it relies on the system version.
Bizarrely I'm on ubuntu:20 but didn't see this problem with q-kx-arrow.
So yes, it makes sense to tie the GLIBC version as low as possible to keep it compatible with older distros.
But a concern would be that it would limits the maximum c++ version available which may cause other problems, such as certain features becoming unavailable in the third party libraries. That in turn could have implications for the module itself if it uses those features.
Let me take this away because it requires more investigation.

@nmcdonnell-kx
nmcdonnell-kx dismissed zvenczel-kx’s stale review October 14, 2026 16:37

Needs further discussion

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

Successfully merging this pull request may close these issues.

Linux conda package fails on older glibc/libstdc++ (e.g. Ubuntu 20)

3 participants