Sb2 i486: Executing statically linked native binary

When installing build requirements for i486 Mapnik using SDK for 4.1.0.23 target, I am getting

sb2 -t SailfishOS-4.1.0.23-i486.maps -R zypper -p /home/rinigus/tbuilder-maps/RPMS/SailfishOS-4.1.0.23-i486 in --force-resolution -y --allow-unsigned-rpm "proj-devel"
Retrieving repository 'dir:/home/rinigus/tbuilder-maps/RPMS/SailfishOS-4.1.0.23-i486' metadata [.done]
Building repository 'dir:/home/rinigus/tbuilder-maps/RPMS/SailfishOS-4.1.0.23-i486' cache [....done]
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 2 NEW packages are going to be installed:
  proj proj-devel

2 new packages to install.
Overall download size: 204.8 KiB. Already cached: 964.3 KiB. After the operation, additional 4.4 MiB will be used.
Continue? [y/n/v/...? shows all options] (y): y
In cache proj-4.9.3-1.1.i486.rpm (1/2), 964.3 KiB (  3.5 MiB unpacked)
Retrieving package proj-devel-4.9.3-1.1.i486 (2/2), 204.8 KiB (908.3 KiB unpacked)
    Package is not signed!


Checking for file conflicts: [...done]
(1/2) Installing: proj-4.9.3-1.1.i486 [............done]
Additional rpm output:
/sbin/ldconfig: Can't create temporary cache file /etc/ld.so.cache~: Permission denied
warning: %post(proj-4.9.3-1.1.i486) scriptlet failed, exit status 1
/sbin/ldconfig: Can't create temporary cache file /etc/ld.so.cache~: Permission denied
warning: %triggerin(glibc-common-2.30+git5-1.2.5.jolla.i486) scriptlet failed, exit status 1


(2/2) Installing: proj-devel-4.9.3-1.1.i486 [...........done]
Additional rpm output:
/sbin/ldconfig: Can't create temporary cache file /etc/ld.so.cache~: Permission denied
warning: %triggerin(glibc-common-2.30+git5-1.2.5.jolla.i486) scriptlet failed, exit status 1


Messages from sb2:
 (WARNING)      rpm[1325739/-144099200] Executing statically linked native binary /srv/mer/targets/SailfishOS-4.1.0.23-i486.maps/sbin/ldconfig
 (WARNING)      sh[1325741]     Executing statically linked native binary /srv/mer/targets/SailfishOS-4.1.0.23-i486.maps/sbin/ldconfig
 (WARNING)      sh[1325744]     Executing statically linked native binary /srv/mer/targets/SailfishOS-4.1.0.23-i486.maps/sbin/ldconfig
# exit 107 (107)

aarch64/armv7hl are building just fine. Looks like some sb2 issue.

Try invoking ldconfig without path https://github.com/rinigus/pkg-mapnik/blob/master/rpm/mapnik.spec#L78

%post -n mapnik -p ldconfig

%postun -n mapnik -p ldconfig

This is because in case of i486 arch sb2 provides a ldconfig wrapper on PATH.

PS: It would be convenient to have a link to publicly available sources mentioned in case of questions like this :slight_smile:

Only now I realized the issue with invoking ldconfig using absolute path was fixed long time ago and the actual issue in your case is the way you invoke sb2: you forgot the -m sdk-install option. It is invalid (result undefined) to modify the target with the sdk-build mode (the default one).

Prefer using sdk-assistant maintain <target> <command> ... for executing maintenance commands under the toolings and targets. The equivalent with sfdk is sfdk tools exec <target> <command> ...

Similarly [sfdk|mb2] build-shell <command> ... can be used to run arbitrary build commands under the configured sb2 target.

These commands take care of passing the right options to sb2 and they may also do more to avoid some common pitfalls with direct sb2 usage.

Summary:

  • Forget about sb2 command existence
  • Use sfdk build-shell to execute arbitrary build commands
    • Platform SDK equivalent: mb2 build-shell
  • Use sfdk tools exec to execute arbitrary maintenance commands
    • Platform SDK equivalent: sdk-assistant maintain
1 Like

@martyone: Thank you for fast and thorough reply!

Re sources: sorry, should have included the reference.

Re sb2 usage: wasn’t aware of it and will correct tbuilder accordingly. Will report back on how it went.

I used sb2 -m sdk-install in the end as it was the easiest for now. All worked as it should and I marked your solution as well.

Thank you again for your help!