RPM macro is_opensuse is not set on OBS-worker

Hi!

I have an OBS-setup with the OBS-server 2.10.29 on a hosted (not applicance) Leap15 server and I have an OBS-worker server , also hosted, with Leap16.0 and the OBS-worker packages installed on that worker-server (obs-common + obs-worker). The worker-server on Leap16 uses KVM to build the packages.

Here is my problem:

In a spec-file i have this %if-construction

%if 0%{?suse_version} >= 1600 && 0%{?is_opensuse}
%define __pycmd /usr/bin/python3.13
%else
%define __pycmd /usr/bin/python3.11
%endif

This is according to doc how to identify if You are on leap16 and opensuse (but i acknowledge that checking suse_version >= 160000 should be enough !?)

But, when the worker who is on leap 16 and builds for Leap 16, will not evaluate the above to true. It turns out that it is the ā€œis_opensuseā€ that is not set to 1. Here is a debug output from the worker:

 29s] suse_version:
[   29s] 1600
[   29s] is_opensuse:
[   29s] %{is_opensuse}

Here we see that macro is_opensuse is NOT DEFINED.

I wonder why its not, becasue the open build service should install all the needed rpm-packages so is_opensuse is set ?

As a reference, I have another Leap16 machine installed that I uses for tracking down this issue.

root@machine:/usr# cat /etc/rpm/macros.leap
#
# RPM macros to identify Leap distribution
#
#==================================================

%is_opensuse 1

And this file belongs to package: Leap-release-16.0+leap-lp160.263.1.x86_64

I listed all installed packages in the KVM-worker build during the build-process, and here is the list of all packages:

