From 9fb434c467880d679f02ea05d40e6e0f39f43534 Mon Sep 17 00:00:00 2001 From: Varsha Kumar Date: Wed, 22 Jul 2026 20:02:11 +0000 Subject: [PATCH 1/4] Add buildscript for lz4 4.4.5 on UBI 9.6 Signed-off-by: Varsha Kumar --- l/lz4/build_info.json | 19 ++++++++ l/lz4/lz4_4.4.5_ubi_9.6.sh | 92 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 l/lz4/build_info.json create mode 100755 l/lz4/lz4_4.4.5_ubi_9.6.sh diff --git a/l/lz4/build_info.json b/l/lz4/build_info.json new file mode 100644 index 0000000000..8365f0e54c --- /dev/null +++ b/l/lz4/build_info.json @@ -0,0 +1,19 @@ +{ + "maintainer": "varsha.kumar@ibm.com", + "package_name": "lz4", + "github_url": "https://github.com/python-lz4/python-lz4", + "version": "v4.4.5", + "default_branch": "master", + "build_script": "lz4_4.4.5_ubi_9.6.sh", + "wheel_build" : true, + "package_dir": "l/lz4", + "docker_build": false, + "validate_build_script": true, + "use_non_root_user": false, + "v4.4.5":{ + "build_script": "lz4_4.4.5_ubi_9.6.sh" + }, + "*": { + "build_script": "lz4_4.4.5_ubi_9.6.sh" + } +} diff --git a/l/lz4/lz4_4.4.5_ubi_9.6.sh b/l/lz4/lz4_4.4.5_ubi_9.6.sh new file mode 100755 index 0000000000..795a44fb3b --- /dev/null +++ b/l/lz4/lz4_4.4.5_ubi_9.6.sh @@ -0,0 +1,92 @@ +#!/bin/bash -e +# ----------------------------------------------------------------------------- +# +# Package : lz4 +# Version : v4.4.5 +# Source repo : https://github.com/python-lz4/python-lz4 +# Tested on : UBI:9.6 +# Language : Python +# Ci-Check : True +# Script License: Apache License, Version 2 or later +# Maintainer : Varsha Kumar +# +# Disclaimer: This script has been tested in root mode on given +# ========== platform using the mentioned version of the package. +# It may not work as expected with newer versions of the +# package and/or distribution. In such case, please +# contact "Maintainer" of this script. +# +# ---------------------------------------------------------------------------- + +# Variables +PACKAGE_DIR="python-lz4" +PACKAGE_NAME="lz4" +PACKAGE_VERSION=${1:-v4.4.5} +PACKAGE_URL="https://github.com/python-lz4/python-lz4.git" +SOURCE_ROOT="$(pwd)" + +echo "Building ${PACKAGE_NAME} ${PACKAGE_VERSION}" + +# Install system dependencies +dnf install -y gcc-toolset-13 git python3.12 python3.12-devel python3.12-pip + +export PATH="/opt/rh/gcc-toolset-13/root/usr/bin:$PATH" + +# Install build frontend + build-time deps +python3.12 -m pip install "build" "setuptools>=45" "wheel" "setuptools_scm[toml]>=6.2" "pkgconfig" + +# Clone and checkout +rm -rf "$PACKAGE_DIR" +git clone "$PACKAGE_URL" "$PACKAGE_DIR" +cd "${PACKAGE_DIR}" +git checkout "$PACKAGE_VERSION" +git submodule update --init --depth 1 + +# setuptools_scm derives the version from git tags. +# Export the version explicitly so shallow/detached checkouts work correctly. +SEMVER="${PACKAGE_VERSION#v}" +export SETUPTOOLS_SCM_PRETEND_VERSION="${SEMVER}" + +# Build wheel (all lz4 C sources are bundled in lz4libs/ — no system liblz4 needed) +python3.12 -m build --wheel --outdir "${SOURCE_ROOT}/dist/" + +WHEEL=$(find "${SOURCE_ROOT}/dist" -name "${PACKAGE_NAME}-*.whl" | head -1) +if [ -z "$WHEEL" ]; then + echo "ERROR: wheel not found after build" + exit 1 +fi +echo "Wheel: $WHEEL" + +cd "${SOURCE_ROOT}" + +# Install wheel + test dependencies +echo "=== Installing Wheel ===" +python3.12 -m pip install "${WHEEL}" +python3.12 -m pip install pytest pytest-timeout psutil + +# Run tests +echo "=== Running Tests ===" + +# 1. Version check +python3.12 -c "import importlib.metadata; print('lz4 version:', importlib.metadata.version('lz4'))" + +# 2. Upstream unit tests. +# - block/ and frame/ tests are pure compression round-trips; no external services. +# - stream/ tests are skipped (only built when PYLZ4_EXPERIMENTAL=True). +python3.12 -m pytest \ + "${PACKAGE_DIR}/tests/block/" \ + "${PACKAGE_DIR}/tests/frame/" \ + -v \ + --timeout=60 \ + -x + +TEST_EXIT=$? +cd "${SOURCE_ROOT}" + +if [ "$TEST_EXIT" -ne 0 ]; then + echo "ERROR: Tests failed (exit $TEST_EXIT)" + exit "$TEST_EXIT" +fi + +echo -e "\n=== Build Complete ===" +echo "Wheel: $WHEEL" \ No newline at end of file From 7884a6ecdb8431e652bf17d1e76c30688ff2a6ab Mon Sep 17 00:00:00 2001 From: Varsha Kumar Date: Wed, 22 Jul 2026 20:29:01 +0000 Subject: [PATCH 2/4] Fixed python builds Signed-off-by: Varsha Kumar --- l/lz4/lz4_4.4.5_ubi_9.6.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l/lz4/lz4_4.4.5_ubi_9.6.sh b/l/lz4/lz4_4.4.5_ubi_9.6.sh index 795a44fb3b..987bd701ca 100755 --- a/l/lz4/lz4_4.4.5_ubi_9.6.sh +++ b/l/lz4/lz4_4.4.5_ubi_9.6.sh @@ -73,6 +73,8 @@ python3.12 -c "import importlib.metadata; print('lz4 version:', importlib.metada # 2. Upstream unit tests. # - block/ and frame/ tests are pure compression round-trips; no external services. # - stream/ tests are skipped (only built when PYLZ4_EXPERIMENTAL=True). +# Run from SOURCE_ROOT so Python uses the installed wheel, not the source tree +# (setup.cfg sets inplace=1 which leaves no compiled extensions in the source lz4/). python3.12 -m pytest \ "${PACKAGE_DIR}/tests/block/" \ "${PACKAGE_DIR}/tests/frame/" \ @@ -81,8 +83,6 @@ python3.12 -m pytest \ -x TEST_EXIT=$? -cd "${SOURCE_ROOT}" - if [ "$TEST_EXIT" -ne 0 ]; then echo "ERROR: Tests failed (exit $TEST_EXIT)" exit "$TEST_EXIT" From c7637b24354579e22be0084db2545117ae9dc695 Mon Sep 17 00:00:00 2001 From: Varsha Kumar Date: Thu, 23 Jul 2026 14:38:20 +0000 Subject: [PATCH 3/4] Fixed python references Signed-off-by: Varsha Kumar --- l/lz4/lz4_4.4.5_ubi_9.6.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/l/lz4/lz4_4.4.5_ubi_9.6.sh b/l/lz4/lz4_4.4.5_ubi_9.6.sh index 987bd701ca..c05a7e43ed 100755 --- a/l/lz4/lz4_4.4.5_ubi_9.6.sh +++ b/l/lz4/lz4_4.4.5_ubi_9.6.sh @@ -32,6 +32,9 @@ dnf install -y gcc-toolset-13 git python3.12 python3.12-devel python3.12-pip export PATH="/opt/rh/gcc-toolset-13/root/usr/bin:$PATH" +# Register any shared libraries installed/built outside this script (e.g. source-built Python versions) +ldconfig + # Install build frontend + build-time deps python3.12 -m pip install "build" "setuptools>=45" "wheel" "setuptools_scm[toml]>=6.2" "pkgconfig" From 5c5aca77ff1ed3d5a299c9f44b97442a61b27ed6 Mon Sep 17 00:00:00 2001 From: Varsha Kumar Date: Thu, 23 Jul 2026 15:26:32 +0000 Subject: [PATCH 4/4] Another python configuration change Signed-off-by: Varsha Kumar --- l/lz4/lz4_4.4.5_ubi_9.6.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/l/lz4/lz4_4.4.5_ubi_9.6.sh b/l/lz4/lz4_4.4.5_ubi_9.6.sh index c05a7e43ed..c1da2e9686 100755 --- a/l/lz4/lz4_4.4.5_ubi_9.6.sh +++ b/l/lz4/lz4_4.4.5_ubi_9.6.sh @@ -32,8 +32,11 @@ dnf install -y gcc-toolset-13 git python3.12 python3.12-devel python3.12-pip export PATH="/opt/rh/gcc-toolset-13/root/usr/bin:$PATH" -# Register any shared libraries installed/built outside this script (e.g. source-built Python versions) +# Source-built Pythons install libpythonX.Y.so.1.0 to /usr/local/lib but the +# linker cache may not include that path yet. Register it and also set +# LD_LIBRARY_PATH as a fallback for environments where ldconfig has no effect. ldconfig +export LD_LIBRARY_PATH="/usr/local/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" # Install build frontend + build-time deps python3.12 -m pip install "build" "setuptools>=45" "wheel" "setuptools_scm[toml]>=6.2" "pkgconfig"