@@ -138,14 +138,28 @@ def test_03_pip_interpreter_version(site: Site, pip_cmd: PipCommand) -> None:
138138
139139
140140def test_04_pip_user_can_install_non_wheel_packages (site : Site ) -> None :
141- # ibm_db must be compiled from source, so choosing this also ensures that the Python headers
142- # can be found by pip
141+ # ibm_db is compiled from source, so choosing this also ensures that the Python headers can be
142+ # found by pip. Note that ibm_db publishes prebuilt manylinux wheels which pip prefers over the
143+ # sdist, so --no-binary is what actually makes this a source build.
143144 package_name = "ibm_db"
145+ # Do not downgrade: releases before 3.3.0 miss an `#include <wctype.h>` and do not compile with
146+ # current gcc, and releases before 3.2.5 still use Python APIs that were removed in 3.12.
147+ package_spec = f"{ package_name } ==3.3.0"
148+ # ibm_db downloads its native CLI driver while building, by default the latest one. Pin it, as
149+ # newer drivers are built against GLIBC_2.32 and cannot be loaded on our older distros, whereas
150+ # v11.5.9 needs at most GLIBC_2.14.
151+ clidriver_version = "v11.5.9"
144152
145153 # We're testing this only for one supported pip command as building from source just takes too long
146154 pip_cmd = PipCommand (["pip3" ], False )
147155
148- assert_install_package (pip_cmd .command + ["install" , package_name ], package_name , site )
156+ assert_install_package (
157+ ["env" , f"CLIDRIVER_VERSION={ clidriver_version } " ]
158+ + pip_cmd .command
159+ + ["install" , "--no-binary" , package_name , package_spec ],
160+ package_name ,
161+ site ,
162+ )
149163 assert_local_package_install_path (site , package_name , _local_package_installation_path (site ))
150164 assert_uninstall_and_purge_cache (pip_cmd , package_name , site )
151165
0 commit comments