diff --git a/.github/workflows/bld_wheels_and_upload.yml b/.github/workflows/bld_wheels_and_upload.yml index 1406ff31..b72f9936 100644 --- a/.github/workflows/bld_wheels_and_upload.yml +++ b/.github/workflows/bld_wheels_and_upload.yml @@ -5,7 +5,7 @@ on: pull_request: push: branches: - - master + - '*' # Sequence of patterns matched against refs/tags tags: - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 @@ -70,11 +70,15 @@ jobs: uses: pypa/cibuildwheel@v3.4.1 env: CIBW_ARCHS_LINUX: "x86_64 i686" - CIBW_MANYLINUX_I686_IMAGE: manylinux2014 - CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + # clidriver v12.1 needs glibc >= 2.34 and CPUs supporting the x86_64-v2 + # instruction set (see https://github.com/pypa/manylinux/issues/1725), + # so manylinux2014 (glibc 2.17) can no longer be used here. + CIBW_MANYLINUX_I686_IMAGE: manylinux_2_34 + CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_34 CIBW_SKIP: "cp38-* *t-* *-musllinux_* *-*linux_{aarch64,ppc64le}" CIBW_REPAIR_WHEEL_COMMAND_LINUX: auditwheel repair + --disable-isa-ext-check --exclude libdb2.so.1 --exclude libDB2xml4c.so.58 --exclude libm.so.6 diff --git a/README.md b/README.md index 3b2fbc8b..fc6b3a29 100644 --- a/README.md +++ b/README.md @@ -60,12 +60,12 @@ If you face problems due to missing python header files while installing the dri If you have installed `DB2_RTC*` i.e. **DB2 Runtime Client** and want `ibm_db` to use it instead of clidriver, please read [this comment](https://github.com/ibmdb/python-ibmdb/issues/1023#issuecomment-3062805368) and take action. -- clidriver v12.1 on Linux uses x86_64_v2 instruction set which is not supported by cibuildwheel and wheel image creation [fails](https://github.com/pypa/manylinux/issues/1725) using v12.1 clidriver. So, default version of clidriver on Linux platform is v11.5.9 only. +- clidriver v12.1 on Linux requires glibc >= 2.34 and a CPU supporting the x86_64-v2 instruction set (e.g. Ubuntu 21.10+, RHEL 9+, Debian 12+, Fedora 35+ on hardware from 2009 onwards). Official Linux wheels on PyPI are now built with v12.1 clidriver using the `manylinux_2_34` image (see [pypa/manylinux#1725](https://github.com/pypa/manylinux/issues/1725) for background). -- You can force installation of ibm_db on Linux with clidriver v12.1 using below commands: +- If your system does not meet the glibc/CPU requirement above, install ibm_db from source with the older v11.5.9 clidriver instead: ``` -export CLIDRIVER_VERSION=v12.1.0 +export CLIDRIVER_VERSION=v11.5.9 pip install ibm_db --no-binary :all: --no-cache-dir ``` @@ -477,7 +477,7 @@ conn = ibm_db.connect(connStr,'','') - For MacOSx64(Intel processor) and Linuxx64, **db2connect license of version 11.5** is required. -- clidriver v12.1 on Linux uses x86_64_v2 instruction set which is not supported by `cibuildwheel` and wheel image creation [fails](https://github.com/pypa/manylinux/issues/1725) using v12.1 clidriver. So, default version of clidriver on Linux platform is v11.5.9 only. +- clidriver v12.1 on Linux requires glibc >= 2.34 and a CPU supporting the x86_64-v2 instruction set (see [pypa/manylinux#1725](https://github.com/pypa/manylinux/issues/1725) for background). Official Linux wheels on PyPI are built with v12.1 clidriver using the `manylinux_2_34` image. - For activating server side license, you can purchase either `Db2 Connect Unlimited Edition for System z®` or `Db2 Connect Unlimited Edition for System i®` license from IBM. diff --git a/ibm_db.c b/ibm_db.c index c9363119..52d164c7 100644 --- a/ibm_db.c +++ b/ibm_db.c @@ -28,6 +28,7 @@ #include #include "ibm_db.h" #include +#include #ifdef _WIN32 #include #else diff --git a/setup.py b/setup.py index ce4bbd14..363c4766 100644 --- a/setup.py +++ b/setup.py @@ -288,12 +288,7 @@ def print_exception( e, url): prebuildIbmdbPYD = True # Get version of clidriver for autodownload from environment variable CLIDRIVER_VERSION -# Default version is v12.1.0 for non-linux platform. -clidriver_version = os.getenv("CLIDRIVER_VERSION", "v12.1.0") - -# Default version is v11.5.9 for linux. clidriver v12.1.0 for linux uses x86_64_V2 instruction set which is not supported by cibuildwheel -if ('linux' == sys.platform): - clidriver_version = os.getenv("CLIDRIVER_VERSION", "v11.5.9") +clidriver_version = os.getenv("CLIDRIVER_VERSION", "") if ((ibm_db_home == '') and (ibm_db_dir == '') and (ibm_db_lib == '')): if('win32' not in sys.platform): @@ -383,7 +378,8 @@ def print_exception( e, url): ibm_db_lib_runtime = os.path.join('$ORIGIN', 'clidriver', 'lib') ibm_db_dir = 'clidriver' ibm_db_lib = os.path.join(ibm_db_dir, 'lib') - clidriver_version = clidriver_version + "/" + if(clidriver_version and not clidriver_version.endswith("/")): + clidriver_version = clidriver_version + "/" if not os.path.isdir('clidriver'): if 'IBM_DB_INSTALLER_URL' in os.environ: