Skip to content

Conversation

@MankiratSingh1315
Copy link

@MankiratSingh1315 MankiratSingh1315 commented Jun 11, 2025

Introducing a new build farm module, ABICompCheck,
designed to perform Application Binary Interface (ABI) compliance checking
for PostgreSQL builds using libabigail tools abidiff and abidw.

The module helps detect unintended ABI changes in stable branches
by comparing the latest commit against the most recent tag on that branch or the most recent entry in .abi-complaince-history if present in the source.
This is crucial for maintaining compatibility
for the PostgreSQL ABI stability guidelines for minor releases.

@MankiratSingh1315
Copy link
Author

MankiratSingh1315 commented Jun 16, 2025

will be working on the minor bugs like the abidw flags, binaries to compliance check and the postgres cflags take them from config,
last_commit_hash_file thing is still not working, will fix it as well

image
this is the output directory structure as of now

@MankiratSingh1315
Copy link
Author

Output Logs as of now

Tue Jun 17 02:59:13 2025: buildfarm run for df4c2566:HEAD starting
df4c2566:HEAD          [02:59:14] checking out source ...
df4c2566:HEAD          [02:59:17] checking if build run needed ...
df4c2566:HEAD          [02:59:17] checking if run needed by PGBuild::Modules::ABICompCheck
df4c2566:HEAD          [02:59:17] ABICompCheck: Stored PostgreSQL commit hash file ('/home/pgbuildfarm/client-code/buildroot/abicheck.df4c2566/HEAD/last_pg_commit_hash.txt') not found. Run needed.
df4c2566:HEAD          [02:59:17] copying source to pgsql.build ...
df4c2566:HEAD          [02:59:23] building PGBuild::Modules::ABICompCheck
running git clone -q  "/home/pgbuildfarm/client-code/buildroot/pgmirror.git" "pgsql"
df4c2566:HEAD          [02:59:26] ABICompCheck: Cloned PostgreSQL source to /home/pgbuildfarm/client-code/buildroot/abicheck.df4c2566/pgsql
df4c2566:HEAD          [02:59:27] ABICompCheck: Checked out branch 'HEAD' in /home/pgbuildfarm/client-code/buildroot/abicheck.df4c2566/pgsql
df4c2566:HEAD          [02:59:27] ABICompCheck: No previous commit hash found, comparing last 2 commits only.
Two commit hashes: ee685c9baf987984dbd2194d74576422996d95f4 f24fdf985561e7166d7d54459b764daae8efda44
df4c2566:HEAD          [02:59:27] Processing commits list in PGBuild::Modules::ABICompCheck
df4c2566:HEAD          [02:59:27] Checking out commit ee685c9baf987984dbd2194d74576422996d95f4 in PGBuild::Modules::ABICompCheck
df4c2566:HEAD          [02:59:27] Configuring, making, and installing for commit ee685c9baf987984dbd2194d74576422996d95f4 in PGBuild::Modules::ABICompCheck
df4c2566:HEAD          [02:59:27] Executing: configure
df4c2566:HEAD          [02:59:46] Successfully executed configure
df4c2566:HEAD          [02:59:46] Configuration complete for commit ee685c9baf987984dbd2194d74576422996d95f4.
df4c2566:HEAD          [02:59:46] Executing: make
df4c2566:HEAD          [03:05:52] Successfully executed make
df4c2566:HEAD          [03:05:52] Executing: makeinstall
df4c2566:HEAD          [03:05:55] Successfully executed makeinstall
df4c2566:HEAD          [03:05:55] Generating ABIDW XML for commit ee685c9baf987984dbd2194d74576422996d95f4 in PGBuild::Modules::ABICompCheck
df4c2566:HEAD          [03:05:55] Executing: abidw --out-file "/home/pgbuildfarm/client-code/buildroot/abicheck.df4c2566/xmls/ee685c9baf987984dbd2194d74576422996d95f4/postgres.abi" "/home/pgbuildfarm/client-code/buildroot/abicheck.df4c2566/install/bin/postgres" --drop-undefined-syms --no-architecture --no-comp-dir-path --no-elf-needed --no-show-locs --type-id-style hash
df4c2566:HEAD          [03:06:10] Successfully generated ABI XML for postgres to /home/pgbuildfarm/client-code/buildroot/abicheck.df4c2566/xmls/ee685c9baf987984dbd2194d74576422996d95f4/postgres.abi
df4c2566:HEAD          [03:06:10] Executing: abidw --out-file "/home/pgbuildfarm/client-code/buildroot/abicheck.df4c2566/xmls/ee685c9baf987984dbd2194d74576422996d95f4/ecpg.abi" "/home/pgbuildfarm/client-code/buildroot/abicheck.df4c2566/install/bin/ecpg" --drop-undefined-syms --no-architecture --no-comp-dir-path --no-elf-needed --no-show-locs --type-id-style hash
df4c2566:HEAD          [03:06:11] Successfully generated ABI XML for ecpg to /home/pgbuildfarm/client-code/buildroot/abicheck.df4c2566/xmls/ee685c9baf987984dbd2194d74576422996d95f4/ecpg.abi
df4c2566:HEAD          [03:06:11] Executing: abidw --out-file "/home/pgbuildfarm/client-code/buildroot/abicheck.df4c2566/xmls/ee685c9baf987984dbd2194d74576422996d95f4/libpq.so.abi" "/home/pgbuildfarm/client-code/buildroot/abicheck.df4c2566/install/lib/libpq.so" --drop-undefined-syms --no-architecture --no-comp-dir-path --no-elf-needed --no-show-locs --type-id-style hash
df4c2566:HEAD          [03:06:11] Successfully generated ABI XML for libpq.so to /home/pgbuildfarm/client-code/buildroot/abicheck.df4c2566/xmls/ee685c9baf987984dbd2194d74576422996d95f4/libpq.so.abi
df4c2566:HEAD          [03:06:11] Checking out commit f24fdf985561e7166d7d54459b764daae8efda44 in PGBuild::Modules::ABICompCheck
df4c2566:HEAD          [03:06:11] Configuring, making, and installing for commit f24fdf985561e7166d7d54459b764daae8efda44 in PGBuild::Modules::ABICompCheck
df4c2566:HEAD          [03:06:11] Executing: configure
df4c2566:HEAD          [03:06:29] Successfully executed configure
df4c2566:HEAD          [03:06:29] Configuration complete for commit f24fdf985561e7166d7d54459b764daae8efda44.
df4c2566:HEAD          [03:06:29] Executing: make
df4c2566:HEAD          [03:06:37] Successfully executed make
df4c2566:HEAD          [03:06:37] Executing: makeinstall
df4c2566:HEAD          [03:06:41] Successfully executed makeinstall
df4c2566:HEAD          [03:06:41] Generating ABIDW XML for commit f24fdf985561e7166d7d54459b764daae8efda44 in PGBuild::Modules::ABICompCheck
df4c2566:HEAD          [03:06:41] Executing: abidw --out-file "/home/pgbuildfarm/client-code/buildroot/abicheck.df4c2566/xmls/f24fdf985561e7166d7d54459b764daae8efda44/postgres.abi" "/home/pgbuildfarm/client-code/buildroot/abicheck.df4c2566/install/bin/postgres" --drop-undefined-syms --no-architecture --no-comp-dir-path --no-elf-needed --no-show-locs --type-id-style hash
df4c2566:HEAD          [03:06:55] Successfully generated ABI XML for postgres to /home/pgbuildfarm/client-code/buildroot/abicheck.df4c2566/xmls/f24fdf985561e7166d7d54459b764daae8efda44/postgres.abi
df4c2566:HEAD          [03:06:55] Executing: abidw --out-file "/home/pgbuildfarm/client-code/buildroot/abicheck.df4c2566/xmls/f24fdf985561e7166d7d54459b764daae8efda44/ecpg.abi" "/home/pgbuildfarm/client-code/buildroot/abicheck.df4c2566/install/bin/ecpg" --drop-undefined-syms --no-architecture --no-comp-dir-path --no-elf-needed --no-show-locs --type-id-style hash
df4c2566:HEAD          [03:06:55] Successfully generated ABI XML for ecpg to /home/pgbuildfarm/client-code/buildroot/abicheck.df4c2566/xmls/f24fdf985561e7166d7d54459b764daae8efda44/ecpg.abi
df4c2566:HEAD          [03:06:55] Executing: abidw --out-file "/home/pgbuildfarm/client-code/buildroot/abicheck.df4c2566/xmls/f24fdf985561e7166d7d54459b764daae8efda44/libpq.so.abi" "/home/pgbuildfarm/client-code/buildroot/abicheck.df4c2566/install/lib/libpq.so" --drop-undefined-syms --no-architecture --no-comp-dir-path --no-elf-needed --no-show-locs --type-id-style hash
df4c2566:HEAD          [03:06:55] Successfully generated ABI XML for libpq.so to /home/pgbuildfarm/client-code/buildroot/abicheck.df4c2566/xmls/f24fdf985561e7166d7d54459b764daae8efda44/libpq.so.abi
df4c2566:HEAD          [03:06:55] OK
Branch: HEAD
All stages succeeded

