openSUSE / obs-build

OBS build script, can be used with OBS or stand alone
GNU General Public License v2.0
132 stars 183 forks source link

pbuild fails to build a container image with rpm-ndb #885

Closed dcermak closed 1 year ago

dcermak commented 1 year ago

I have been trying to build the whole BCI project with pbuild, which causes issues with images that require rpm-ndb explicitly. Without any special settings, I just get the info from pbuild:

unresolvable: 3
    minimal-sp4 (rpm-ndb conflicts with rpm)

When I add an explicit Substitute: rpm rpm-ndb to _config, then the image starts building, but the builds all fail with a huge file conflict:

[   22s] now installing cumulated packages
[   22s] Preparing...                          ########################################
[   22s]        file /usr/bin/rpm conflicts between attempted installs of rpm-ndb-4.14.3-150300.49.1.x86_64 and rpm-4.14.3-150300.49.1.x86_64
[   22s]        file /usr/bin/rpm2cpio conflicts between attempted installs of rpm-ndb-4.14.3-150300.49.1.x86_64 and rpm-4.14.3-150300.49.1.x86_64
[   22s]        file /usr/bin/rpmdb conflicts between attempted installs of rpm-ndb-4.14.3-150300.49.1.x86_64 and rpm-4.14.3-150300.49.1.x86_64
[   22s]        file /usr/bin/rpmgraph conflicts between attempted installs of rpm-ndb-4.14.3-150300.49.1.x86_64 and rpm-4.14.3-150300.49.1.x86_64
[   22s]        file /usr/bin/rpmkeys conflicts between attempted installs of rpm-ndb-4.14.3-150300.49.1.x86_64 and rpm-4.14.3-150300.49.1.x86_64
[   22s]        file /usr/bin/rpmqpack conflicts between attempted installs of rpm-ndb-4.14.3-150300.49.1.x86_64 and rpm-4.14.3-150300.49.1.x86_64
[   22s]        file /usr/bin/rpmsign conflicts between attempted installs of rpm-ndb-4.14.3-150300.49.1.x86_64 and rpm-4.14.3-150300.49.1.x86_64
[   22s]        file /usr/bin/rpmspec conflicts between attempted installs of rpm-ndb-4.14.3-150300.49.1.x86_64 and rpm-4.14.3-150300.49.1.x86_64
[   22s]        file /usr/lib/rpm/debugedit conflicts between attempted installs of rpm-ndb-4.14.3-150300.49.1.x86_64 and rpm-4.14.3-150300.49.1.x86_64
[   22s]        file /usr/lib/rpm/elfdeps conflicts between attempted installs of rpm-ndb-4.14.3-150300.49.1.x86_64 and rpm-4.14.3-150300.49.1.x86_64
[   22s]        file /usr/lib/rpm/macros conflicts between attempted installs of rpm-ndb-4.14.3-150300.49.1.x86_64 and rpm-4.14.3-150300.49.1.x86_64
[   22s]        file /usr/lib/rpm/rpmdeps conflicts between attempted installs of rpm-ndb-4.14.3-150300.49.1.x86_64 and rpm-4.14.3-150300.49.1.x86_64
[   22s]        file /usr/lib/rpm/sepdebugcrcfix conflicts between attempted installs of rpm-ndb-4.14.3-150300.49.1.x86_64 and rpm-4.14.3-150300.49.1.x86_64
[   22s]        file /usr/lib64/librpm.so.8.2.0 conflicts between attempted installs of rpm-ndb-4.14.3-150300.49.1.x86_64 and rpm-4.14.3-150300.49.1.x86_64
[   22s]        file /usr/lib64/librpmbuild.so.8.2.0 conflicts between attempted installs of rpm-ndb-4.14.3-150300.49.1.x86_64 and rpm-4.14.3-150300.49.1.x86_64
[   22s]        file /usr/lib64/librpmio.so.8.2.0 conflicts between attempted installs of rpm-ndb-4.14.3-150300.49.1.x86_64 and rpm-4.14.3-150300.49.1.x86_64
[   22s]        file /usr/lib64/librpmsign.so.8.2.0 conflicts between attempted installs of rpm-ndb-4.14.3-150300.49.1.x86_64 and rpm-4.14.3-150300.49.1.x86_64
[   22s]        file /usr/lib64/rpm-plugins/ima.so conflicts between attempted installs of rpm-ndb-4.14.3-150300.49.1.x86_64 and rpm-4.14.3-150300.49.1.x86_64
[   22s]        file /usr/lib64/rpm-plugins/prioreset.so conflicts between attempted installs of rpm-ndb-4.14.3-150300.49.1.x86_64 and rpm-4.14.3-150300.49.1.x86_64
[   22s]        file /usr/lib64/rpm-plugins/selinux.so conflicts between attempted installs of rpm-ndb-4.14.3-150300.49.1.x86_64 and rpm-4.14.3-150300.49.1.x86_64
[   22s]        file /usr/lib64/rpm-plugins/syslog.so conflicts between attempted installs of rpm-ndb-4.14.3-150300.49.1.x86_64 and rpm-4.14.3-150300.49.1.x86_64
[   22s] exit ...

Reproducer:

$ git clone https://github.com/SUSE/BCI-dockerfile-generator
$ git checkout pbuild-build-checks
$ poetry install
$ poetry run ./write-build-files.py --os-version 4 /var/tmp/test-sp4
$ cd /var/tmp/test-sp4
$ pbuild --buildjobs 8 --preset sle15.4 --vm-disk-size 8192

and observe that it fails to build minimal-sp4. Appending the aforementioned substitute results in the pasted build failure.

adrianschroeter commented 1 year ago

You need to build with the same _config lines as they are in OBS prjconf. Add these lines to _config should get you a working build

Preinstall: !rpm rpm-ndb Substitute: rpm rpm-ndb Binarytype: rpm

Closing this, because it is more a source configuration problem then a build tooling issue