summaryrefslogtreecommitdiff
path: root/src/buildtool/main/build_utils.cpp
AgeCommit message (Collapse)Author
2025-06-16Avoid unnecessary work in accessing container entriesPaul Cristian Sarbu
- in sequence containers, use operator[] instead of .at() when accessing indices guaranteed to be in bound; - in associative containers, prefer .find() and reusing the returned const iterator to using .contains() and .at(); while there, make any so obtained iterators const if they are read-only.
2025-05-30WriteTargetCacheEntries: do not use quadratic many jobsKlaus Aehlig
When backing up target-cache entries we use parallelism at two dimensions, the independent cache entries and for each entry we retrieve the artifacts in parallel. If for each dimension we use the full amount of parallelism allowed, that gives a number of threads up to the square of the amount of parallelism specified by the user. Therefore, use in each dimension only the square root of the allowed parallelism keeping the total parallelism (up to rounding) within the specified range.
2025-02-19ApiBundle: Remove HashFunction.Maksim Denisov
And ensure every user obtains HashFunction from corresponding IExecutionApi
2024-11-14main: Implement IWYU suggestionsPaul Cristian Sarbu
2024-09-11Use HashFunction::Type to deserialize ArtifactDescriptionMaksim Denisov
2024-08-07Replace classic C boolean operators with keywordsMaksim Denisov
! => not; && => and, || => or
2024-06-25Pass IExecutionApi to IExecutionApi by referenceMaksim Denisov
...instead of not_null const ptr.
2024-06-25Pass ApiBundle to add-to-cas and install-casMaksim Denisov
2024-06-06tc writing: allow different log levelKlaus Aehlig
... for failures instead of the binary strict_logging. In this way, we can log at log level Error in the serve instance, and for the client at level Warning or Info, depending on whether failure is expected (i.e., if targets are potentially taken from a serve endpoint) or not.
2024-06-06tc cache: abort writing if a dependent target is not availableKlaus Aehlig
After successful build of an export target target a cache entry is written. As those export targets have a dependency structure, care is taken to write them in correct order. Writing a cache entry for an export target requires knowledge of the analysis result of that target. Originally, all targets used to be analysed locally, so that information was available for every target that was not read from the local target cache already. However, with the introduction of serve endpoints, it can happen that a target was analyzed locally, but it depends on targets obtained from serve. In this case, we have to refrain from writing a target-level cache entry to keep the the consistency invariants of the target-level cache.
2024-03-19serve target: Fix sharding inconsistenciesPaul Cristian Sarbu
When running in single node, serve endpoint should not even consider sharding. Additionally, garbage collection uplinking should also take the shard into account. For this purpose, a TargetCache instance now remembers if it was explicitly sharded and passed that information to the GarbageCollector for uplinking.
2024-03-19WriteTargetCacheEntries: Be explicit in logging location...Paul Cristian Sarbu
...by allowing a Logger instance to be provided. Also adds a flag in order for failed artifacts from builds orchestrated by the serve endpoint to be able to be reported as errors instead of warnings.
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-02-16export targets: Enforce the invariant when writing target cache entriesPaul Cristian Sarbu
We ensure that for each export target to be written to the target cache all its implied export targets are written to the target cache first. This ensures that the target cache maintains its consistency at all times with respect to export target dependencies.
2023-12-12build_utils: Be specific in target cache entry store location...Paul Cristian Sarbu
...by specifying which TargetCache instance to use. This will allow 'just serve' to store target cache entries into the correct sharded location.
2023-12-06Add CLI option to set write strategy for target-level cacheKlaus Aehlig
2023-12-05target-cache writing: support different strategiesKlaus Aehlig
2023-12-05just main: Move useful results processing methods to own libraryPaul Cristian Sarbu