openSUSE / obs-build

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

mkosi build type is missing system-packages:mkosi:rpm during expansion #1033

Closed Vogtinator closed 1 month ago

Vogtinator commented 1 month ago

https://build.opensuse.org/project/show/home:favogt:mkosi has

%if "%_repository" == "mkosi"
Type: mkosi
Repotype: checksumsfile
%endif

#Conflict: gettext-tools-mini

Substitute: system-packages:mkosi:rpm mkosi rpm createrepo kmod zstd
Substitute: build-packages:mkosi:rpm !cmake-mini !dummy-release !gettext-runtime-mini !gettext-tools-mini !ghostscript-mini !ffmpeg-5-mini-libs !ffmpeg-6-mini-libs !ffmpeg-7-mini-libs !gio-branding-upstream !krb5-mini !krb5-mini-devel !libsystemd0-mini !systemd-mini-container !libudev-mini-devel !libudev-mini1 !libuna-mini-devel !libuna1-mini !libunbound-devel-mini !log4j12-mini !postgresql17-devel-mini !systemd-mini !systemd-mini-devel !systemd-mini-sysvinit !udev-mini !libpxbackend-1_0-mini !libgarcon-branding-upstream

i.e. when resolving the dependencies for image packages, it must not pick any of the listed *-mini packages. However, the substitute has no effect:

<error>unresolvable: conflict for providers of gettext-runtime-mini = 0.22.5 needed by gettext-tools-mini, (provider gettext-runtime-mini is in conflict with patterns-microos-base)</error>

osc buildinfo -d shows that it's not considered as part of expand args:

expand args: rpm
expand args: bash bash-sh compat-usrmerge-tools coreutils filesystem fillup glibc libacl1 libattr1 libbz2-1 libcap2 libgcc_s1 libgcrypt20 libgmp10 libgpg-error0 libjitterentropy3 liblua5_4-5 liblzma5 libncurses6 libpcre2-8-0 libpopt0 libreadline8 libselinux1 libstdc++6 libz1 libzstd1 rpm rpm-config-SUSE system-user-root terminfo-base perl-base util-linux grep kernel-obs-build
expand args: MicroOS-release MicroOS-release-appliance patterns-microos-basesystem rpm-build gcc-PIE
mlschroe commented 1 month ago

That's actually a problem in the OBS code, not in obs-build. It should not call the "get_deps" method at all, but use "get_build" instead. This happens because the "mkosi" built type has no specific build code handler but falls back to the handler user for package builds.

I've now added a new "Image" handler that will be used for the mkosi/appimage/simpleimage/livebuild build types: https://github.com/openSUSE/open-build-service/pull/16947