diff options
authorIikka Eklund <>2021-03-04 11:45:08 +0200
committerIikka Eklund <>2021-04-14 09:08:18 +0200
commit57c420b461b35b89cd9866c7ade42c1f6c51e583 (patch)
parentc5340356e3402d795f5ca77f4aefbe06fb4c1f40 (diff)
Conan: Use "scm" revision mode when exporting from .git repositoryHEADdev
We want to match the commit ID along with the RREV (recipe revision). This way we can pin exact Conan packages to known sha1/tag which makes releasing easier. We have two use cases where the conan export is being executed: - Conan export from src tar ball - .git directory is not present - Coin/CI: conan export from git repository The "scm" feature will not work if the ".git" repository does not exist. If this is the case then use the default "hash" mode for the recipe revision. Task-number: QTQAINFRA-4325 Change-Id: I5e3ac718333cd47b95d5a8886b33b1b5b7b31300 Reviewed-by: Toni Saario <>
1 files changed, 3 insertions, 0 deletions
diff --git a/ b/
index fbc3ac2..eea43e4 100644
--- a/
+++ b/
@@ -28,6 +28,7 @@
from conans import ConanFile, tools, CMake
import os
+from pathlib import Path
class QtConanError(Exception):
@@ -48,6 +49,8 @@ class QtDeviceUtilities(ConanFile):
default_options = {"shared": "default", # default: Use the value of the Qt build
"qt6": None}
exports_sources = "*", "!conan*.*"
+ # use commit ID as the RREV (recipe revision) if this is exported from .git repository
+ revision_mode = "scm" if Path(Path(__file__).parent.resolve() / ".git").exists() else "hash"
def source(self):
# sources are installed next to recipe, no need to clone etc. sources here