summaryrefslogtreecommitdiff
path: root/src/buildtool/build_engine
AgeCommit message (Collapse)Author
2024-04-11configured target: support short representationKlaus Aehlig
... with only the non-null entries of the configuration. This information is enough for the user to build this target, e.g., when searching for the cause of a build failure.
2024-04-08Use properly included standard library types by defaultPaul Cristian Sarbu
2024-04-08Consistently guard all POSIX C includesPaul Cristian Sarbu
2024-04-05User-defined rules: annotate revelant objects relevant to evaluation errors.Klaus Aehlig
2024-04-05Evaluator: Add infrastructure to annotate relevant objectsKlaus Aehlig
... which are, in particular, artifacts involved in staging conflicts. While there, also make disjoint union honor the expression log limit.
2024-04-05built-in rules: describe staging conflict in more detailKlaus Aehlig
Mentioning in particular the involved artifacts as well as the direct dependencies that brought them in. Here, we are in a simple situation as all built-in rules that check conflicts only use artifacts and runfiles of their dependencies, but not the provided data. Also, the built-in rules that check staging conflicts do not do configuration transitions, hence it is enough to show the target name of the dependencies containing the artifact if for the built-in target we show the configuration.
2024-04-05bug fix in expresion, Union: propagate the disjointness propertyKlaus Aehlig
To avoid too many intermediate results, we compute the union of a list in a divide and conquer fashion. Of course, for a disjoint union, the recursive calls on the lists of half the length have to be disjoint as well, i.e., the template parameter kDisjoint has to be passed on. Fix this.
2024-03-26Add missing system includesPaul Cristian Sarbu
Main culprits: - std::size_t, std::nullptr_t, and NULL require <cstddef> - std::move and std::forward require <utility> - unordered maps and sets require respective includes - std::for_each and std::all_of require <algorithm>
2024-03-26Expression language: add float operations "*" and "+"Klaus Aehlig
Numerical values are used at some places in justbuild: as value for timeout scaling, as well as by the "range" expression that is used, e.g., to define repreated test runs. Therefore, improve support for numerical values by adding basic operations.
2024-03-22Absent target: deduplicate serve calls asking for flexible variablesKlaus Aehlig
For an absent export target, the first step of analysis is to ask serve for the flexible variables. The answer to this request is, however, independent of the configuration for this target. So we can avoid calls by caching the answer in an additional map.
2024-03-22Avoid unnecessary calls to serve for export targetsKlaus Aehlig
For export targets, we know ahead of time the effective configuration; so, if the current configuration is not the effective anyway, we can simply analyse the effective configuration and take that result. In this way, we can avoid calls to serve if a target is analysed in two configurations that coincide on the flexible variables.
2024-03-22Avoid unnecessary analysis of export targetsKlaus Aehlig
For export targets, we know ahead of time the effective configuration; so, if the current configuration is not the effective anyway, we can simply analyse the effective configuration and take that result. As a side effect, we also count the number of observed export targets correctly.
2024-03-19serve target: Differentiate between fatal and non-fatal orchestrated buildsPaul Cristian Sarbu
...by increasing granularity in client-side reporting. This allows to correctly continue with builds of local targets if the serve endpoint does not have the requested target, as well as improve the reporting for users on failure.
2024-03-19result_map: Be explicit in logging location when getting results...Paul Cristian Sarbu
...by allowing a Logger instance to be provided.
2024-03-15Clean up more includes and targetsPaul Cristian Sarbu
Some of the more specific issues addressed: - missing log_level target/include - header-only libs wrongly marking deps as private - missing/misplaced gsl includes
2024-03-12Export-target progress reporting: report the target nameKlaus Aehlig
... with effective config instead of the actual cache key, which is simply a blob identifier that is probably not so meaningful for the user watching the build.
2024-03-12target evalution: handle error in dependency evaluationKlaus Aehlig
... instead of blindly assuming the evaluation succeeds. Co-authord-by: Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com>
2024-03-12just serve: Improve progress reportingPaul Cristian Sarbu
During analysis it is useful to track and report the progress for all export targets. This is not exclusively linked to a serve endpoint being present, despite most of the time being expected to be spent in export targets being served from the remote endpoint. This commit refactors the current implementation to give proper feedback to the user on the progress of the analysis phase.
2024-03-11target_map: Typo fix in log messagePaul Cristian Sarbu
2024-03-11just: Replace singletons for progress tracking and statistics...Paul Cristian Sarbu
...with regular instances that have controlled life-times. This avoids race conditions in tracking and reporting the results of analysis and build, as the serve endpoint can orchestrate multiple builds at the same time asynchronously. As a bonus side-effect this also ensures the correctness of the progress reporting per orchestrated build.
2024-03-11just analyse: Use explicit target cache instancePaul Cristian Sarbu
The serve endpoint always has to access the correctly sharded target cache, including during analysis. For this purpose, the target cache instance interrogated during analysis has to be explicitly provided.
2024-03-07absent_target_map: Improve log messagesPaul Cristian Sarbu
2024-02-29expressions: add kFalseKlaus Aehlig
2024-02-16async maps: Create utility library to handle cycle detectionPaul Cristian Sarbu
2024-02-14expression map: properly wrap logger for import callsKlaus Aehlig
... to provide an informative error message on how a rule is related to a particular import and, in particularly, at which expression a problem with the import occurred. While there, also improve the message in the other error case to follow our standard line-breaking scheme.
2024-02-08rule_map: improve error reportingKlaus Aehlig
By showing the full entity name and also adding the usual newline character after every "While ..." clause.
2024-02-08NamedTarget: support ToString()Klaus Aehlig
2024-02-08JsonFileMap: refuse to read absent rootKlaus Aehlig
... instead of erroring on missing file. In this way, whenever a rule or expression from an absent root would have to be read, we get a meaningful error message and not a complaint about a file not being there.
2024-02-08Target map: on error in rule look up, report the rule being looked forKlaus Aehlig
2024-01-31just serve: Cleanup logging to remove tool namePaul Cristian Sarbu
Also cleans up the logging when parsing the serve service configuration file.
2024-01-16Analysed target: keep track of implied export targetsKlaus Aehlig
... that are eligible for caching. In this way, we can accurately keep track of the dependencies between target-level cache entries. Note that it is enough to track the export targets eligible for caching, as no target depending on an ineligible export target can be eligible.
2023-12-20just: Query serve endpoint during analysis for non-cached export targetsPaul Cristian Sarbu
2023-12-20directory_map: refuse to read contents of absent rootsKlaus Aehlig
While in our setting, a missing directory is generally OK, it is not OK to ask for the content of an absent root. In particular, we should not assume it to be empty, just because the root is absent.
2023-12-14target_map: Remove unneeded method to perform endpoint consistency checkPaul Cristian Sarbu
As we already have a good enough API call and in order to improve specificity in log messages, there is no need for one more level of abstraction. This will also make it easier to drop in the future this check (if deemed unnecessary anymore), while keeping in place the mandatory check that a serve endpoint has been configured.
2023-12-12just: Report progress of export targets served during analysisPaul Cristian Sarbu
2023-12-12absent_target_map: Improved loggingPaul Cristian Sarbu
2023-12-05serve target client: Ensure repository key blob is also in remote CASPaul Cristian Sarbu
2023-11-30Resolve inconsistencies in third-party headers include formatPaul Cristian Sarbu
2023-11-27Refactoring RepositoryConfigPaul Cristian Sarbu
With the introduction of 'just serve', export targets can now be built also independently from one another based on their corresponding minimal repository configuration, as stored in the target cache key. In this context, this commit changes the RepositoryConfig usage from one global (static) instance to pointers passed as necessary throughout the code.
2023-11-17built-in "install" rule: verify well-formedness of resulting stageKlaus Aehlig
The install target, like any other target, has to have artifacts and runfiles being proper stages, i.e., in such a way that the keys can be interpreted as names in the file system without causing conflicts. This property used to be unchecked, thus allowing users to define mal-formed targets that, when used as inputs to actions, would result in unspecified layout of the action directory. Fix this by adding an appropriate check enforcing well-formedness of the resulting stage.
2023-11-15define AbsentTargetMap for handling export targets in absent repositoriesAlberto Sartori
2023-10-27Base export target chache key on the exported targetKlaus Aehlig
The cache key for an export target should contain as target name that of the export target (and its effective configuration) rather than the exported target. As we computed the repository part of the cache key for the target included in the key, this was still a correct cache key except in the case an explicit file reference was exported (as here, the information that the file was to be taken rather than the target of the same name got lost). We still fix this issue by making the implementation match our design (rather than by including the file-reference bit in the cache key), as the original design gives the cleaner protocol for target-level caching as a service.
2023-09-01fmt: Fix includes to only bring in the core APIPaul Cristian Sarbu
There is no need to use the full format API, so avoid increasing the compile time gratuitously.
2023-08-28Extend built-in "generic" rule to allow setting "sh"Klaus Aehlig
2023-08-24LinkedMap: Simplify ::Find() methodsOliver Reiche
... to silence false-positive 'possible dangling reference' warning produced by gcc 13.2.0.
2023-08-23target_map: Use iterators instead of pointer arithmeticOliver Reiche
2023-08-14expression: add new built in "reverse"Klaus Aehlig
While a foldl is enough to implement a reverse functionality, adding it as a built in allows doing so in linear time.
2023-08-14expression: add new built in "set"Klaus Aehlig
... to obtain from a list of strings a map with those entries as keys and true as value. In this way, repeated membership tests in lists can be implemented more efficiently.
2023-08-14expressions: add constant for trueKlaus Aehlig
2023-08-10built-in: Add 'symlink' rulePaul Cristian Sarbu
The rule generates a non-upwards symbolic link with given target path.