Skip to content

Add support for comparing deb packages#68

Open
bluca wants to merge 2 commits into
openSUSE:masterfrom
bluca:deb
Open

Add support for comparing deb packages#68
bluca wants to merge 2 commits into
openSUSE:masterfrom
bluca:deb

Conversation

@bluca
Copy link
Copy Markdown

@bluca bluca commented May 13, 2026

Follow the same pattern as the comparison for rpm packages, and exclude metadata that is expected to change, eg: installed size
and version. The same-build-result script detects both rpms and debs and compares whatever it finds.

Add some unit tests to cover the new feature, and debian packaging, as the comparison runs in the build root on OBS so native packaging is required too.

@bluca
Copy link
Copy Markdown
Author

bluca commented May 13, 2026

Tested with the obs-build changes from https://github.com/bluca/obs-build/commits/build_compare_deb/ on a local OBS VM, seems to work as expected

@bluca bluca force-pushed the deb branch 3 times, most recently from fdac174 to 70ff84e Compare May 13, 2026 23:01
@olafhering
Copy link
Copy Markdown
Collaborator

What is the usecase of normalize_binary_version? Usually it is wrong to pass the rpm equivalent of %version-%release to the build, simply because the content of %release can not be stable. In OBS it usually contains the build counter B_CNT. There are very few cases where it is useful, like the rpm scriptlets. If they are placed properly, build-compare can detect and remove those special cases.

@bluca
Copy link
Copy Markdown
Author

bluca commented May 15, 2026

One of the packages I was testing this with in my OBS VM, openconnect, did end up with the build revision in its --version, hence why I added this. It seems not uncommon to me, e.g.:

$ systemctl --version
systemd 261 (260.999+1413+gb7be9ccc8)
+PAM +AUDIT +SELINUX +APPARMOR +IMA +IPE +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 +KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK +BTF -XKBCOMMON -UTMP +LIBARCHIVE

@bluca
Copy link
Copy Markdown
Author

bluca commented May 15, 2026

openconnect package to reproduce it:

https://build.opensuse.org/projects/network:vpn:openconnect/packages/openconnect/repositories/Debian_Testing/binaries/x86_64/openconnect_9.12+265+ga7e7514-0+1.2_amd64.deb

Without normalizing the elf, a "trigger build" that is otherwise identical ends up being different and being replaced solely due to the revision being in the elf.

$ openconnect --version
OpenConnect version v9.12+265+ga7e7514-0+291.24
Using GnuTLS 3.8.9. Features present: TPMv2, PKCS#11, RSA software token, HOTP software token, TOTP software token, Yubikey OATH, System keys, DTLS, ESP
Supported protocols: anyconnect (default), nc, gp, pulse, f5, fortinet, array
Default vpnc-script (override with --script): /usr/share/vpnc-scripts/vpnc-script

@olafhering
Copy link
Copy Markdown
Collaborator

As of now, the %version is 9.12+265+ga7e7514. But the Debian converter turns that into v9.12+265+ga7e7514-0+1.2. Later some other thing inserts it into the source files:

sed -i -e 's|".*"|"v9.12+265+ga7e7514-0+1.2"|' version.c

To me this looks like a deficit in the Debian build system, 0+1.2 should not be there. It may work by luck in single-shot build-environments without dependency tracking, but certainly not in any OBS instance.

bluca added 2 commits May 15, 2026 17:05
Follow the same pattern as the comparison for rpm packages,
and exclude metadata that is expected to change, eg: installed size
and version. The same-build-result script detects both rpms and debs
and compares whatever it finds.

Add some unit tests to cover the new feature.
The build comparison runs in the build root on OBS, so we need native
packaging for deb too in order to support comparing them.
@bluca
Copy link
Copy Markdown
Author

bluca commented May 15, 2026

Ok I've dropped that change now

@bluca
Copy link
Copy Markdown
Author

bluca commented May 19, 2026

@olafhering anything else you'd like me to change here? Thanks

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.

2 participants