SDK Fails to run perl while compiling on aarch64

REPRODUCIBILITY: always
OS VERSION: 4.5.0.18
HARDWARE: SDK
UI LANGUAGE: NA
REGRESSION: Don’t know

DESCRIPTION:

Several packages from Qt 5.15 fail to compile on SDK with aarch64 with an error during compilation:

make[2]: Leaving directory '/home/rinigus/qt/qtdeclarative/upstream/src/qmltyperegistrar'
cd qml/ && ( test -e Makefile || /opt/qt5/bin/qmake -o Makefile /home/rinigus/qt/qtdeclarative/upstream/src/qml/qml.pro ) && make -f Makefile 
Project MESSAGE: perl -w /opt/qt5/bin/syncqt.pl -module QtQml -version 5.15.8 -outdir /home/rinigus/qt/qtdeclarative/upstream -builddir /home/rinigus/qt/qtdeclarative/upstream /home/rinigus/qt/qtdeclarative/upstream
Use of uninitialized value $directory in concatenation (.) or string at /opt/qt5/bin/syncqt.pl line 691.
fileparse(): need a valid pathname at /opt/qt5/bin/syncqt.pl line 694.
Project ERROR: Failed to run: perl -w /opt/qt5/bin/syncqt.pl -module QtQml -version 5.15.8 -outdir /home/rinigus/qt/qtdeclarative/upstream -builddir /home/rinigus/qt/qtdeclarative/upstream /home/rinigus/qt/qtdeclarative/upstream
make[1]: *** [Makefile:102: sub-qml-make_first-ordered] Error 3
make[1]: Leaving directory '/home/rinigus/qt/qtdeclarative/upstream/src'
make: *** [Makefile:50: sub-src-make_first] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.3xJvHQ (%build)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.3xJvHQ (%build)
Messages from sb2:
 (WARNING)      qmake[1152823/-142194880]       Path not found for FD 3, for __fxstatat64()

At the same time, x86 version would work. Compilation would also work at OBS, see example package at Show home:rinigus:qt515:packaging / qtdeclarative - SailfishOS Open Build Service

PRECONDITIONS:

Get latest SFOS target and tooling. Add following repositories to compile:

Enabled repositories (global): 
 - adaptation-common ... https://releases.jolla.com/releases/4.5.0.18/jolla-hw/adaptation-common/aarch64/
 - apps              ... https://releases.jolla.com/jolla-apps/4.5.0.18/aarch64/
 - customer-jolla    ... https://releases.jolla.com/features/4.5.0.18/customers/jolla/aarch64/
 - hotfixes          ... https://releases.jolla.com/releases/4.5.0.18/hotfixes/aarch64/
 - jolla             ... https://releases.jolla.com/releases/4.5.0.18/jolla/aarch64/
 - sdk               ... https://releases.jolla.com/releases/4.5.0.18/sdk/aarch64/

Enabled repositories (user): 
 - qt515  ... https://repo.sailfishos.org/obs/home:/rinigus:/qt515:/packaging/sailfish_latest_aarch64/

STEPS TO REPRODUCE:

  1. Clone recursively GitHub - sailfishos-chum/qtdeclarative
  2. Checkout commit accee6958069df6c245b511d0d35275e79286d4d
  3. try to compile: mb2 -t devel-aarch64 build .

EXPECTED RESULT:

Corresponding section in successful log at OBS with the same target:

[   69s] cd qml/ && ( test -e Makefile || /opt/qt5/bin/qmake -o Makefile /home/abuild/rpmbuild/BUILD/opt-qt5-qtdeclarative-5.15.8+main.20230317095755.accee69/upstream/src/qml/qml.pro ) && make -f Makefile 
[   69s] Project MESSAGE: perl -w /opt/qt5/bin/syncqt.pl -module QtQml -version 5.15.8 -outdir /home/abuild/rpmbuild/BUILD/opt-qt5-qtdeclarative-5.15.8+main.20230317095755.accee69/upstream -builddir /home/abuild/rpmbuild/BUILD/opt-qt5-qtdeclarative-5.15.8+main.20230317095755.accee69/upstream /home/abuild/rpmbuild/BUILD/opt-qt5-qtdeclarative-5.15.8+main.20230317095755.accee69/upstream
[   71s] <srcbase> = /home/abuild/rpmbuild/BUILD/opt-qt5-qtdeclarative-5.15.8+main.20230317095755.accee69/upstream 
[   71s] <bldbase> = /home/abuild/rpmbuild/BUILD/opt-qt5-qtdeclarative-5.15.8+main.20230317095755.accee69/upstream 
[   71s] <outbase> = /home/abuild/rpmbuild/BUILD/opt-qt5-qtdeclarative-5.15.8+main.20230317095755.accee69/upstream 
[   71s] QtQml: created fwd-include header(s) for <srcbase>/src/qml/ { inlinecomponentutils_p.h (1), qtqmlcompilerglobal.h (1), qtqmlcompilerglobal_p.h (1), qtqmlglobal.h (1), qtqmlglobal_p.h (1) }

ACTUAL RESULT:

Compilation failed as shown in Description above.

MODIFICATIONS:

Described in “preconditions” above

ADDITIONAL INFORMATION:

Similar errors were observed with several other modules of Qt 5.15

1 Like

This is an old and known bug, marking as tracked. It’s really not about “failing to run perl”, but about $directory not being set properly. In the old qt version, there was a workaround:

It looks like the problem is in /usr/lib/qt5/bin/syncqt.pl from qt5-tools [2]. Changing line 684 as follows fixes the problem for me:

-     $directory = abs_path($directory);
+     $directory = File::Spec->canonpath($directory);

As you are on a newer qt, the script might have changed a bit, so ymmv.

@vige, thank you very much for a pointer! I will try it as well. However, how can it be that at OBS it runs without any issues? Any idea on what is OBS doing differently here?

Sorry, no idea. That would require some investigation.

1 Like

The way to fix this issue is to create a folder /srv/mer/targets inside the target for example by using sb2 -t devel-aarch64 -R mkdir -p /srv/mer/targets (replace target name “devel-aarch64” with correct one). The fix will be included in next release.

2 Likes

@mal: Thank you very much for finding it!