summaryrefslogtreecommitdiff
path: root/src/buildtool/common/tree.hpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2025-04-08 11:35:24 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2025-04-08 13:05:58 +0200
commit29a296143913d12ff6a5b8a10e5904cd2c58cc29 (patch)
tree61ae9add85a1435e3a43661ba68fd05781f7ab18 /src/buildtool/common/tree.hpp
parente401d33c3266752aeb4cc4fc41b322df8ee3851b (diff)
downloadjustbuild-29a296143913d12ff6a5b8a10e5904cd2c58cc29.tar.gz
Keep identifiers for actions, trees, and tree_overlays disjoint
While our traverser correctly keeps separate identifier spaces for those entities, having disjoint identifiers allows easier reading of log messages and more simple reporting of origins of actions.
Diffstat (limited to 'src/buildtool/common/tree.hpp')
-rw-r--r--src/buildtool/common/tree.hpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/buildtool/common/tree.hpp b/src/buildtool/common/tree.hpp
index c861b264..bf81d848 100644
--- a/src/buildtool/common/tree.hpp
+++ b/src/buildtool/common/tree.hpp
@@ -22,6 +22,7 @@
#include <unordered_map>
#include <utility>
+#include "fmt/core.h"
#include "nlohmann/json.hpp"
#include "src/buildtool/common/action.hpp"
#include "src/buildtool/common/action_description.hpp"
@@ -91,7 +92,9 @@ class Tree {
// The type of HashFunction is irrelevant here. It is used for
// identification of trees. SHA256 is used.
HashFunction const hash_function{HashFunction::Type::PlainSHA256};
- return hash_function.PlainHashData(ComputeDescription(inputs).dump())
+ return hash_function
+ .PlainHashData(
+ fmt::format("TREE:{}", ComputeDescription(inputs).dump()))
.HexString();
}
};