When attempting to release WiredTiger 11.0.0 and 11.1.0 Python packages on PyPi, I ran into the below error while testing package installation locally (running Python 3.9.5, CMake 3.25.0, SWIG 4.0.1):
$ pip install ~/work/wiredtiger-changes/lang/python/dist/wiredtiger-11.1.0.tar.gz
(...)
Running setup.py install for wiredtiger ... error
ERROR: Command errored out with exit status 1:
command: /home/lchen/pytest/venv-11.1.0/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-f6n1i5rx/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-f6n1i5rx/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-74bohd_o/install-record.txt --single-version-externally-managed --compile --install-headers /home/lchen/pytest/venv-11.1.0/include/site/python3.9/wiredtiger
cwd: /tmp/pip-req-build-f6n1i5rx/
Complete output (15 lines):
running install
running build_ext
building '_wiredtiger' extension
creating build
creating build/temp.linux-x86_64-3.9
creating build/temp.linux-x86_64-3.9/cmake_pip_build
creating build/temp.linux-x86_64-3.9/cmake_pip_build/lang
creating build/temp.linux-x86_64-3.9/cmake_pip_build/lang/python
creating build/temp.linux-x86_64-3.9/cmake_pip_build/lang/python/CMakeFiles
creating build/temp.linux-x86_64-3.9/cmake_pip_build/lang/python/CMakeFiles/__wiredtiger.dir
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/tmp/pip-req-build-f6n1i5rx/cmake_pip_build/include -I/tmp/pip-req-build-f6n1i5rx/cmake_pip_build/config -I/tmp/pip-req-build-f6n1i5rx/cmake_pip_build -I. -I/usr/lib/include -I/usr/lib/include -I/usr/lib/include -I/home/lchen/pytest/venv-11.1.0/include -I/usr/include/python3.9 -c cmake_pip_build/lang/python/CMakeFiles/__wiredtiger.dir/wiredtigerPYTHON_wrap.c -o build/temp.linux-x86_64-3.9/cmake_pip_build/lang/python/CMakeFiles/__wiredtiger.dir/wiredtigerPYTHON_wrap.o -w -Wno-sign-conversion -std=c11 -I/tmp/pip-req-build-f6n1i5rx/cmake_pip_build/include -I/tmp/pip-req-build-f6n1i5rx/cmake_pip_build/config -I/tmp/pip-req-build-f6n1i5rx/cmake_pip_build -I. -I/usr/lib/include -I/usr/lib/include -I/usr/lib/include -DHAVE_CONFIG_H
x86_64-linux-gnu-gcc: error: cmake_pip_build/lang/python/CMakeFiles/__wiredtiger.dir/wiredtigerPYTHON_wrap.c: No such file or directory
x86_64-linux-gnu-gcc: fatal error: no input files
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
It turns out CMake attempted to find a file under the "__wiredtiger.dir" subdirectory, while a "wiredtiger_python.dir" subdirectory actually existed instead. (One can use the "--no-clean" option in the "pip install" command to retain the build directory.)
WT-8633 touched the setting of swig_workgen_target (changing the target name from "_wiredtiger" to "wiredtiger_python") and seems to be related. It's confirmed after reverting WT-8633 the issue stopped appearing.