Skip to content

qmake build system doesn't fail if scripts or commands called fail #273

@TheAssassin

Description

@TheAssassin

CC @probonopd @patrickelectric @t-paul

Due to a bug in our qmake system, calls made in subshells (e.g., the calls to git to gather the version information, or the call to the script introduced in #263 that dynamically generates the exclude list from []) don't cause qmake to fail the configuration step. Therefore, builds on systems that don't have all the necessary tools available (or don't have access to the Internet, see ) are broken in one or more ways, as the information generated by these commands is lacking in the binaries.

This is especially annoying on the openSUSE build service, which builds our tools so that users of the system can build AppImages.

See the following excerpt from the latest build log (which, unfortunately, isn't accessible without logging in over at OBS):

[   75s] + qmake-qt5 ../linuxdeployqt.pro
[   75s] Info: creating cache file /home/abuild/rpmbuild/BUILD/linuxdeployqt-3.1523199587.88aba55/build/.qmake.cache
[   75s] + make -j8
[   75s] cd src/ && ( test -e Makefile || /usr/bin/qmake-qt5 /home/abuild/rpmbuild/BUILD/linuxdeployqt-3.1523199587.88aba55/src/src.pro -o Makefile ) && make -f Makefile 
[   75s] make[1]: Entering directory '/home/abuild/rpmbuild/BUILD/linuxdeployqt-3.1523199587.88aba55/build/src'
[   75s] make[1]: Nothing to be done for 'first'.
[   75s] make[1]: Leaving directory '/home/abuild/rpmbuild/BUILD/linuxdeployqt-3.1523199587.88aba55/build/src'
[   75s] cd tools/ && ( test -e Makefile || /usr/bin/qmake-qt5 /home/abuild/rpmbuild/BUILD/linuxdeployqt-3.1523199587.88aba55/tools/tools.pro -o Makefile ) && make -f Makefile 
[   75s] make[1]: Entering directory '/home/abuild/rpmbuild/BUILD/linuxdeployqt-3.1523199587.88aba55/build/tools'
[   75s] cd linuxdeployqt/ && ( test -e Makefile || /usr/bin/qmake-qt5 /home/abuild/rpmbuild/BUILD/linuxdeployqt-3.1523199587.88aba55/tools/linuxdeployqt/linuxdeployqt.pro -o Makefile ) && make -f Makefile 
[   75s] Project MESSAGE: Not building on Travis CI, tagging build as local dev build
[   75s] /home/abuild/rpmbuild/BUILD/linuxdeployqt-3.1523199587.88aba55/tools/linuxdeployqt/../excludelist.sh: line 4: wget: command not found
[   75s] /home/abuild/rpmbuild/BUILD/linuxdeployqt-3.1523199587.88aba55/tools/linuxdeployqt/../excludelist.sh: line 9: blacklisted: bad array subscript
[   75s] make[2]: Entering directory '/home/abuild/rpmbuild/BUILD/linuxdeployqt-3.1523199587.88aba55/build/tools/linuxdeployqt'
[   75s] /bin/sh: git: command not found
[   75s] /bin/sh: git: command not found
[   75s] /bin/sh: git: command not found
[   75s] g++ -c -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -DOPENSSL_LOAD_CONF -O2 -std=c++0x -Wall -W -D_REENTRANT -fPIC -DBUILD_LINUXDEPLOYQT -DLINUXDEPLOYQT_GIT_COMMIT='""' -DBUILD_DATE='"2018-04-08 15:02:52 UTC"' -DBUILD_NUMBER='"<local dev build>"' -DLINUXDEPLOYQT_VERSION='""' -DEXCLUDELIST="\"\"" -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_CORE_LIB -I/home/abuild/rpmbuild/BUILD/linuxdeployqt-3.1523199587.88aba55/tools/linuxdeployqt -I. -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I.moc -I/usr/include/pgsql/ -I/usr/include/pgsql/server -I/usr/include/mysql/ -I/usr/lib64/qt5/mkspecs/linux-g++ -o .obj/main.o /home/abuild/rpmbuild/BUILD/linuxdeployqt-3.1523199587.88aba55/tools/linuxdeployqt/main.cpp
[   75s] /bin/sh: git: command not found
[   75s] /bin/sh: git: command not found
[   75s] /bin/sh: git: command not found
[   75s] g++ -c -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -DOPENSSL_LOAD_CONF -O2 -std=c++0x -Wall -W -D_REENTRANT -fPIC -DBUILD_LINUXDEPLOYQT -DLINUXDEPLOYQT_GIT_COMMIT='""' -DBUILD_DATE='"2018-04-08 15:02:52 UTC"' -DBUILD_NUMBER='"<local dev build>"' -DLINUXDEPLOYQT_VERSION='""' -DEXCLUDELIST="\"\"" -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_CORE_LIB -I/home/abuild/rpmbuild/BUILD/linuxdeployqt-3.1523199587.88aba55/tools/linuxdeployqt -I. -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I.moc -I/usr/include/pgsql/ -I/usr/include/pgsql/server -I/usr/include/mysql/ -I/usr/lib64/qt5/mkspecs/linux-g++ -o .obj/shared.o /home/abuild/rpmbuild/BUILD/linuxdeployqt-3.1523199587.88aba55/tools/linuxdeployqt/shared.cpp
[   82s] g++ -Wl,--gc-sections -Wl,-O1 -o ../../bin/linuxdeployqt .obj/main.o .obj/shared.o   -L/usr/lib64 -lQt5Core -lpthread 
[   82s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/linuxdeployqt-3.1523199587.88aba55/build/tools/linuxdeployqt'
[   82s] make[1]: Leaving directory '/home/abuild/rpmbuild/BUILD/linuxdeployqt-3.1523199587.88aba55/build/tools'
[   82s] + exit 0

There are several calls to git which fail, but these are rather harmless, as they are just there for generating some version information. However, there's a call to a script that tries to generate the exclude list that is embedded into linuxdeployqt from the source file. Since the list is missing, OBS is producing broken AppImages at the moment, which contain offending and/or unnecessary libraries. (Thanks @t-paul for this hint).

The obviously first step in order to fix these OBS-related issues is to make qmake fail if these subshell calls fail.
@patrickelectric maybe you can help us here? You seem to have some qmake experience.
I will have a look into this myself later, after writing the other bug reports.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions