summaryrefslogtreecommitdiff
path: root/src/buildtool/build_engine
AgeCommit message (Collapse)Author
2023-02-28expression map: improve error messageKlaus Aehlig
... by providing the fully-qualified name of an expression that could not be found.
2023-02-22cleanup: Fix typos in code line comments and logging messagesPaul Cristian Sarbu
2023-02-14targets: fix deps structurePaul Cristian Sarbu
2023-01-20Add local garbage collectionSascha Roloff
2023-01-20Move execution-backend-id calculation from target-level cache to local configSascha Roloff
This code movement is required to break a cyclic dependency coming with the introduction of the garbage collector. target_cache depends on garbage_collector and garbage_collector would depend on target_cache to determine the target-level-cache directory. After moving this calculation to a more general location, the cycle is broken.
2023-01-20Introduce multiple cache generationsSascha Roloff
2023-01-20Configured target uses entity_name_data.hpp instead of entity_name.hppSascha Roloff
This usage of a different header file is required to break a cyclic dependency coming with the introduction of the garbage collector. entity_name implicitly depends on local_cas, which will get a new dependency to garbage_collector. garbage_collector depends on target_cache_entry, which transitively depends on entity_name. entity_name_data instead does not depend on local_cas and breaks the cycle.
2023-01-20Move file_storage.hpp to file_system subdirectorySascha Roloff
2023-01-20Refactor target cache key and entry to separate files and targetsSascha Roloff
2023-01-20generic built-in rule: fix typo in error messageKlaus Aehlig
2023-01-12source map: quote file names in error messageKlaus Aehlig
... to ensure unique readability even with file names containing spaces or other special symbols; those kind of fancy file names typically occur when a string intended as named target is implicitly taken as a file (e.g., due to a spelling error). While there, also include directory and repository in the error message.
2022-12-22export targets: identify as such in result_mapKlaus Aehlig
Make export targets identify themselves in the result_map, so that we have accurate knowledge of the export targets seen.
2022-12-22result_map: also keep track of export targetsKlaus Aehlig
Allow in the addition of a target to the result map to indicate that it was an export target; in this way, the information is available as a result of the analysis.
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