Skip to content

Commit 54dadc3

Browse files
committed
fix(build): suppress debuginfo extraction in RPM spec files
The Linuxfabrik monitoring plugins RPM used to fail to install on hosts that already had another RPM which shipped ELF binaries built against the same upstream source - azure-cli being the reported case, with the error Error: Transaction test error: file /usr/lib/.build-id/83/402b2ade... from install of linuxfabrik-monitoring-plugins conflicts with file from package azure-cli Root cause: the spec files never set `%global debug_package %{nil}`, so rpmbuild's default debuginfo extraction kicked in, walked every `.so` in the bundled Python venv and installed a `/usr/lib/.build-id/XX/YY...` symlink for each one into the *main* package. The build-id hash is derived from the ELF file's content, and two independent RPMs can legitimately produce the same hash for the same upstream library - at which point dnf refuses the install with a file conflict. Fix: add `%global debug_package %{nil}` at the top of both the EL and SLE spec files. This disables the automatic debuginfo package generation, so no build-id symlinks are produced and the main package only contains the plugin scripts, the sudoers file and the venv. We don't ship a `-debuginfo` subpackage anyway, so there is nothing else lost by this change. Closes #979
1 parent 7ae4cab commit 54dadc3

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ Tools:
126126

127127
Build, CI/CD:
128128

129+
* RPM: `dnf install linuxfabrik-monitoring-plugins` no longer fails with a "conflicts with file from package azure-cli" (or any other package that ships a copy of libpython). The RPM used to install ELF build-id symlinks under `/usr/lib/.build-id/` into the main package, which collide file-for-file with similar symlinks shipped by other RPMs. Suppress the automatic debuginfo extraction in the spec files so those symlinks stay out of the main package ([#979](https://github.com/Linuxfabrik/monitoring-plugins/issues/979))
129130
* requirements.txt: add missing `setuptools` dependency (required by `pbr`)
130131

131132

build/linuxfabrik-monitoring-plugins.el.spec

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ URL: https://github.com/Linuxfabrik/monitoring-plugins
77
Vendor: Linuxfabrik GmbH, Zurich, Switzerland
88
Packager: info@linuxfabrik.ch
99

10+
# Suppress the automatic debuginfo extraction. RPM would otherwise
11+
# install /usr/lib/.build-id/XX/YY... ELF build-id symlinks for every
12+
# shared object in the bundled venv into the main package, which can
13+
# collide file-for-file with other RPMs that happen to ship binaries
14+
# built from the same upstream source (e.g. azure-cli shipping its own
15+
# copy of libpython). See issue #979.
16+
%global debug_package %{nil}
17+
1018
Source0: https://github.com/Linuxfabrik/monitoring-plugins/archive/refs/tags/v%{version}.tar.gz
1119
Source1: vendor.tar.gz
1220

build/linuxfabrik-monitoring-plugins.sle.spec

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ URL: https://github.com/Linuxfabrik/monitoring-plugins
77
Vendor: Linuxfabrik GmbH, Zurich, Switzerland
88
Packager: info@linuxfabrik.ch
99

10+
# Suppress the automatic debuginfo extraction. RPM would otherwise
11+
# install /usr/lib/.build-id/XX/YY... ELF build-id symlinks for every
12+
# shared object in the bundled venv into the main package, which can
13+
# collide file-for-file with other RPMs that happen to ship binaries
14+
# built from the same upstream source (e.g. azure-cli shipping its own
15+
# copy of libpython). See issue #979.
16+
%global debug_package %{nil}
17+
1018
Source0: https://github.com/Linuxfabrik/monitoring-plugins/archive/refs/tags/v%{version}.tar.gz
1119
Source1: vendor.tar.gz
1220

0 commit comments

Comments
 (0)