summaryrefslogtreecommitdiff
path: root/src/buildtool/build_engine
AgeCommit message (Collapse)Author
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.
2023-07-10target map: Add missing return statement when rule name is not foundPaul Cristian Sarbu
2023-06-26Add non-upwards symlinks in the rule language...Paul Cristian Sarbu
via a 'SYMLINK' constructor function. This works similarly to the 'FILE' construct, but the name given must point to a non-upwards symlink and a symlink artifact is being generated from it. Also updates the relevant tests.
2023-06-26FileRoot: Add handling of non-upwards symlink...Paul Cristian Sarbu
...and update tests accordingly.
2023-06-22generic target: support execution propertiesKlaus Aehlig
2023-06-22genric target: support timeout scalingKlaus Aehlig
2023-06-22generic rule: fix error handling for "env"Klaus Aehlig
After a fatal error, do not continue evaluation, but return immediately.
2023-06-15ACTION constructor: accept "execution properties"Klaus Aehlig
Allow rules to set (additional) execution properties for individual action. In this way the need for a special image (e.g., with additional, maybe test-only, tools) or execution platform (e.g., when cross-compiling but having to execute the tests on the native platform) can be expressed.
2023-06-15action data structure: support (additional) execution propertiesKlaus Aehlig
2023-06-06style: Use designated initializersPaul Cristian Sarbu
This feature has been introduced with C++20.
2023-05-31utils: Relocate the std::filesystem::hash_value libc fix...Paul Cristian Sarbu
...and make the use of std::hash consistent. This will make it easier to remove the fix once the libc implementation we use catches up with the C++ standard.
2023-05-31ACTION constructor: accept "timeout scaling"Klaus Aehlig
Allow rules to set the timeout-scaling factor for their actions to indicate that some actions are expected to take longer than others, e.g., because they call a foreign build tool or are a very complex end-to-end test.
2023-05-31action data structure: support timeout-scaling factorKlaus Aehlig
2023-04-26imports: Switch to Microsoft GSL implementationOliver Reiche
... with two minor code base changes compared to previous use of gsl-lite: - dag.hpp: ActionNode::Ptr and ArtifactNode::Ptr are not wrapped in gsl::not_null<> anymore, due to lack of support for wrapping std::unique_ptr<>. More specifically, the move constructor is missing, rendering it impossible to use std::vector<>::emplace_back(). - utils/cpp/gsl.hpp: New header file added to implement the macros ExpectsAudit() and EnsureAudit(), asserts running only in debug builds, which were available in gsl-lite but are missing in MS GSL.
2023-04-26just-mr: Fix warning about unused lambda captureOliver Reiche
2023-04-26evaluator: Improve evaluation error reportingOliver Reiche
2023-04-04disjoint_map_union: show conflicting values on errorKlaus Aehlig
2023-03-30Improve error messages on reading invalid target filesKlaus Aehlig
... by including the details of the parse error.
2023-03-13Storage: Reworked storage and garbage collectionOliver Reiche
The improved GC implementation uses refactored storage classes instead of directly accessing "unknown" file paths. The required storage class refactoring is quite substantial and outlined in the following paragraphs. The module `buildtool/file_system` was extended by: - `ObjectCAS`: a plain CAS implementation for reading/writing blobs and computing digests for a given `ObjectType`. Depending on that type, files written to the file system may have different properties (e.g., the x-bit set) or the digest may be computed differently (e.g., tree digests in non-compatible mode). A new module `buildtool/storage` was introduced containing: - `LocalCAS`: provides a common interface for the "logical CAS", which internally combines three `ObjectCAS`s, one for each `ObjectType` (file, executable, tree). - `LocalAC`: implements the action cache, which needs the `LocalCAS` for storing cache values. - `TargetCache`: implements the high-level target cache, which also needs the `LocalCAS` for storing cache values. - `LocalStorage`: combines the storage classes `LocalCAS`, `LocalAC`, and `TargetCache`. Those are initialized with settings from `StorageConfig`, such as the build root base path or number of generations for the garbage collector. `LocalStorage` is templated with a Boolean parameter `kDoGlobalUplink`, which indicates that, on every read/write access, the garbage collector should be used for uplinking across all generations (global). - `GarbageCollector`: responsible for garbage collection and the global uplinking across all generations. To do so, it employs instances of `LocalStorage` with `kDoGlobalUplink` set to false, in order to avoid endless recursion. The actual (local) uplinking within two single generations is performed by the corresponding storage class (e.g., `TargetCache` implements uplinking of target cache entries between two target cache generations etc.). Thereby, the actual knowledge how data should be uplinked is implemented by the instance that is responsible for creating the data in the first place.
2023-03-13TargetCache: Drop dependency on execution apiOliver Reiche
2023-03-13TargetCache: Drop dependency on repository configOliver Reiche
2023-03-10Update nlohmann::json to 3.11.2Klaus Aehlig