OSInside / kiwi

KIWI - Appliance Builder Next Generation
https://osinside.github.io/kiwi
GNU General Public License v3.0
301 stars 152 forks source link

the dependency solver doesn't work like zypper #1142

Closed JanZerebecki closed 5 years ago

JanZerebecki commented 5 years ago

Problem 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.

Expected behaviour

Build doesn't fail in these cases.

Steps to reproduce the behaviour

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"/>.

OS and Software information

schaefi commented 5 years ago

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

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

You are not the first one who stumbled over that issue. From a kiwi perspective I can only tell you that you need to explicitly list the packages that gets pulled in by file provides.

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 ?

Thanks