aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@qt.io>2018-10-30 16:34:51 +0200
committerSamuli Piippo <samuli.piippo@qt.io>2018-11-15 06:36:46 +0000
commit4064b3b6ea53fb1ee1f9f96b06c6abe120b830f4 (patch)
tree48f0052e322a871929ba216846b06fca359802f4
parente863df2be9e966811a80f0e3717af911478fd748 (diff)
qtdeclarative: fix inconsistent QML_COMPILE_HASH value
qtdeclarative and qtdeclarative-native may end up with different values for QML_COMPILE_HASH, which prevents running QML application when qtquickcompiler has been used. Change-Id: I29f42915629ca5da7507fdd20cfe0c64f445df9f Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
-rw-r--r--recipes-qt/qt5/qtdeclarative/0001-Always-use-commit-sha1-for-QML_COMPILE_HASH.patch31
-rw-r--r--recipes-qt/qt5/qtdeclarative_git.bb2
2 files changed, 33 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qtdeclarative/0001-Always-use-commit-sha1-for-QML_COMPILE_HASH.patch b/recipes-qt/qt5/qtdeclarative/0001-Always-use-commit-sha1-for-QML_COMPILE_HASH.patch
new file mode 100644
index 00000000..a734f8a2
--- /dev/null
+++ b/recipes-qt/qt5/qtdeclarative/0001-Always-use-commit-sha1-for-QML_COMPILE_HASH.patch
@@ -0,0 +1,31 @@
+From 260e165993fe15a1668cfd36caee18a95b2d2f59 Mon Sep 17 00:00:00 2001
+From: Samuli Piippo <samuli.piippo@qt.io>
+Date: Mon, 2 Jul 2018 13:32:44 +0300
+Subject: [PATCH] Always use commit sha1 for QML_COMPILE_HASH
+
+git describe can produce different strings for the same sha1, depending
+on the version of git (length of short hash) and whether release tag was
+in place when build was done (v5.11.1-0- vs. v5.11.0-66-).
+
+Instead use rev-parse to get the unambiguous commit sha1 which is also
+what is used from the .tag file.
+
+Change-Id: If378f03eb764e2d858bda5b662106aa4402d6559
+Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
+---
+ src/qml/qml.pro | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/qml/qml.pro b/src/qml/qml.pro
+index 940ebb325..a76a87b15 100644
+--- a/src/qml/qml.pro
++++ b/src/qml/qml.pro
+@@ -31,7 +31,7 @@ DEFINES += QT_NO_FOREACH
+ !equals(tag, "$${LITERAL_DOLLAR}Format:%H$${LITERAL_DOLLAR}") {
+ QML_COMPILE_HASH = $$tag
+ } else:exists($$PWD/../../.git) {
+- commit = $$system(git describe --tags --always --long --dirty)
++ commit = $$system(git rev-parse HEAD)
+ QML_COMPILE_HASH = $$commit
+ }
+ compile_hash_contents = \
diff --git a/recipes-qt/qt5/qtdeclarative_git.bb b/recipes-qt/qt5/qtdeclarative_git.bb
index 39095e59..3cb0a602 100644
--- a/recipes-qt/qt5/qtdeclarative_git.bb
+++ b/recipes-qt/qt5/qtdeclarative_git.bb
@@ -12,6 +12,8 @@ LIC_FILES_CHKSUM = " \
file://LICENSE.FDL;md5=6d9f2a9af4c8b8c3c769f6cc1b6aaf7e \
"
+SRC_URI += "file://0001-Always-use-commit-sha1-for-QML_COMPILE_HASH.patch"
+
DEPENDS += "qtbase"
PACKAGECONFIG ??= "qtxmlpatterns qml-debug qml-network ${@bb.utils.contains('DISTRO_FEATURES', 'qt5-static', 'static', '', d)}"