Copy link

@theory theory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally made a careful read and made some suggestions. Seems like the basic functionality is fine, though we may want to do some refactoring later. In fact, I think it would be nice to factor a bunch of the configure and make code from run_build.pl into a module that could then be called from here, so that the ABI Check gets the benefit of the full configuration (e.g., builds with libxml, LDAP, ICU, Perl, Python, etc.).

After a run, I see this directory layout:

.
|-- diffs
|   |-- ecpg-fe07100e82b096d3c848cace790d4b4daf0c4131-9ca30a0b04d751c58d4efa0a2b3073cb285b1bd2.log
|   `-- postgres-fe07100e82b096d3c848cace790d4b4daf0c4131-9ca30a0b04d751c58d4efa0a2b3073cb285b1bd2.log
|-- githead.log
|-- logs
|   |-- 9ca30a0b04d751c58d4efa0a2b3073cb285b1bd2
|   |   |-- configure.log
|   |   |-- make.log
|   |   `-- makeinstall.log
|   `-- fe07100e82b096d3c848cace790d4b4daf0c4131
|       |-- configure.log
|       |-- make.log
|       `-- makeinstall.log
`-- xmls
    |-- 9ca30a0b04d751c58d4efa0a2b3073cb285b1bd2
    |   |-- ecpg.abi
    |   |-- libpq.so.abi
    |   `-- postgres.abi
    `-- fe07100e82b096d3c848cace790d4b4daf0c4131
        |-- ecpg.abi
        |-- libpq.so.abi
        `-- postgres.abi

