On Mon, Mar 17, 2025 at 03:01:24PM -0400, Andrea Bolognani wrote:
> Hi,
> 
> attempting to install softhsm on riscv64 currently results in the
> following error:
> 
>   # dnf install -y softhsm
>   ...
>   >>> Running pre-install scriptlet: softhsm-0:2.6.1-11.rvre0.fc42.riscv64
>   >>> Error in pre-install scriptlet: softhsm-0:2.6.1-11.rvre0.fc42.riscv64
>   >>> Scriptlet output:
>   >>> /var/tmp/rpm-tmp.gPQi2A: line 2: fg: no job control
>   >>>
>   >>> [RPM] %prein(softhsm-2.6.1-11.rvre0.fc42.riscv64) scriptlet
> failed, exit status 1
>   Transaction failed: Rpm transaction failed
> 
> I've spent some time investigating this and ultimately tracked it
> down to the fact that apparently the %sysusers_create_package macro
> was not expanded when the riscv64 package was built:
> 
>   # rpm -q --scripts softhsm-2.6.1-11.rvre0.fc42.riscv64.rpm
>   preinstall scriptlet (using /bin/sh):
> 
>   %sysusers_create_package softhsm 
> /builddir/build/SOURCES/softhsm-sysusers.conf
>   postinstall program: /bin/sh
> 
> Compare this to the x86_64 package:
> 
>   # rpm -q --scripts softhsm-2.6.1-11.fc42.x86_64.rpm
>   preinstall scriptlet (using /bin/sh):
> 
>   systemd-sysusers --replace=/usr/lib/sysusers.d/softhsm.conf -
> <<SYSTEMD_INLINE_EOF || :
>   u ods - "opendnssec daemon account"
>   SYSTEMD_INLINE_EOF
>   postinstall program: /bin/sh
> 
> The macro is defined in /usr/lib/rpm/macros.d/macros.systemd, part of
> the systemd-rpm-macros package, and comparing the build logs for the
> two packages sheds some light on the difference:
> 
>   
> http://fedora.riscv.rocks/kojifiles/packages/softhsm/2.6.1/11.rvre0.fc42/data/logs/riscv64/mock_output.log
>   
> https://kojipkgs.fedoraproject.org/packages/softhsm/2.6.1/11.fc42/data/logs/i686/mock_output.log

In the riscv64 build root you have  rpm-libs pulling in
systemd-sysusers-standalone

In the i686 build root you have rpm-libs pulling in systemd,
which pulls in systemd-rpm-macros.

This change is due to new systemd spec which changed some sub-RPMs

The non-riscv64 build will have the same problem next time it is
run with newer systemd that has the refactored systemd RPMs.

> Is it intended that the dependency would be an indirect one? I always
> thought it was good practice to explicitly depend on packages that
> ship the macros your spec file uses, but maybe this case is
> different? Maybe we just need to rebuild some packages in some
> specific order on riscv64 to sort things out?

Yes, any build deps should always be directly listed in the RPM spec.
It is bad practice to rely on indirect deps because of exactly the
scenario you're seeing here.

softhsm should have had a "BuildRequires: systemd-rpm-macros" dep.

Having said that the systemd sysusers macros should be obsolete from
F42 onwards as RPM now has native support for sysusers:

  https://fedoraproject.org/wiki/Changes/RPMSuportForSystemdSysusers

So instead of adding the BuildRequires, you can probably remove the
%sysusers_create_package script usage.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

-- 
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to