qtbase/qmake
Maximilian Blochberger d65a45d2bc Fail builds on Apple platforms with invalid Info.plist
Information property lists (Info.plist) files are part of application
bundles on Apple platforms and contain basic information about the
application, such as the name of the application's executable.

The Info.plist file can have multiple formats, such as binary or XML.
Makefiles generated by qmake convert Info.plist files to XML by default,
so that variables in the Info.plist can be substituted with values
defined by qmake, such as the name of the application's executable. This
is important if users use external tools such as Xcode for modifying the
Info.plist file, which may save it in binary format. To convert the
formats, the plutil tool shipped with macOS (or the Xcode command-line
tools) is used. The Unix tool sed is then used to actually substitute
variables.

If the Info.plist file is invalid, e.g., due to an invalid tag name, the
plutil invocation fails. However, the converted plist is piped into sed
for variable substitution. The plutil command will simply write an error
message to standard out and return with a non-zero exit code. Due to the
pipe chain, make will not fail and the error message will end up in the
Info.plist in the built application bundle. The application bundle is
then invalid as well, as vital information such as the name of the
executable of the application is missing.

The change ensures that the pipe chain fails, if plutil exits with a
non-zero exit code.

The issue was introduced with my solution for QTBUG-45357. Beforehand,
Info.plists and mistakes therein were simply copied into the application
bundle.

[ChangeLog][qmake] Fail builds on Apple platforms if the Info.plist is
invalid instead of generating corrupt application bundles.

Pick-to: 6.5 6.9 6.10
Change-Id: Ibdb2a18e9bbf35a654af8534aa61188f8389c55a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-07-04 15:02:22 +02:00
..
doc Doc: Fix broken link in qmake manual 2025-05-16 16:06:45 +02:00
generators Fail builds on Apple platforms with invalid Info.plist 2025-07-04 15:02:22 +02:00
library qmake: Add support for arm64 hosts on Windows 2024-07-15 08:47:14 +00:00
CMakeLists.txt Make per-repos WARNINGS_ARE_ERRORS work 2024-09-12 12:03:37 +02:00
cachekeys.h
main.cpp
meta.cpp
meta.h
option.cpp
option.h
project.cpp
project.h
property.cpp
property.h
propertyprinter.cpp
propertyprinter.h
qmake_pch.h
qmakelibraryinfo.cpp
qmakelibraryinfo.h