Skip to content

Commit 759786e

Browse files
eric-weaverdd-agent-integrations-bot[bot]
andauthored
[DBMON-5975] Upgrade libpq to 18.3 (DataDog#23702)
* Update Linux / OSX to use libpq 18.3 * Update windows build image for PG 18 * Fix command * Fix quoting * temp comment out openssl * fix quoting issues * Add missing prerequisite dependency * Fix RunOnVSConsole to bubble up non-zero exit codes * temp command to verify fix * Undo temp changes * Revert helpers.ps1 changes * Update dependency resolution * use explicit OpenSSL paths for Meson dependency * Update dependency resolution --------- Co-authored-by: dd-agent-integrations-bot[bot] <dd-agent-integrations-bot[bot]@users.noreply.github.com>
1 parent 505fbd1 commit 759786e

12 files changed

Lines changed: 153 additions & 145 deletions

File tree

.builders/images/linux-aarch64/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ RUN \
107107
# libpq and pg_config as needed by psycopg
108108
RUN yum install -y flex && \
109109
DOWNLOAD_URL="https://ftp.postgresql.org/pub/source/v{{version}}/postgresql-{{version}}.tar.bz2" \
110-
VERSION="16.9" \
111-
SHA256="07c00fb824df0a0c295f249f44691b86e3266753b380c96f633c3311e10bd005" \
110+
VERSION="18.3" \
111+
SHA256="d95663fbbf3a80f81a9d98d895266bdcb74ba274bcc04ef6d76630a72dee016f" \
112112
RELATIVE_PATH="postgresql-{{version}}" \
113113
bash install-from-source.sh --without-readline --with-openssl --without-icu --with-gssapi
114114
# Add paths to pg_config and to the library

.builders/images/linux-x86_64/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ RUN \
108108
--without-debugger \
109109
--disable-static
110110

111-
# libpq and pg_config as needed by psycopg2
111+
# libpq and pg_config as needed by psycopg
112112
RUN yum install -y flex && \
113113
DOWNLOAD_URL="https://ftp.postgresql.org/pub/source/v{{version}}/postgresql-{{version}}.tar.bz2" \
114-
VERSION="16.9" \
115-
SHA256="07c00fb824df0a0c295f249f44691b86e3266753b380c96f633c3311e10bd005" \
114+
VERSION="18.3" \
115+
SHA256="d95663fbbf3a80f81a9d98d895266bdcb74ba274bcc04ef6d76630a72dee016f" \
116116
RELATIVE_PATH="postgresql-{{version}}" \
117117
bash install-from-source.sh --without-readline --with-openssl --without-icu --with-gssapi
118118
# Add paths to pg_config and to the library

.builders/images/macos/builder_setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ rm "${DD_PREFIX_PATH}/bin/curl"
9595

9696
# libpq and pg_config as needed by psycopg
9797
DOWNLOAD_URL="https://ftp.postgresql.org/pub/source/v{{version}}/postgresql-{{version}}.tar.bz2" \
98-
VERSION="16.9" \
99-
SHA256="07c00fb824df0a0c295f249f44691b86e3266753b380c96f633c3311e10bd005" \
98+
VERSION="18.3" \
99+
SHA256="d95663fbbf3a80f81a9d98d895266bdcb74ba274bcc04ef6d76630a72dee016f" \
100100
RELATIVE_PATH="postgresql-{{version}}" \
101101
install-from-source --without-readline --with-openssl --without-icu
102102
# Add paths to pg_config and to the library

.builders/images/windows-x86_64/Dockerfile

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,19 +139,31 @@ RUN Get-RemoteFile `
139139
'C:\perl\perl\bin\perl.exe Configure && `
140140
nmake && `
141141
nmake install_sw'
142+
# flex and bison are required for building PostgreSQL from source
143+
ENV WINFLEXBISON_VERSION="2.5.25"
144+
RUN Get-RemoteFile `
145+
-Uri https://github.com/lexxmark/winflexbison/releases/download/v$Env:WINFLEXBISON_VERSION/win_flex_bison-$Env:WINFLEXBISON_VERSION.zip `
146+
-Path win_flex_bison-$Env:WINFLEXBISON_VERSION.zip `
147+
-Hash '8d324b62be33604b2c45ad1dd34ab93d722534448f55a16ca7292de32b6ac135'; `
148+
7z x win_flex_bison-$Env:WINFLEXBISON_VERSION.zip -oC:\winflexbison && `
149+
Remove-Item win_flex_bison-$Env:WINFLEXBISON_VERSION.zip && `
150+
Add-ToPath -Append 'C:\winflexbison'
151+
# Meson + Ninja for building PostgreSQL 18+ on Windows
152+
RUN python -m pip install --no-warn-script-location meson ninja && `
153+
Add-ToPath -Append 'C:\Program Files\Python313\Scripts'
142154
# libpq and pg_config as needed by psycopg
143-
ENV PG_VERSION="16.9"
144-
COPY pg_config.pl C:\pg_config.pl
155+
ENV PG_VERSION="18.3"
145156
RUN Get-RemoteFile `
146157
-Uri https://ftp.postgresql.org/pub/source/v$Env:PG_VERSION/postgresql-$Env:PG_VERSION.tar.bz2 `
147158
-Path postgresql-$Env:PG_VERSION.tar.bz2 `
148-
-Hash '07c00fb824df0a0c295f249f44691b86e3266753b380c96f633c3311e10bd005'; `
159+
-Hash 'd95663fbbf3a80f81a9d98d895266bdcb74ba274bcc04ef6d76630a72dee016f'; `
149160
7z x postgresql-$Env:PG_VERSION.tar.bz2 -r -y && `
150-
7z x postgresql-$Env:PG_VERSION.tar -oC:\postgresql_src && `
151-
cd C:\postgresql_src\postgresql-$Env:PG_VERSION\src\tools\msvc && `
152-
Copy-Item C:\pg_config.pl -Destination .\config.pl && `
153-
RunOnVSConsole -Command 'C:\perl\perl\bin\perl.exe build.pl' && `
154-
RunOnVSConsole -Command 'C:\perl\perl\bin\perl.exe install.pl C:\postgresql' && `
161+
7z x postgresql-$Env:PG_VERSION.tar -oC:\postgresql_src
162+
RUN New-Item -ItemType Junction -Path C:\OpenSSL -Target 'C:\Program Files\OpenSSL'; `
163+
$mesonCmd = 'meson setup C:\pgbuild C:\postgresql_src\postgresql-' + $Env:PG_VERSION + ' --prefix=C:\postgresql -Dssl=openssl -Dextra_include_dirs=C:\OpenSSL\include -Dextra_lib_dirs=C:\OpenSSL\lib -Dgssapi=disabled -Dreadline=disabled -Dicu=disabled -Dnls=disabled -Dlz4=disabled -Dzstd=disabled -Dlibxml=disabled -Dlibxslt=disabled -Dllvm=disabled'; `
164+
RunOnVSConsole -Command $mesonCmd && `
165+
RunOnVSConsole -Command 'ninja -C C:\pgbuild' && `
166+
RunOnVSConsole -Command 'ninja -C C:\pgbuild install' && `
155167
Add-ToPath -Append "C:\postgresql\bin"
156168

157169
ENV CURL_VERSION="8.19.0"

.builders/images/windows-x86_64/pg_config.pl

Lines changed: 0 additions & 4 deletions
This file was deleted.

.deps/builder_inputs.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
# Hash inputs are defined in .builders/inputs_hash.py (SHARED_INPUTS,
1212
# RESOLUTION_INPUTS).
1313
[resolution]
14-
hash = "3a0350917a9a4534e7b427439cc6cc9eee31fe8c4b114c7938cb3d0fb5d38c67"
14+
hash = "760d13e44a0eba8f966d77b7400f22cb19842e3a18ba72f7feea4a59f6f5b997"
1515

1616
[images]
17-
linux-aarch64 = "5239191575da3521adfbb9992114201c71c65ff3056de4ae2e475390d218d194"
18-
linux-x86_64 = "83d13d3171972f56b1336d325eecae73bf5e2329a24142f25e68ae50c542ce6a"
19-
macos-aarch64 = "c0d0865f31792ef8115f81b8722414ecd5b2c717882074d3c27b67093b6f67a4"
20-
macos-x86_64 = "f079703480309dd348f20d07bcabc9278bd78619cde7a4146cebbac5292bfc60"
21-
windows-x86_64 = "d7cc3720c0ac20a28c20d0fd606d6d0a84023e97682c39994ac99c1cdef9e817"
17+
linux-aarch64 = "f183db47c9b55ef83e324c5eeb8edaba75feaa5766f695da6f4f5964668579d4"
18+
linux-x86_64 = "6be1f5dc7b15d968e86b029bb14e6506dc47ef98c9e2fcd4f8fd38b8606751ac"
19+
macos-aarch64 = "9f7be2b1033bb3c36ce7ce6e3e50af9b50fb3ca24eedfa91f17355f913bc5006"
20+
macos-x86_64 = "3ae85bb4ba101b21bb6e50c81f5829c7c73fc563252557e86dcbfba048add8e2"
21+
windows-x86_64 = "45eff85143d43b51ca80bff7431ff3ca2b96ae1b242dbed7cad379767032bf9f"

.deps/image_digests.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"linux-aarch64": "sha256:293e22087f45e4f460a527f2583c9592ae702a55b318cc6066f255e60470a40e",
3-
"linux-x86_64": "sha256:57380fd04afcf90a50087ad3d3e32c2075a801bab93478be4a83c0a2cabeb867",
4-
"windows-x86_64": "sha256:5f99e8d346605ce93a0656908bbd4da6258ce9b67798c18a9a327a5f08403be7"
2+
"linux-aarch64": "sha256:75e43dcd27c73cb11b93530d0f4a6e832ed36c8940777f361e03fe4fd0311ce1",
3+
"linux-x86_64": "sha256:6a16bc2e11096b8c17bfdc1deaef4b5f0828ea57811bbffc31a84a354b663cf8",
4+
"windows-x86_64": "sha256:db6ee72b8ef6e6ba9ce212d02b320e5a6a9e0ae20e578693f94a15f7aff417e0"
55
}

0 commit comments

Comments
 (0)