Ask / Submit

Build fails with multiple .pro files in Sailfish SDK 2.x

Tracked by Jolla (Rejected)

asked 2019-06-16 18:05:17 +0300

carolus gravatar image

updated 2019-06-17 09:18:10 +0300

martyone gravatar image


when I try to build my private project with the current version of the Sailfish SDK in Qt Creator the build fails, see error messages[1], while it worked flawlessly with all versions prior to 2.0. It is based on a subdirs project [2]: one directory (“Vokabeltrainer”) contains a library (“libvocable”) the other the main program (“”).

A manual shadow build inside the build engine VM

sb2 -t SailfishOS- -m sdk-build qmake ../Vokabeltrainer/
sb2 -t SailfishOS- -m sdk-build make
mb2 -t SailfishOS-  rpm

is successfully after manually copying the spec file to a rpm folder in the shadow build location.

I hope this is sufficient to locate the problematic code changes. If not I will try to compose a minimal example.


[1] Error Output in QTCreator:

Building target platforms: armv7hl-meego-linux
Building for target armv7hl-meego-linux
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.Z1P8Dg
+ umask 022
+ cd /home/mersdk/share/src/build-sailfish-SailfishOS_3_0_2_8_armv7hl_in_Sailfish_OS_Build_Engine-Release
+ export LANG
+ unset DISPLAY
+ CFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -fmessage-length=0 -march=armv7-a -mfloat-abi=hard -mfpu=neon -mthumb -Wno-psabi'
+ export CFLAGS
+ CXXFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -fmessage-length=0 -march=armv7-a -mfloat-abi=hard -mfpu=neon -mthumb -Wno-psabi'
+ export CXXFLAGS
+ FFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -fmessage-length=0 -march=armv7-a -mfloat-abi=hard -mfpu=neon -mthumb -Wno-psabi -I/usr/lib/gfortran/modules'
+ export FFLAGS
+ export LD_AS_NEEDED
+ export QT_SELECT=5
+ qmake -qt=5 -makefile 'QMAKE_CFLAGS_RELEASE=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -fmessage-length=0 -march=armv7-a -mfloat-abi=hard -mfpu=neon -mthumb -Wno-psabi' 'QMAKE_CFLAGS_DEBUG=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -fmessage-length=0 -march=armv7-a -mfloat-abi=hard -mfpu=neon -mthumb -Wno-psabi' 'QMAKE_CXXFLAGS_RELEASE=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -fmessage-length=0 -march=armv7-a -mfloat-abi=hard -mfpu=neon -mthumb -Wno-psabi' 'QMAKE_CXXFLAGS_DEBUG=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -fmessage-length=0 -march=armv7-a -mfloat-abi=hard -mfpu=neon -mthumb -Wno-psabi' QMAKE_STRIP=: PREFIX=/usr
/home/mersdk/.mb2/wrappers/share/src/build-sailfish-SailfishOS_3_0_2_8_armv7hl_in_Sailfish_OS_Build_Engine-Release/qmake: Executing real qmake:
+ /usr/bin/qmake -qt=5 -makefile 'QMAKE_CFLAGS_RELEASE=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -fmessage-length=0 -march=armv7-a -mfloat-abi=hard -mfpu=neon -mthumb -Wno-psabi' 'QMAKE_CFLAGS_DEBUG=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -fmessage-length=0 -march=armv7-a -mfloat-abi=hard -mfpu=neon -mthumb -Wno-psabi' 'QMAKE_CXXFLAGS_RELEASE=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -fmessage-length=0 -march=armv7-a -mfloat-abi=hard -mfpu=neon -mthumb -Wno-psabi' 'QMAKE_CXXFLAGS_DEBUG=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -fmessage-length=0 -march=armv7-a -mfloat-abi=hard -mfpu=neon -mthumb -Wno-psabi' QMAKE_STRIP=: PREFIX=/usr -spec linux-g++ /home/mersdk/share/src/Vokabeltrainer
Cannot read /home/mersdk/share/src/Vokabeltrainer: file to open is a directory
Error processing project file: /home/mersdk/share/src/Vokabeltrainer
error: Bad exit status from /var/tmp/rpm-tmp.Z1P8Dg (%build)
    Bad exit status from /var/tmp/rpm-tmp.Z1P8Dg (%build)

[2] Main project file

TEMPLATE = subdirs
CONFIG += sailfishapp
SUBDIRS = libvocable sailfish

CONFIG += ordered
    rpm/VTTouch.spec \
    rpm/VTTouch.yaml \
edit retag flag offensive close delete

1 Answer

Sort by » oldest newest most voted

answered 2019-06-17 09:32:26 +0300

martyone gravatar image

updated 2019-07-29 09:04:59 +0300

More exactly it fails to pick the right .pro file when multiple .pro files exist in the project directory. The fact that it is a subdir-type project is unimportant.

This happens because the optional <project-dir-or-file> is now consumed by mb2 qmake command for the purposes of initiating a shadow build and the same applies to the all-in-one mb2 build command. The argument is not forwarded to qmake and the optional file name component of the path is ignored (check mb2 --help). It works with the assumption that the .pro file must be already specified on qmake command line in the .spec file when it cannot be determined by qmake automatically.

Edit your .spec file, append to qmake invocation to fix this. Your %build section should look like:


If your .spec file is generated from a .yaml file, edit the .yaml file instead, adding something like:

edit flag offensive delete publish link more


@carolus please check if the updated answer works for you.

martyone ( 2019-07-17 11:24:42 +0300 )edit

When I use %qtc_qmake5 the build works. But this change will be removed after every change in the yaml file.

carolus ( 2019-07-26 21:01:20 +0300 )edit

@carolus ok now? Note that you can also replace the now obsolete Builder: qtc5 with Builder: qmake5 in your .yaml.

martyone ( 2019-07-29 09:08:48 +0300 )edit
Login/Signup to Answer

Question tools



Asked: 2019-06-16 18:05:17 +0300

Seen: 247 times

Last updated: Jul 29 '19