Which of those files do you plan to upload to the server?

@MankiratSingh1315
Copy link
Author

Which of those files do you plan to upload to the server?

As Peter said here "no news is good news" I do think we can just send the diffs outputs if there are any to the server. Sending the XML files will only increase the payload I believe. If there will be some issue in configure make and build, in that case I think the run build script is itself responsible report the error...

@MankiratSingh1315 MankiratSingh1315 marked this pull request as ready for review August 10, 2025 11:34
return;
}

sub configure
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure seems like there's a lot of code here duped from elsewhere. Is it all from run_build.pl? I wonder if it should be put into a module.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was also thinking the same but left these here currently as no other modules needed them as of now and also just for some convenience 😅

designed to perform Application Binary Interface (ABI) compliance checking
for PostgreSQL builds using libabigail tools abidiff and abidw.

The module helps detect unintended ABI changes in stable branches
by comparing the latest commit against the most recent tag on that branch.
This is crucial for maintaining compatibility
for the PostgreSQL ABI stability guidelines for minor releases.
Copy link

@theory theory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few minor nits. Looks great thank you!

# Ensure debug information is available in compilation - required for libabigail tools
if ($conf->{using_meson})
{
# not working, can't understand why
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be worth to ask on the list.

theory and others added 2 commits September 3, 2025 11:27
Plus one little punctuation fix.
…pdate variable name for better code understanding
@theory
Copy link

theory commented Nov 1, 2025

only work on presence of .abi-compliance-history file, update docs, u…

Awesome, thank you, I've added this to baza.

When `rm_worktree` is enabled in animal config, the source directory is cleaned after the
run, causing `.abi-compliance-history` to be missing in subsequent runs as setup runs before source checkout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants