Skip to content

Print glibc version when building an image with Postgres

Nikolay Samokhvalov requested to merge nik-ldd-version-print into master

glibc version control is crucial when DLE is working in "physical" mode – bringing PGDATA that was created using one glibc version, and start working with another version is a good way to experience index corruption.

Slack discussion (internal): https://postgres-ai.slack.com/archives/C01A3PRUCR3/p1661253214288229

Here we just print the version using ldd --version, to be able to understand which version was using when building – we'll be able to inspect CI/CD pipelines to check it.

Further, we need to find a way of better control of it, and better flexibility (different cases may require different glibc versions).

Example

https://gitlab.com/postgres-ai/custom-images/-/jobs/2949620607/raw:

...
 ---> 059615ef7c66
Step 7/20 : RUN echo "glibc version: " && ldd --version     && apt-get clean && rm -rf /var/lib/apt/lists/partial     && if [ $(sed 's/\..*//' /etc/debian_version) = "9" ]; then       echo "deb http://deb.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/backports.list;     fi     && apt-get update -o Acquire::CompressionTypes::Order::=gz     && apt-get install --no-install-recommends -y apt-transport-https ca-certificates        wget curl sudo git make cmake gcc build-essential        libbrotli-dev liblzo2-dev libsodium-dev     && cd /tmp && wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz     && rm -rf /usr/local/go && tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz     && export PATH=$PATH:/usr/local/go/bin     && git clone --branch v${WALG_VERSION} --single-branch https://github.com/wal-g/wal-g.git     && cd wal-g && export USE_LIBSODIUM=1 && export USE_LZO=1     && make deps && GOBIN=/usr/local/bin make pg_install
 ---> Running in 0df5ffaadf71
glibc version: 
ldd (Debian GLIBC 2.31-13+deb11u3) 2.31
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
...
Edited by Nikolay Samokhvalov

Merge request reports