summaryrefslogtreecommitdiff
path: root/src/buildtool/build_engine
AgeCommit message (Collapse)Author
2022-06-20Disallow comparison of namesKlaus Aehlig
In our semantics, it was always intended that names are completely opaque and only used by passing them to functions providing information about a target. However, we never enforced that they not be compared for equality, even though we always had this in mind, and the computation of the target-level cache key was designed with this semantics in mind. Enforce this restriction now.
2022-06-20expression: cache the cacheability propertyKlaus Aehlig
2022-06-20Crypto: Refactor hash computationOliver Reiche
... by renaming HashGenerator to (incremental) Hasher and dropping support for Git/MD5 hashes. The Hasher does not expose the actual hash implementation.
2022-06-20Crypto: Add and use set of globally used hash functionsOliver Reiche
2022-06-13Fix target cache key: Use repository-local target nameOliver Reiche
2022-06-13ExportRule: Compute target cache key use target cacheOliver Reiche
2022-06-13ResultMap: Keep track of targets to cacheOliver Reiche
2022-06-13AnalysedTarget: Add getter to obtain non-known artifactsOliver Reiche
2022-06-13TargetCache: Initial implementationOliver Reiche
2022-06-13TargetResult: Add support for JSON (de)serializationOliver Reiche
2022-06-13multithreading: Add AtomicValue to atomically set/get valueOliver Reiche
... and use it to replace the commonly used pattern in Expression, LinkedMap, and GitTreeEntry. Furthermore, remove assignment operators for Expression and LinkedMap as those are considered to be used in an immutable manner anyway.
2022-06-09Disallow upwards-facing inputs in actions and tree constructorsKlaus Aehlig
2022-06-09fix typosAlberto Sartori
2022-06-02Split off the expression_ptr interfaceKlaus Aehlig
So that we can, also for header-only libraries, always declare the direct dependencies without creating a cyclic dependency between entity_name_data and expressions.
2022-06-02Add missing direct dependenciesKlaus Aehlig
2022-05-31"enumerate" expression: add padding to 10 charactersKlaus Aehlig
2022-05-30Built-in expressions: add enumerateKlaus Aehlig
Add a function transforming a list into a map. In this way, artifacts collected positionally in a list can easily be realized as a stage used for input to an action or output of a target.
2022-05-12Ensure we also correctly handle tree conflicts between filesKlaus Aehlig
Not only trees, but also regular files can disallow paths reaching into them. If we have a file at a/b then another file at a/b/c is a staging conflict as well. Make our tool recognize this.
2022-05-09Built-in "to_subdir": interpret input keys as pathKlaus Aehlig
... and detect conflicts araising this way. Also normalize the paths after staging them to the specified subdir.
2022-05-09Verify conflict-freeness in inputs, artifacts, and runfilesKlaus Aehlig
Our maps serve two purposes: on the one hand, they can be a generic key-value association with arbitrary strings as keys. On the other hand, we use them to describe arrangements of files (inputs to actions, artifacts or runfiles generated). In this function, certain keys refer to the same path and hence have to be identifed. Therefore, at places where the keys clearly have to be paths in the file system, implicitly normalize them and check for conflicts.
2022-05-09Move path normalisation to a separate libraryKlaus Aehlig
... as it will be required outside the target map.
2022-05-04install: normalize dir pathsOliver Reiche
2022-04-27Allow for better error reporting in case of a malformed targetAlberto Sartori
The expected size of the list that defines the target was not checked consistently. So, in case a target expected a list with 4 elements, but got just 3, a segfault would happen. This patch resolves this issue.
2022-04-26doc strings: support documentation of the resultKlaus Aehlig
A complete documentation of a rule should not only include how to use it (i.e., which fields are present and what is their meaning) but also what the result is. This is particularly true, as the result is structured and can contain some complex logic or conventions in the provided information.
2022-04-26bug fix: FileRoot::DirectoryEntries cannot hold std::monostate anymoreAlberto Sartori
DirectoryEntries must be constructed explicitly either via a GitTree* or an unordered_map<string,ObjectType>. So, the case of an empty directory, is represented by an empty map. Before this patch, empty directories were represented by std::monostate and missing checks on that led to a seg-fault.
2022-04-25Progress reporting: include origins of running actionsKlaus Aehlig
For a user, an important information is to know which actions are currently running and, more importantly, the target that caused them. To do so, we need a bit of infrastructure. - We have to keep track of begin and end of running actions, as well as the order in which they were started. That has to happen efficiently and in a thread-safe way. - We have to compute and keep the origin map for actions, even if we don't serialize the action graph.
2022-04-25expression: add "msg" argument to "to_subdir"Klaus Aehlig
... allowing to provide additional information in case of conflict during flat staging.
2022-04-20Remove unused "+" on expressionsKlaus Aehlig
To concatenate lists (the only ability the "+" operator had), use "++".
2022-04-19Conflict checking: use normalized pathsKlaus Aehlig
2022-04-07expression evaluation: clean up truth valuesKlaus Aehlig
For historic reasons, we considerd special strings as false values. Drop that behavior in favor of a clean LISP-like semantics: everything is true that is not empty.
2022-04-07implement new built-in target TREEAlberto Sartori
2022-04-07refactor FileRoot::DirectoryEntriesAlberto Sartori
... to foster the implementation of the built-in target "TREE"
2022-04-05Rule map: "import" is no a reserved key word of a ruleKlaus Aehlig
... so remove it from the list of expected keys.
2022-03-30Eliminate duplicated code in ParseEntityName{FromJson,FromExpression}Alberto Sartori
This patch introduces a templated ParseEntityName which can accept a json or ExpressionPtr. Internally, performs a proper dispatch on these cases - isString - isList - size == 2 - size >= 3 A test is added for checking the proper handling of an empty list
2022-03-29refactor EntityNameAlberto Sartori
EntityName now clearly expresses its double identity: - NamedTarget - AnonymousTarget The usage of std::variant<NamedTarget,AnonymousTarget> guarantees that EntityName, internally, is not a mix of the two - like could happen before this patch. NamedTarget features an enum ReferenceType to express the type of the target, namely, "normal target" or an "explicit file reference". Thanks to this refactoring, the introduction of new targets type should be easier, since the design is more modular. NamedTarget
2022-03-25don't check bounds twiceAlberto Sartori
2022-03-23Apply changes suggested by clang-tidy 11Oliver Reiche
2022-03-23Apply changes suggested by clang-format 11Oliver Reiche
2022-03-16Format: Apply compact JSON formattingOliver Reiche
2022-03-04rule_map: improve error message by proper quotingKlaus Aehlig
Our rule names can be arbitrary strings, so improve readability of error message by properly quoting the rule name; while there, also properly quote the module name, resulting in better readability if the module is "".
2022-03-02expression language: add a range functionKlaus Aehlig
Given a number or number representation, return a list of that length consisting of representations of the lower numbers. In this way, repeated non-pure actions can be generated (e.g., repetitions of a test to detect flakyness).
2022-03-01Add a message after consolidating the analysis resultKlaus Aehlig
On the one hand, this message is after an important step in the build process, to giving the user a better insight into what is going on. On the other hand, the size of the discovered graph is useful information, e.g., when comparing with the number of actions actually traversed when building the requested artifacts.
2022-03-01Pass actions and trees in analysis result as shared pointerKlaus Aehlig
... to avoid unnecessary copying and moving of larger objects.
2022-02-25Format: Apply alphabetical include orderOliver Reiche
2022-02-22Initial self-hosting commitKlaus Aehlig
This is the initial version of our tool that is able to build itself. In can be bootstrapped by ./bin/bootstrap.py Co-authored-by: Oliver Reiche <oliver.reiche@huawei.com> Co-authored-by: Victor Moreno <victor.moreno1@huawei.com>