From 8035e2c2f3ab95503fbac9f90e0511b7ebb00597 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Thu, 9 Jan 2020 16:55:31 +0300 Subject: [PATCH 1/7] fix windows deploy system exclude dwmapi --- Deploy/configparser.cpp | 2 ++ UnitTests/tst_deploytest.cpp | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Deploy/configparser.cpp b/Deploy/configparser.cpp index f5cf750..45329b7 100644 --- a/Deploy/configparser.cpp +++ b/Deploy/configparser.cpp @@ -514,6 +514,8 @@ void ConfigParser::initIgnoreList() _config.ignoreList.addRule(addRuleWin("WINMM.DLL")); _config.ignoreList.addRule(addRuleWin("IMM32.DLL")); _config.ignoreList.addRule(addRuleWin("KernelBase.DLL")); + _config.ignoreList.addRule(addRuleWin("dwmapi.DLL")); + } diff --git a/UnitTests/tst_deploytest.cpp b/UnitTests/tst_deploytest.cpp index 77e5687..502bb16 100644 --- a/UnitTests/tst_deploytest.cpp +++ b/UnitTests/tst_deploytest.cpp @@ -1668,7 +1668,6 @@ void deploytest::testSystemLib() { "./" + DISTRO_DIR + "/api-ms-win-crt-time-l1-1-0.dll", "./" + DISTRO_DIR + "/api-ms-win-security-base-l1-1-0.dll", "./" + DISTRO_DIR + "/api-ms-win-security-cryptoapi-l1-1-0.dll", - "./" + DISTRO_DIR + "/dwmapi.dll", "./" + DISTRO_DIR + "/mpr.dll", "./" + DISTRO_DIR + "/profapi.dll", "./" + DISTRO_DIR + "/rpcrt4.dll", From 3fe4a92ee2b8361b0d28b96a9aa589fcff6daa43 Mon Sep 17 00:00:00 2001 From: EndrII Date: Thu, 9 Jan 2020 23:47:57 +0300 Subject: [PATCH 2/7] added tests fot bug #253 --- UnitTests/modules.cpp | 11 +++++++++++ UnitTests/modules.h | 1 + UnitTests/tst_deploytest.cpp | 17 +++++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/UnitTests/modules.cpp b/UnitTests/modules.cpp index 171c636..4f5cf3f 100644 --- a/UnitTests/modules.cpp +++ b/UnitTests/modules.cpp @@ -13,6 +13,17 @@ Modules::Modules() } +QSet Modules::ignoreFilter(const QSet &input, const QString &filter) { + QSet res; + for (auto& val : input) { + if (!val.contains(filter)) { + res.insert(val); + } + } + + return res; +} + QSet Modules::qtLibs() { TestUtils utils; #ifdef Q_OS_WIN diff --git a/UnitTests/modules.h b/UnitTests/modules.h index c067ab5..f9d19f9 100644 --- a/UnitTests/modules.h +++ b/UnitTests/modules.h @@ -20,6 +20,7 @@ private: public: Modules(); + static QSet ignoreFilter(const QSet& input, const QString& filter); static QSet qtLibs(); static QSet qmlLibs(); static QSet qmlLibsExtractPlugins(); diff --git a/UnitTests/tst_deploytest.cpp b/UnitTests/tst_deploytest.cpp index 502bb16..2246b4c 100644 --- a/UnitTests/tst_deploytest.cpp +++ b/UnitTests/tst_deploytest.cpp @@ -1177,6 +1177,23 @@ void deploytest::testConfFile() { QFile::remove(TestBinDir + "/../folder/For/Testing/Deploy/File/TestConf.json"); + comapareTree = Modules::qmlLibs() + Modules::qtLibs(); + +#ifdef WITH_ALL_TESTS + comapareTree += Modules::qtWebEngine(); +#endif + + comapareTree = Modules::ignoreFilter(comapareTree, "/plugins/p"); + + runTestParams({"-bin", TestBinDir, "clear", + "-ignore", "/plugins/p", + "-confFile", TestBinDir + "/TestConf.json"}, &comapareTree); + + + runTestParams({"-confFile", TestBinDir + "/TestConf.json"}, &comapareTree); + QFile::remove(TestBinDir + "/TestConf.json"); + + } void deploytest::testQt() { From b4453c2c00c6801abd7633be6830af62f96cd737 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Fri, 10 Jan 2020 10:43:35 +0300 Subject: [PATCH 3/7] fix tests --- UnitTests/tst_deploytest.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/UnitTests/tst_deploytest.cpp b/UnitTests/tst_deploytest.cpp index 2246b4c..1c83fb5 100644 --- a/UnitTests/tst_deploytest.cpp +++ b/UnitTests/tst_deploytest.cpp @@ -1177,15 +1177,25 @@ void deploytest::testConfFile() { QFile::remove(TestBinDir + "/../folder/For/Testing/Deploy/File/TestConf.json"); - comapareTree = Modules::qmlLibs() + Modules::qtLibs(); - -#ifdef WITH_ALL_TESTS - comapareTree += Modules::qtWebEngine(); -#endif + comapareTree = Modules::qtLibs(); comapareTree = Modules::ignoreFilter(comapareTree, "/plugins/p"); +#ifdef Q_OS_UNIX + comapareTree -= utils.createTree( + { + "./" + DISTRO_DIR + "/lib/libQt5EglFSDeviceIntegration.so", + "./" + DISTRO_DIR + "/lib/libQt5WebSockets.so" + }); +#else + comapareTree -= utils.createTree( + { + "./" + DISTRO_DIR + "/lib/libQt5EglFSDeviceIntegration.so", + "./" + DISTRO_DIR + "/lib/libQt5WebSockets.so" + }); +#endif - runTestParams({"-bin", TestBinDir, "clear", + runTestParams({"-bin", TestBinDir + "QtWidgetsProject,", + "clear", "-ignore", "/plugins/p", "-confFile", TestBinDir + "/TestConf.json"}, &comapareTree); From 9ecced008edc7dbceadc82b22bc21844b7f0da0d Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Fri, 10 Jan 2020 16:02:07 +0300 Subject: [PATCH 4/7] fix #253 --- Deploy/configparser.cpp | 32 +++++++++----------------------- Deploy/pathutils.cpp | 16 +++++++++++++++- Deploy/pathutils.h | 7 +++++++ UnitTests/tst_deploytest.cpp | 2 ++ 4 files changed, 33 insertions(+), 24 deletions(-) diff --git a/Deploy/configparser.cpp b/Deploy/configparser.cpp index 45329b7..04eccb2 100644 --- a/Deploy/configparser.cpp +++ b/Deploy/configparser.cpp @@ -21,11 +21,10 @@ bool ConfigParser::parseParams() { auto path = QuasarAppUtils::Params::getStrArg("confFile"); - bool createFile = !(path.isEmpty() || QFile::exists(path)); - if (path.isEmpty()) { - path = QFileInfo("./").absoluteFilePath(); + bool createFile = !QFile::exists(path); + if (QFile::exists(path)) { + loadFromFile(path); } - loadFromFile(path); switch (DeployCore::getMode()) { case RunMode::Info: { @@ -132,17 +131,8 @@ void ConfigParser::readKey(const QString& key, const QJsonObject& obj, QString val = i.toString(); if (!val.isEmpty()) { - if (PathUtils::isPath(val)) { - QString path; - - if (PathUtils::isAbsalutPath(val)) { - path = QFileInfo(val).absoluteFilePath(); - } else { - path = QFileInfo(confFileDir + '/' + val).absoluteFilePath(); - } - - list.push_back(path); - + if (PathUtils::isReleativePath(val)) { + list.push_back(QFileInfo(confFileDir + '/' + val).absoluteFilePath()); } else { list.push_back(val); } @@ -155,16 +145,12 @@ void ConfigParser::readKey(const QString& key, const QJsonObject& obj, QString val = obj[key].toString(); if (!val.isEmpty()) { - if (PathUtils::isPath(val)) { - - if (PathUtils::isAbsalutPath(val)) { - val = QFileInfo(val).absoluteFilePath(); - } else { - val = QFileInfo(confFileDir + '/' + val).absoluteFilePath(); - } + if (PathUtils::isReleativePath(val)) { + QuasarAppUtils::Params::setArg(key, QFileInfo(confFileDir + '/' + val).absoluteFilePath()); + } else { + QuasarAppUtils::Params::setArg(key, val); } - QuasarAppUtils::Params::setArg(key, val); } else { auto value = obj[key].toBool(true); QuasarAppUtils::Params::setEnable(key, value); diff --git a/Deploy/pathutils.cpp b/Deploy/pathutils.cpp index eb4f725..0a4b96d 100644 --- a/Deploy/pathutils.cpp +++ b/Deploy/pathutils.cpp @@ -7,6 +7,7 @@ #include "pathutils.h" +#include #include PathUtils::PathUtils() @@ -66,7 +67,20 @@ QString PathUtils::getRelativeLink(QString from, QString to) { // TODO ignore labels may be mistaken for a path, which will lead to improper eating bool PathUtils::isPath(const QString &path) { - return path.contains('/') || path.contains('\\') || path == "."; + QFileInfo info(path); + return info.exists(); +// return path.contains('/') || path.contains('\\') || path == "."; +} + +bool PathUtils::isReleativePath(const QString &path) { + QString temp = QDir::fromNativeSeparators(path); + if (temp.size() == 1) { + return path[0] == '.'; + } else if (temp.size() > 1) { + return path[0] == '.' && path[1] == '/'; + } + + return false; } QChar PathUtils::getDrive(QString path) { diff --git a/Deploy/pathutils.h b/Deploy/pathutils.h index 7748b69..2a6e4c3 100644 --- a/Deploy/pathutils.h +++ b/Deploy/pathutils.h @@ -63,6 +63,13 @@ public: */ static bool isPath(const QString &path); + /** + * @brief isPath + * @param path + * @return return true if imput value is Releative path + */ + static bool isReleativePath(const QString &path); + /** * @brief getDrive * @param path diff --git a/UnitTests/tst_deploytest.cpp b/UnitTests/tst_deploytest.cpp index 1c83fb5..051b4e6 100644 --- a/UnitTests/tst_deploytest.cpp +++ b/UnitTests/tst_deploytest.cpp @@ -1177,6 +1177,8 @@ void deploytest::testConfFile() { QFile::remove(TestBinDir + "/../folder/For/Testing/Deploy/File/TestConf.json"); + + // Test generar string in confFile comapareTree = Modules::qtLibs(); comapareTree = Modules::ignoreFilter(comapareTree, "/plugins/p"); From 9e279a8843b2526ebd5184d892c05cb410a6acc9 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Fri, 10 Jan 2020 18:15:31 +0300 Subject: [PATCH 5/7] fix tests on windows --- UnitTests/tst_deploytest.cpp | 84 ++++++++++++++++++++++++++++++++++-- 1 file changed, 80 insertions(+), 4 deletions(-) diff --git a/UnitTests/tst_deploytest.cpp b/UnitTests/tst_deploytest.cpp index 051b4e6..98c5897 100644 --- a/UnitTests/tst_deploytest.cpp +++ b/UnitTests/tst_deploytest.cpp @@ -894,6 +894,7 @@ void deploytest::costomScript() { QFile f("./" + DISTRO_DIR + "/TestOnlyC.exe"); auto comapareTree = utils.createTree( {"./" + DISTRO_DIR + "/TestOnlyC.exe", + "./" + DISTRO_DIR + "/TestOnlyC.bat", "./" + DISTRO_DIR + "/qt.conf"}); QString bin = TestBinDir + "TestOnlyC.exe"; QString scriptPath = "./" + DISTRO_DIR + "/TestOnlyC.bat"; @@ -1188,15 +1189,17 @@ void deploytest::testConfFile() { "./" + DISTRO_DIR + "/lib/libQt5EglFSDeviceIntegration.so", "./" + DISTRO_DIR + "/lib/libQt5WebSockets.so" }); + auto bin = TestBinDir + "QtWidgetsProject"; #else comapareTree -= utils.createTree( { - "./" + DISTRO_DIR + "/lib/libQt5EglFSDeviceIntegration.so", - "./" + DISTRO_DIR + "/lib/libQt5WebSockets.so" + "./" + DISTRO_DIR + "/Qt5WebSockets.dll" }); + auto bin = TestBinDir + "QtWidgetsProject.exe"; #endif - runTestParams({"-bin", TestBinDir + "QtWidgetsProject,", + runTestParams({"-bin", bin, + "-qmake", qmake, "clear", "-ignore", "/plugins/p", "-confFile", TestBinDir + "/TestConf.json"}, &comapareTree); @@ -1569,6 +1572,61 @@ void deploytest::testSystemLib() { "./" + DISTRO_DIR + "/api-ms-win-core-synch-l1-2-0.dll", "./" + DISTRO_DIR + "/api-ms-win-core-sysinfo-l1-1-0.dll", "./" + DISTRO_DIR + "/api-ms-win-core-util-l1-1-0.dll", + "./" + DISTRO_DIR + "/API-MS-Win-Core-Heap-Obsolete-L1-1-0.dll", + "./" + DISTRO_DIR + "/API-MS-Win-Core-Kernel32-Private-L1-1-0.dll", + "./" + DISTRO_DIR + "/API-MS-Win-Core-Kernel32-Private-L1-1-1.dll", + "./" + DISTRO_DIR + "/API-MS-Win-core-file-l2-1-0.dll", + "./" + DISTRO_DIR + "/API-MS-Win-core-file-l2-1-1.dll", + "./" + DISTRO_DIR + "/API-MS-Win-core-localization-obsolete-l1-2-0.dll", + "./" + DISTRO_DIR + "/API-MS-Win-core-string-l2-1-0.dll", + "./" + DISTRO_DIR + "/API-MS-Win-core-string-obsolete-l1-1-0.dll", + "./" + DISTRO_DIR + "/API-MS-Win-core-xstate-l2-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-com-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-comm-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-datetime-l1-1-1.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-debug-l1-1-1.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-delayload-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-errorhandling-l1-1-1.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-fibers-l1-1-1.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-file-l1-2-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-file-l1-2-1.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-interlocked-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-io-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-io-l1-1-1.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-kernel32-legacy-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-kernel32-legacy-l1-1-1.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-libraryloader-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-libraryloader-l1-1-1.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-localization-l1-2-1.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-memory-l1-1-1.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-memory-l1-1-2.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-privateprofile-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-privateprofile-l1-1-1.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-processenvironment-l1-2-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-processthreads-l1-1-1.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-processthreads-l1-1-2.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-processtopology-obsolete-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-realtime-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-registry-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-registry-l2-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-rtlsupport-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-shlwapi-legacy-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-shlwapi-obsolete-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-shutdown-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-stringansi-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-stringloader-l1-1-1.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-sysinfo-l1-2-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-sysinfo-l1-2-1.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-threadpool-l1-2-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-threadpool-legacy-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-threadpool-private-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-timezone-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-url-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-version-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-wow64-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-core-xstate-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-service-core-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-service-core-l1-1-1.dll", "./" + DISTRO_DIR + "/libgcc_s_seh-1.dll", "./" + DISTRO_DIR + "/libstdc++-6.dll", "./" + DISTRO_DIR + "/libwinpthread-1.dll", @@ -1697,6 +1755,25 @@ void deploytest::testSystemLib() { "./" + DISTRO_DIR + "/api-ms-win-crt-time-l1-1-0.dll", "./" + DISTRO_DIR + "/api-ms-win-security-base-l1-1-0.dll", "./" + DISTRO_DIR + "/api-ms-win-security-cryptoapi-l1-1-0.dll", + "./" + DISTRO_DIR + "/API-MS-Win-Eventing-Controller-L1-1-0.dll", + "./" + DISTRO_DIR + "/API-MS-Win-Eventing-Legacy-L1-1-0.dll", + "./" + DISTRO_DIR + "/API-MS-Win-Security-Lsalookup-L2-1-0.dll", + "./" + DISTRO_DIR + "/API-MS-Win-Security-Lsalookup-L2-1-1.dll", + "./" + DISTRO_DIR + "/API-MS-Win-devices-config-L1-1-0.dll", + "./" + DISTRO_DIR + "/API-MS-Win-security-lsapolicy-l1-1-0.dll", + "./" + DISTRO_DIR + "/API-MS-Win-security-provider-L1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-crt-conio-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-crt-convert-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-crt-environment-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-crt-filesystem-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-crt-heap-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-crt-locale-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-crt-multibyte-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-crt-process-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-crt-stdio-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-crt-utility-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-eventing-consumer-l1-1-0.dll", + "./" + DISTRO_DIR + "/api-ms-win-security-sddl-l1-1-0.dll", "./" + DISTRO_DIR + "/mpr.dll", "./" + DISTRO_DIR + "/profapi.dll", "./" + DISTRO_DIR + "/rpcrt4.dll", @@ -1704,7 +1781,6 @@ void deploytest::testSystemLib() { "./" + DISTRO_DIR + "/userenv.dll", "./" + DISTRO_DIR + "/uxtheme.dll", "./" + DISTRO_DIR + "/version.dll", - "./" + DISTRO_DIR + "/win32u.dll" }); runTestParams({"-bin", bin, "clear" , From 51a4f53fc10db38405e3f50cdb80ac165c53449c Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Tue, 14 Jan 2020 17:33:45 +0300 Subject: [PATCH 6/7] added crtbase --- Deploy/dependenciesscanner.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Deploy/dependenciesscanner.cpp b/Deploy/dependenciesscanner.cpp index 796d16d..b85f2ed 100644 --- a/Deploy/dependenciesscanner.cpp +++ b/Deploy/dependenciesscanner.cpp @@ -14,7 +14,9 @@ #include #include "pathutils.h" -DependenciesScanner::DependenciesScanner() {} +DependenciesScanner::DependenciesScanner() { + +} void DependenciesScanner::clearScaned() { _scanedLibs.clear(); @@ -158,6 +160,11 @@ void DependenciesScanner::addToWinAPI(const QString &lib, QHash> winAPI; + +#ifdef Q_OS_WIN + winAPI[WinAPI::Crt] += "UCRTBASE.DLL"; +#endif + for (auto i : env) { dir.setPath(i); From de86235e7e968098e8ad26515a49150b8f56941f Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Tue, 14 Jan 2020 17:47:10 +0300 Subject: [PATCH 7/7] fix tests on windows --- UnitTests/tst_deploytest.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/UnitTests/tst_deploytest.cpp b/UnitTests/tst_deploytest.cpp index 98c5897..c30fecb 100644 --- a/UnitTests/tst_deploytest.cpp +++ b/UnitTests/tst_deploytest.cpp @@ -1781,6 +1781,8 @@ void deploytest::testSystemLib() { "./" + DISTRO_DIR + "/userenv.dll", "./" + DISTRO_DIR + "/uxtheme.dll", "./" + DISTRO_DIR + "/version.dll", + "./" + DISTRO_DIR + "/ucrtbase.dll", + }); runTestParams({"-bin", bin, "clear" ,