diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2019-01-11 15:42:55 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2019-01-11 17:35:37 +0000 |
commit | 90588a6a719aa143500d480582ae2de733ac7c0d (patch) | |
tree | 7520f49f81099cc57d4a8b51727267333a668c92 | |
parent | 34ef874fee31f05e2bd3d789f94b29771907322c (diff) |
Darwin support: Work around issue with canonical paths
When built with Qt >= 5.12, we pass a canonical output directory to
macOS' actool, but amazingly, it somehow manages to list the file paths
it created there in the non-canonical version. So we need to re-
canonicalize these paths.
Fixes: QBS-1417
Change-Id: I2cfcf7cdef0a16a1e69e0320651eabf4f3355307
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r-- | share/qbs/modules/ib/ib.js | 4 | ||||
-rw-r--r-- | src/lib/corelib/jsextensions/temporarydir.cpp | 11 |
2 files changed, 13 insertions, 2 deletions
diff --git a/share/qbs/modules/ib/ib.js b/share/qbs/modules/ib/ib.js index bd6697074..40bd1dc23 100644 --- a/share/qbs/modules/ib/ib.js +++ b/share/qbs/modules/ib/ib.js @@ -326,7 +326,9 @@ function parseActoolOutput(output) { ? ["partial_infoplist"] : ["bundle.input", "compiled_assetcatalog"]; artifacts.push({ - filePath: files[i], + // Even though we pass in a canonical base dir, the paths in the XML File + // are non-canonical. See QBS-1417. + filePath: FileInfo.canonicalPath(files[i]), fileTags: tags }); } diff --git a/src/lib/corelib/jsextensions/temporarydir.cpp b/src/lib/corelib/jsextensions/temporarydir.cpp index 9f0eb25a9..6dece5dc3 100644 --- a/src/lib/corelib/jsextensions/temporarydir.cpp +++ b/src/lib/corelib/jsextensions/temporarydir.cpp @@ -40,6 +40,7 @@ #include <language/scriptengine.h> +#include <QtCore/qfileinfo.h> #include <QtCore/qobject.h> #include <QtCore/qtemporarydir.h> #include <QtCore/qvariant.h> @@ -51,6 +52,14 @@ namespace qbs { namespace Internal { +static bool tempDirIsCanonical() +{ +#if QT_VERSION >= 0x050c00 + return true; +#endif + return false; +} + class TemporaryDir : public QObject, public QScriptable { Q_OBJECT @@ -90,7 +99,7 @@ bool TemporaryDir::isValid() const QString TemporaryDir::path() const { - return dir.path(); + return tempDirIsCanonical() ? dir.path() : QFileInfo(dir.path()).canonicalFilePath(); } bool TemporaryDir::remove() |