From 2019e78d87e0bff1118fe3b1144985c3bf67c2b4 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Mon, 3 Apr 2017 15:44:36 +0200 Subject: [PATCH] qmake: Do not mix canonical and non canonical paths When having Qt sources in a symbolic link "shadowed" did not work because _PRO_FILE_PWD_ used canonical path, while source_root did not. Due to this mix it was possible that shadowedPath did not find any "common denominator" and always returned and empty string. The first place where things broke was while running config.tests. Task-number: QTBUG-59319 Change-Id: If73ecbc58290ee9113f887a73c312ebfb5e20a33 Reviewed-by: Joerg Bornemann Reviewed-by: Oswald Buddenhagen --- qmake/option.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qmake/option.cpp b/qmake/option.cpp index 52f9cb8a0e..4da2a1ae2c 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -462,7 +462,9 @@ Option::init(int argc, char **argv) void Option::prepareProject(const QString &pfile) { - QString srcpath = QDir::cleanPath(QFileInfo(pfile).absolutePath()); + // Canonicalize only the directory, otherwise things will go haywire + // if the file itself is a symbolic link. + const QString srcpath = QFileInfo(QFileInfo(pfile).absolutePath()).canonicalFilePath(); globals->setDirectories(srcpath, output_dir); }