[   29s] installed packages
[   29s] system-user-root-20190513-160000.2.2.noarch
[   29s] terminfo-base-6.5.20250531-160000.3.1.x86_64
[   29s] pkgconf-m4-2.2.0-160000.2.2.noarch
[   29s] libsemanage-conf-3.8.1-160000.3.1.x86_64
[   29s] file-magic-5.46-160000.2.2.noarch
[   29s] crypto-policies-20250714.cd6043a-160000.2.1.noarch
[   29s] compat-usrmerge-tools-84.87-160000.2.2.x86_64
[   29s] filesystem-84.87-160000.2.2.x86_64
[   29s] glibc-2.40-160000.6.1.x86_64
[   29s] libz1-1.2.13-160000.3.1.x86_64
[   29s] libgcc_s1-15.3.0+git11272-160000.1.1.x86_64
[   29s] libstdc++6-15.3.0+git11272-160000.1.1.x86_64
[   29s] libzstd1-1.5.7-160000.2.2.x86_64
[   29s] libgmp10-6.3.0-160000.2.2.x86_64
[   29s] libbz2-1-1.0.8-160000.2.2.x86_64
[   29s] libelf1-0.192-160000.3.1.x86_64
[   29s] libacl1-2.3.2-160000.2.2.x86_64
[   29s] liblzma5-5.8.1-160000.3.1.x86_64
[   29s] libmpfr6-4.2.1-160000.2.2.x86_64
[   29s] libcrypt1-4.4.38-160000.3.2.x86_64
[   29s] perl-base-5.42.0-160000.3.1.x86_64
[   29s] libaudit1-4.0-160000.2.2.x86_64
[   29s] libmpc3-1.3.1-160000.3.2.x86_64
[   29s] libdw1-0.192-160000.3.1.x86_64
[   29s] libisl23-0.26-160000.2.2.x86_64
[   29s] fillup-1.42-160000.2.2.x86_64
[   29s] libcap2-2.73-160000.3.1.x86_64
[   29s] libeconf0-0.7.9-160000.2.2.x86_64
[   29s] libgomp1-15.3.0+git11272-160000.1.1.x86_64
[   29s] libblkid1-2.41.1-160000.4.1.x86_64
[   29s] libattr1-2.5.2-160000.2.2.x86_64
[   29s] liblua5_4-5-5.4.7-160000.2.2.x86_64
[   29s] libpopt0-1.19-160000.2.2.x86_64
[   29s] libuuid1-2.41.1-160000.4.1.x86_64
[   29s] libncurses6-6.5.20250531-160000.3.1.x86_64
[   29s] libreadline8-8.2.13-160000.2.2.x86_64
[   29s] bash-5.2.37-160000.2.2.x86_64
[   29s] bash-sh-5.2.37-160000.2.2.noarch
[   29s] xz-5.8.1-160000.3.1.x86_64
[   29s] cpio-2.15-160000.2.2.x86_64
[   29s] gawk-5.3.2-160000.3.1.x86_64
[   29s] permctl-1699_20250120-160000.2.2.x86_64
[   29s] cpp13-13.4.0+git9739-160000.2.2.x86_64
[   29s] dwz-0.15-160000.2.2.x86_64
[   29s] libasan8-15.3.0+git11272-160000.1.1.x86_64
[   29s] libhwasan0-15.3.0+git11272-160000.1.1.x86_64
[   29s] liblsan0-15.3.0+git11272-160000.1.1.x86_64
[   29s] libtsan2-15.3.0+git11272-160000.1.1.x86_64
[   29s] libubsan1-15.3.0+git11272-160000.1.1.x86_64
[   29s] diffutils-3.12-160000.2.2.x86_64
[   29s] glibc-locale-base-2.40-160000.6.1.x86_64
[   29s] libatomic1-15.3.0+git11272-160000.1.1.x86_64
[   29s] libgdbm6-1.24-160000.2.2.x86_64
[   29s] libitm1-15.3.0+git11272-160000.1.1.x86_64
[   29s] libjitterentropy3-3.6.3-160000.2.2.x86_64
[   29s] libpcre2-8-0-10.45-160000.3.1.x86_64
[   29s] libselinux1-3.8.1-160000.4.1.x86_64
[   29s] coreutils-9.6-160000.2.2.x86_64
[   29s] sed-4.9-160000.3.1.x86_64
[   29s] grep-3.11-160000.2.2.x86_64
[   29s] findutils-4.10.0-160000.2.2.x86_64
[   29s] libopenssl3-3.5.0-160000.9.1.x86_64
[   29s] libyaml-0-2-0.2.5-160000.3.2.x86_64
[   29s] update-alternatives-1.22.21-160000.3.1.x86_64
[   29s] lua54-5.4.7-160000.2.2.x86_64
[   29s] systemd-rpm-macros-26-160000.2.2.noarch
[   29s] linux-glibc-devel-6.12-160000.3.1.x86_64
[   29s] permissions-config-1699_20250120-160000.2.2.noarch
[   29s] permissions-1699_20250120-160000.2.2.x86_64
[   29s] pam-1.7.1-160000.5.1.x86_64
[   29s] polkit-default-privs-1550+20260709.b1b58aa-160000.1.1.noarch
[   29s] libmount1-2.41.1-160000.4.1.x86_64
[   29s] libsubid5-4.17.2-160000.2.2.x86_64
[   29s] tar-1.35-160000.4.1.x86_64
[   29s] libgdbm_compat4-1.24-160000.2.2.x86_64
[   29s] perl-5.42.0-160000.3.1.x86_64
[   29s] perl-rpm-packaging-1.2-160000.2.2.noarch
[   29s] cpp-build-13-160000.2.2.x86_64
[   29s] login_defs-4.17.2-160000.2.2.noarch
[   29s] gzip-1.13-160000.3.1.x86_64
[   29s] make-4.4.1-160000.3.2.x86_64
[   29s] bzip2-1.0.8-160000.2.2.x86_64
[   29s] ncurses-utils-6.5.20250531-160000.3.1.x86_64
[   29s] libfdisk1-2.41.1-160000.4.1.x86_64
[   29s] cpp15-15.3.0+git11272-160000.1.1.x86_64
[   29s] libasm1-0.192-160000.3.1.x86_64
[   29s] elfutils-0.192-160000.3.1.x86_64
[   29s] libxml2-2-2.13.8-160000.5.1.x86_64
[   29s] libctf-nobfd0-2.45-160000.3.1.x86_64
[   29s] envsubst-mini-0.22.5-160000.2.2.x86_64
[   29s] gettext-runtime-mini-0.22.5-160000.2.2.x86_64
[   29s] glibc-gconv-modules-extra-2.40-160000.6.1.x86_64
[   29s] gettext-tools-mini-0.22.5-160000.2.2.x86_64
[   29s] libcap-ng0-0.8.5-160000.3.2.x86_64
[   29s] libexpat1-2.7.1-160000.5.1.x86_64
[   29s] libffi8-3.4.6-160000.2.2.x86_64
[   29s] libgpg-error0-1.58-160000.1.1.x86_64
[   29s] libgcrypt20-1.12.1-160000.3.1.x86_64
[   29s] rpm-config-SUSE-20250328-160000.2.2.noarch
[   29s] rpm-4.20.1-160000.2.2.x86_64
[   29s] liblz1-1.15-160000.2.2.x86_64
[   29s] libmagic1-5.46-160000.2.2.x86_64
[   29s] librpmbuild10-4.20.1-160000.2.2.x86_64
[   29s] liblz4-1-1.10.0-160000.3.1.x86_64
[   29s] libarchive13-3.8.1-160000.3.1.x86_64
[   29s] libmpdec4-4.0.1-160000.2.2.x86_64
[   29s] python313-base-3.13.14-160000.1.1.x86_64
[   29s] libpython3_13-1_0-3.13.14-160000.1.1.x86_64
[   29s] python313-six-1.17.0-160000.2.2.noarch
[   29s] python313-python-dateutil-2.9.0.post0-160000.2.2.noarch
[   29s] python313-PyYAML-6.0.2-160000.2.2.x86_64
[   29s] obs-service-obs_scm-common-0.10.46-160000.2.2.noarch
[   29s] libpkgconf5-2.2.0-160000.2.2.x86_64
[   29s] pkgconf-2.2.0-160000.2.2.x86_64
[   29s] pkgconf-pkg-config-2.2.0-160000.2.2.x86_64
[   29s] libxcrypt-devel-4.4.38-160000.3.2.x86_64
[   29s] glibc-devel-2.40-160000.6.1.x86_64
[   29s] libseccomp2-2.6.0-160000.2.2.x86_64
[   29s] file-5.46-160000.2.2.x86_64
[   29s] libsepol2-3.8.1-160000.2.2.x86_64
[   29s] libsemanage2-3.8.1-160000.3.1.x86_64
[   29s] shadow-4.17.2-160000.2.2.x86_64
[   29s] libsframe2-2.45-160000.3.1.x86_64
[   29s] libctf0-2.45-160000.3.1.x86_64
[   29s] binutils-2.45-160000.3.1.x86_64
[   29s] debugedit-5.0-160000.2.2.x86_64
[   29s] gcc13-13.4.0+git9739-160000.2.2.x86_64
[   29s] gcc-build-13-160000.2.2.x86_64
[   29s] gcc15-15.3.0+git11272-160000.1.1.x86_64
[   29s] gcc15-PIE-15.3.0+git11272-160000.1.1.x86_64
[   29s] libsmartcols1-2.41.1-160000.4.1.x86_64
[   29s] util-linux-2.41.1-160000.4.1.x86_64
[   29s] patch-2.7.6-160000.4.1.x86_64
[   29s] which-2.23-160000.2.2.x86_64
[   29s] rpm-build-4.20.1-160000.2.2.x86_64
[   29s] gcc-PIE-15-160000.2.2.x86_64
[   29s] fujitsu-environment-2.1.0.0~g08ecf14-lp160.8.1.noarch
[   29s] build-compare-20240801T083050.024a3a7-160000.2.2.noarch
[   29s] libyaml-devel-0.2.5-160000.3.2.x86_64
[   29s] obs-service-tar-0.10.46-160000.2.2.noarch
[   29s] obs-service-set_version-0.6.6-160000.3.2.noarch
[   29s] aaa_base-84.87+git20260610.3b5a868c-160000.1.1.x86_64
[   29s] brp-check-suse-84.87+git20230324.8680ce4-160000.2.2.x86_64
[   29s] rpmlint-mini-2.7.0+git20260415.44ca4797-160000.2.3.x86_64
[   29s] compat-usrmerge-build-84.87-160000.2.2.x86_64
[   29s] attr-2.5.2-160000.2.2.x86_64
[   29s] build-mkbaselibs-20260415-160000.1.1.noarch
[   29s] fdupes-2.3.1-160000.2.2.x86_64
[   29s] libdb-4_8-4.8.30-160000.3.1.x86_64
[   29s] python-rpm-macros-20260629.bcd36db-160000.1.1.noarch
[   29s] kernel-obs-build-6.12.0-160000.36.1.x86_64

As can be seen, the package Leap-release-16.0+leap-lp160.263.1.x86_64 is not installed in the worker-KVM.

Can anybody shine some light on this ?

Shall I include this package in the prjConf in the OBS-project maybe ?

Regards, Oskar Ahner

Is ā€œis_opensuseā€ macro defined in another way, implicit by OBS ?

Your macro is not listed in the wiki.
Yours:

According cross distribution wiki:
%if 0%{?suse_version} == 1600 && 0%{?is_opensuse}

Not sure if the wiki is 100% complete but i would try the >= == change.

https://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto

%is_opensuse is defined in prjconf on OBS

1 Like

Yes, I did this in the OBS-project config:

Required: Leap-release-16.0+leap

Now ā€œis_opensuseā€ is set.

Many thansk for all replies !

Regards, Oskar Ahner