model-writtenrun 5806 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Peter Eisentraut proposed replacing deprecated distutils.sysconfig with sysconfig, raising the minimum Python 2 version to 2.7, and initially deferring backpatching because older PostgreSQL branches supported older Python versions #1.
- Tom Lane accepted the change for HEAD but suggested investigating a dual-method fallback for older branches, which Peter agreed to examine #2 #3.
- After the affected buildfarm installations were upgraded, Peter landed the original patch unchanged as e0e567a106, but buildfarm failures revealed incorrect include paths and the absence of sysconfig in Python 3.1; he then reverted the conversion #6 #8.
- Tom reproduced the include-path problem with Debian 9's Python 2 installation and proposed preferring Python 3, while also supplying a separate delta that checked for Python.h and substituted /usr for /usr/local when necessary #10 #11.
- Peter endorsed the executable-selection experiment, and Tom committed the discussion-only change as f201da39ed, making configure probe python3 before python #12 #13.
- The experiment exposed incomplete Python 3 development installations, so Tom reverted it with 512fc2dd79 to give buildfarm owners time to prepare; he subsequently reported 18 affected animals #15 #18.
- Andrew Dunstan demonstrated that Amazon Linux's Python 3 packages also returned incorrect /usr/local include paths and suggested consulting INCLUDEPY instead #17.
- Tom attached Debian's changes to sysconfig.py as evidence for the packaging diagnosis, while Andres Freund explained that the posix_local scheme intentionally described local extension installation paths and proposed selecting posix_prefix instead #19 #20 #26.
- Tom initially favored checking actual header locations before overriding schemes, then accepted trying Andres's conditional scheme selection; Andres subsequently proposed INCLUDEPY as a better translation of the old include-discovery API #25 #28 #29.
- Tom and Andres rejected switching to python-config because it could mismatch the selected interpreter, disrupt existing configurations, and lacked Windows support; they instead agreed to collect buildfarm evidence about INCLUDEPY #32 #33 #34.
- Andres attached temporary include-path diagnostics in #35 and committed their code unchanged, with regenerated configure, as f032f63e72.
- Andres reported that INCLUDEPY matched the working legacy lookup across 73 animals, and Tom's subsequent survey of 92 animals supported using a single INCLUDEPY lookup and removing the temporary diagnostics #39 #40 #42.
- Tom landed bd233bdd8d as a modified version of Peter's original patch, replacing the two get_path calls with get_config_var('INCLUDEPY') and documenting the Python 3.2 minimum; the filesystem-rewrite and scheme-override alternatives were superseded #1 #42 #44.
- After the second landing succeeded across the buildfarm, Tom proposed backpatching only to PostgreSQL 11 and newer, while Andres argued for including PostgreSQL 10 and discussed whether to give advance notice in release notes #45 #47 #48.
- Tom accepted backpatching through PostgreSQL 10, Noah Misch supported that scope, and Tom proceeded despite discovering that pre-13 branches had supported Python as old as 2.4; Andres reaffirmed proceeding in the final message, leaving the main fix landed and the backpatch decision settled #49 #50 #51 #52.