openSUSE / open-build-service

Build and distribute Linux packages from sources in an automatic, consistent and reproducible way #obs
https://openbuildservice.org
GNU General Public License v2.0
919 stars 437 forks source link

the dependency solver with KIWI doesn't work like zypper #7943

Open JanZerebecki opened 5 years ago

JanZerebecki commented 5 years ago

Issue Description

When using a KIWI file in OBS with dependencies there are two cases I noticed that don't work like they would with zypper.

When a package depends on foo and there is a package bar that provides foo and depends on a package that is not available, it may happen to select bar and fail to find a solution.

When a package depends on a file, the package that provides it is not selected so during installation of requirements the build fails.

In https://github.com/OSInside/kiwi/issues/1142#issuecomment-512705303 @schaefi said:

You are completely right but we can't change this behavior in the kiwi project. The buildservice does the following before it calls kiwi:

  1. It takes the package list from the kiwi XML and runs its own satsolver based solver operation. This operation as you already found out does not take file provides into account as it would be the case if zypper would have done that resolver operation

  2. obs now takes the resolved list of packages and creates temporary repositories inside of the obs worker (usually a VM or bare metal) that was selected to build your image.

  3. obs now calls kiwi. The obs:// repotype used in the kiwi XML is resolved to point to that temporary created repos if the build happens in obs. That repos could now missing some packages and when kiwi calls zypper it will find out something is missing and the build fails

I'm afraid but a fix to this problem can only happen in the obs project and code, maybe you open an issue there and discuss this with the obs people ?

Does this also happen for RPMs / spec files and I just didn't notice?

Expected Result

Build doesn't fail in these cases.

How to Reproduce

Branch https://build.opensuse.org/package/show/openSUSE:Leap:15.1:Images/opensuse-leap-image and add a few required packages:

  <packages type="image">
    <package name="ca-certificates"/>
    <package name="ca-certificates-mozilla"/>
    <package name="coreutils"/>
    <package name="openSUSE-build-key"/>
    <package name="krb5"/>
    <package name="kubic-locale-archive"/>
    <package name="tar"/>
    <package name="gzip"/>
    <package name="which"/>
    <package name="unzip"/>
    <package name="python3"/>
    <package name="python3-devel"/>
    <package name="python3-virtualenv"/>
    <package name="ca-certificates"/>
    <package name="git-core"/>
    <package name="lsb-release"/>
    <package name="patch"/>
    <package name="sudo"/>
    <package name="tar"/>
    <package name="python3"/>
    <package name="python3-devel"/>
    <package name="python3-virtualenv"/>
    <package name="ca-certificates"/>
    <package name="git-core"/>
    <package name="lsb-release"/>
    <package name="patch"/>
    <package name="sudo"/>
    <package name="tar"/>
    <package name="apache2-mod_wsgi-python3"/>
    <package name="blas-devel"/>
    <package name="bzip2"/>
    <package name="cyrus-sasl-devel"/>
    <package name="gcc"/>
    <package name="gcc-c++"/>
    <package name="git"/>
    <package name="krb5-devel"/>
    <package name="lapack-devel"/>
    <package name="liberasurecode-devel"/>
    <package name="libffi-devel"/>
    <package name="libgcrypt-devel"/>
    <package name="libgcrypt20"/>
    <package name="libjpeg8-devel"/>
    <package name="libmariadb-devel"/>
    <package name="libvirt-devel"/>
    <package name="libxml2"/>
    <package name="libxml2-devel"/>
    <package name="libxslt-devel"/>
    <package name="libyaml-devel"/>
    <package name="libzip-devel"/>
    <package name="make"/>
    <package name="mozilla-nss-devel"/>
    <package name="openldap2-devel"/>
    <package name="pcre-devel"/>
    <package name="pkg-config"/>
    <package name="postgresql-devel"/>
    <package name="python3-devel"/>
    <package name="python3-testsuite"/>
    <package name="systemd-devel"/>
    <package name="zlib-devel"/>
    <package name="live-add-yast-repos"/>
  </packages>

This fails to even start the build as libvirt-devel pulls in libunbound-devel-mini which on purpose has a non-existing requirement. To fix this add: <package name="libunbound2"/>.

Then the build fails as something from the above requires ncurses-devel which requires /usr/bin/tack which somehow is not picked up as a dependency. To fix that add <package name="tack"/>.

Further Information

dcermak commented 4 years ago

You should be able to work around this issue by adding the following to your prjconf:

Preinstall: tack
Prefer: libunbound2

That's of course not a proper solution and just hides the actual problem.