From f1fb00e8859caefb63af315e931b7582465f0a0f Mon Sep 17 00:00:00 2001 From: Ferenc Lombai Date: Fri, 2 Oct 2026 11:18:25 +0200 Subject: [PATCH 1/2] Keep Linux conda package backward compatible with older glibc/libstdc++ (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. --- recipe/activate.sh | 4 ++++ recipe/build.sh | 4 ++++ recipe/deactivate.sh | 8 ++++++++ recipe/recipe.yaml | 5 +++++ recipe/variants-linux.yaml | 2 ++ recipe/variants.yaml | 5 +++++ 6 files changed, 28 insertions(+) create mode 100644 recipe/activate.sh create mode 100644 recipe/deactivate.sh create mode 100644 recipe/variants-linux.yaml diff --git a/recipe/activate.sh b/recipe/activate.sh new file mode 100644 index 0000000..13e76b1 --- /dev/null +++ b/recipe/activate.sh @@ -0,0 +1,4 @@ +#!/bin/sh +# q-kx-arrow: prefer this env's own libarrow/libstdc++/etc over the host's. +export Q_KX_ARROW_LD_LIBRARY_PATH_BACKUP="${LD_LIBRARY_PATH:-}" +export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" diff --git a/recipe/build.sh b/recipe/build.sh index baeecd2..4fc0a05 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -26,3 +26,7 @@ cmake .. \ cmake --build . --config $BUILD_TYPE cmake --build . --config $BUILD_TYPE --target install + +mkdir -p "${PREFIX}/etc/conda/activate.d" "${PREFIX}/etc/conda/deactivate.d" +cp "${RECIPE_DIR}/activate.sh" "${PREFIX}/etc/conda/activate.d/q-kx-arrow.sh" +cp "${RECIPE_DIR}/deactivate.sh" "${PREFIX}/etc/conda/deactivate.d/q-kx-arrow.sh" diff --git a/recipe/deactivate.sh b/recipe/deactivate.sh new file mode 100644 index 0000000..ddc4eed --- /dev/null +++ b/recipe/deactivate.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# q-kx-arrow: restore LD_LIBRARY_PATH as it was before activation. +if [ -n "${Q_KX_ARROW_LD_LIBRARY_PATH_BACKUP:-}" ]; then + export LD_LIBRARY_PATH="${Q_KX_ARROW_LD_LIBRARY_PATH_BACKUP}" +else + unset LD_LIBRARY_PATH +fi +unset Q_KX_ARROW_LD_LIBRARY_PATH_BACKUP diff --git a/recipe/recipe.yaml b/recipe/recipe.yaml index eabd5f5..232c3f9 100644 --- a/recipe/recipe.yaml +++ b/recipe/recipe.yaml @@ -18,6 +18,9 @@ build: requirements: build: - ${{ compiler("cxx") }} + - if: linux + then: + - ${{ stdlib("c") }} - cmake - make host: @@ -29,6 +32,8 @@ tests: - if: unix then: - test -f ${PREFIX}/lib/q/mod/kx/arrow/init.q + - test -f ${PREFIX}/etc/conda/activate.d/q-kx-arrow.sh + - test -f ${PREFIX}/etc/conda/deactivate.d/q-kx-arrow.sh - if: linux and x86_64 then: - test -f ${PREFIX}/lib/q/mod/kx/arrow/clib.li64.so diff --git a/recipe/variants-linux.yaml b/recipe/variants-linux.yaml new file mode 100644 index 0000000..aa412c7 --- /dev/null +++ b/recipe/variants-linux.yaml @@ -0,0 +1,2 @@ +cxx_compiler_version: + - "10.4" diff --git a/recipe/variants.yaml b/recipe/variants.yaml index 4bd117a..a697f81 100644 --- a/recipe/variants.yaml +++ b/recipe/variants.yaml @@ -1,6 +1,11 @@ zip_keys: - [libarrow, libparquet] +c_stdlib: + - sysroot +c_stdlib_version: + - "2.17" + libarrow: - "20.0" - "21.0" From c74230d1c3b1337f703c472c2a3c7f2a9bab7b09 Mon Sep 17 00:00:00 2001 From: Ferenc Lombai Date: Thu, 15 Oct 2026 17:46:02 +0200 Subject: [PATCH 2/2] Remove activate scripts --- recipe/activate.sh | 4 ---- recipe/build.sh | 4 ---- recipe/deactivate.sh | 8 -------- recipe/recipe.yaml | 2 -- 4 files changed, 18 deletions(-) delete mode 100644 recipe/activate.sh delete mode 100644 recipe/deactivate.sh diff --git a/recipe/activate.sh b/recipe/activate.sh deleted file mode 100644 index 13e76b1..0000000 --- a/recipe/activate.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# q-kx-arrow: prefer this env's own libarrow/libstdc++/etc over the host's. -export Q_KX_ARROW_LD_LIBRARY_PATH_BACKUP="${LD_LIBRARY_PATH:-}" -export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" diff --git a/recipe/build.sh b/recipe/build.sh index 4fc0a05..baeecd2 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -26,7 +26,3 @@ cmake .. \ cmake --build . --config $BUILD_TYPE cmake --build . --config $BUILD_TYPE --target install - -mkdir -p "${PREFIX}/etc/conda/activate.d" "${PREFIX}/etc/conda/deactivate.d" -cp "${RECIPE_DIR}/activate.sh" "${PREFIX}/etc/conda/activate.d/q-kx-arrow.sh" -cp "${RECIPE_DIR}/deactivate.sh" "${PREFIX}/etc/conda/deactivate.d/q-kx-arrow.sh" diff --git a/recipe/deactivate.sh b/recipe/deactivate.sh deleted file mode 100644 index ddc4eed..0000000 --- a/recipe/deactivate.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# q-kx-arrow: restore LD_LIBRARY_PATH as it was before activation. -if [ -n "${Q_KX_ARROW_LD_LIBRARY_PATH_BACKUP:-}" ]; then - export LD_LIBRARY_PATH="${Q_KX_ARROW_LD_LIBRARY_PATH_BACKUP}" -else - unset LD_LIBRARY_PATH -fi -unset Q_KX_ARROW_LD_LIBRARY_PATH_BACKUP diff --git a/recipe/recipe.yaml b/recipe/recipe.yaml index 232c3f9..8f96411 100644 --- a/recipe/recipe.yaml +++ b/recipe/recipe.yaml @@ -32,8 +32,6 @@ tests: - if: unix then: - test -f ${PREFIX}/lib/q/mod/kx/arrow/init.q - - test -f ${PREFIX}/etc/conda/activate.d/q-kx-arrow.sh - - test -f ${PREFIX}/etc/conda/deactivate.d/q-kx-arrow.sh - if: linux and x86_64 then: - test -f ${PREFIX}/lib/q/mod/kx/arrow/clib.li64.so