summaryrefslogtreecommitdiff
path: root/src/buildtool/build_engine
AgeCommit message (Collapse)Author
2022-12-07Built-in rules: add a tree ruleKlaus Aehlig
... so that for every construct supported in rules there is an analogous one as a built-in rule to allow ad-hoc constructions without having to write a rule (even though writing a rule is recommended for everything occuring more than once): - the "generic" rule allows an ad-hoc ACTION, - the "file_gen" rule allows an ad-hoc BLOB, - the "tree" rule allows an an ad-hoc TREE, and - the "configure" rule allows an ad-hoc configuration transition.
2022-12-07file_gen rule: fix computation of effective configurationKlaus Aehlig
The dependencies requested in order to read their "outs" or "runfiles" also contribute to the effective configuration.
2022-11-21Use the newly-added concept of private-depsKlaus Aehlig
While there, also add all direct dependencies explicitly; using directly dependencies that are pulled in only indireclty causes problems from a maintainability point of view.
2022-11-16Fix effective configuration computation in configureKlaus Aehlig
While the built-in "configure" rule is forwarding the result of the configured target, its own effective configuration is not that of the configured target. The effective configuration is defined to be that part of the incoming configuration that can potentially influence the result of that target; in particular, this includes variables read in defining the configuration transition.
2022-11-16Make "config" accept a computed targetKlaus Aehlig
... and thus allowing the "business logic" in the configuration target (e.g., setting defaults and derived options) to be shared by many targets.
2022-10-18TargetResult: Serialise inner TargetResults flatOliver Reiche
Before this change, TargetResults that appear inside of other TargetResults (typically via value nodes) were serialised via the top-level serialisation function for TargetResults. While technically correct, it is rather inefficient as identical expressions from outer and inner TargetResults are not properly deduplicated and a deeply nested data structure is maintained. With this change, expressions of inner TargetResults are serialised in the context of outer TargetResults, resulting in a flat list of all transitively contained expressions with proper deduplication applied. As this serialisation of TargetResult is used in target-level cache entries, the new format is a breaking change to existing entries. Therefore, after switching to the new serialisation format introduced by this commit, users are required to clean their target-level cache. This also reverts commit d22adef666d704680ee74b35a46d530f6b6d5f15, "Recursively scan provided results for known artifacts".
2022-10-14Recursively scan provided results for known artifactsSascha Roloff
This recursive scan of the provided results map of a target-cache entry for known artifacts is required since the serialization format of target results currently does not produce a single flat artifact list, but keeps the result entry structure with a nested list of artifacts. Once the serialization format of target results is changed in a way that a flat list of artifacts is produced, this recursive scan is not required anymore and can be reverted.
2022-10-14Remove default value of ArtifactDigest::Create template parameterSascha Roloff
This enforces the explicit specification, which object type, either file or tree, should be used to create an artifact digest. This also avoids subtile errors at locations as in the previous commit, where files as well as trees are supposed to be handled, but digest creation mistakenly defaults to file object type.
2022-10-12Add copyright and license notice to all source and header filesKlaus Aehlig
Signed-off-by: Goetz Brasche <goetz.brasche@huawei.com>
2022-10-11Scan provides map of target-cache entries for known artifactsSascha Roloff
2022-10-11configure builtin: Fix segfault on evaluation errorOliver Reiche
2022-10-05built-ins: Add new built-in rule 'configure'Oliver Reiche
2022-10-05Expr: Add 'env' expressionOliver Reiche
2022-10-05AnalysedTarget: Make shared pointer's content immutableOliver Reiche
... while technically not required, it makes it harder to run into nasty errors.
2022-09-16Also log dumping of the action graphKlaus Aehlig
... at INFO level, in the same way as all other dumping of analysis results happen.
2022-09-13Fix build with gcc/g++Oliver Reiche
2022-09-13Fix wrongful conversions of object to arraysOliver Reiche
... by dropping curl-brace-initializers for nlohmann::json, which calls the intializer-list constructor converting any JSON type to array.
2022-09-12Removed prefix from execution backend hash to fix target cache directory nameSascha Roloff
2022-09-12Adapted TargetCache to download known artifacts from remote CAS to local CASSascha Roloff
2022-08-31Also track the the dependencies on configured targetsKlaus Aehlig
... to be able to report the respective graph for later analysis by other tools.
2022-08-23Track tree references that have to be expandedKlaus Aehlig
... as this is relevant for performance of analysis. We log the total numer of trees at performance level and the individual directories at debug level, if requested.
2022-08-19Add glob reference to source filesKlaus Aehlig
Like file or tree references, globs are restricted to the current module; in fact, by the way we evaluate them, even to the top-level directory of that module: a glob is a target having as artifacts and runfiles those entries of the top-level directory of the specified module that match the given pattern.
2022-08-19directory_map: correctly resolve module names to directoriesKlaus Aehlig
When constructing module names, we normalize the directory path implicit in it. However, we take the empty string as valid canonical name for the top-level directory (as it is the empty relative path). When accessing git roots, however, only the file-system canonical path "." is special cased as self reference. Hence explicitly convert the empty string.
2022-08-05Target map makes use of known trees and avoids directory traversalSascha Roloff
2022-08-05Modified artifact digest to provide wire digest on demandSascha Roloff
2022-07-05ResultMapTargetMap: support looking up an action by identifierKlaus Aehlig
2022-07-04Drop copy constructor from linked mapsOliver Reiche
2022-07-04Drop copy constructor for expressionsOliver Reiche
2022-07-04Improve move semantics with smart pointersOliver Reiche
2022-06-29Error reporting: also abbreviate the expression in the stack traceKlaus Aehlig
... to the same limit as the values occuring in the stack.
2022-06-29Use a more meaningful abbreviation of expression valuesKlaus Aehlig
... in error messages. The outer structure is usually more important than the the details of the first element.
2022-06-28Support more verbose error reportingKlaus Aehlig
2022-06-28Generic: add support for out_dirsAlberto Sartori
Before this patch, the built-in "generic" type allowed for just output files, listed in the field "outs". Now, the type also supports output directories, listed in the "out_dirs" field. The output directories are created before the command is executed.
2022-06-28sort and deduplicate outputs before creating the actionAlberto Sartori
2022-06-28improve error message when outpus are not disjointAlberto Sartori
2022-06-20Correctly serialize and deserialize results and nodesKlaus Aehlig
So far, our serialisation and deserialisation assumed that no node or result values are included contained in the given value. However, for nodes (and hence ressults, given our implementation of value nodes) there is a legitimate use case. An abstract interface specification, given by provided nodes, can well be a meaningful target to be exported. Implement serialisation for those values. Also, avoid tree-unfolding the value when deserialising the value by appropriately caching the corresponding expression pointers. Moreover, avoid the quadratic overhead through linearly searching through the list of artifacts.
2022-06-20analysed targets: artifacts can also be contained in nodes and resultsKlaus Aehlig
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