summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/local/local_action.cpp
AgeCommit message (Collapse)Author
9 daysExecutionAPI: Support output_paths in requestsOliver Reiche
... and prepare local execution for clients using only RBEv2.1 (setting only output_paths).
9 daysLocalAction: Fix the use of external loggerOliver Reiche
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-12LocalAction: Fix collection of directory symlinkOliver Reiche
2025-04-22FileSystemManager: Always remove directories recursivelyMaksim Denisov
2025-03-24TmpDir: minor refactoringMaksim Denisov
2025-03-10local actions: return durationKlaus Aehlig
2025-02-20Separate off id generation to a separate libraryKlaus Aehlig
... and rename appropriately to reflect contents more precisely than the generic "common". This separation also disentangles dependencies a bit.
2024-11-14execution_api remaining: Implement IWYU suggestionsPaul Cristian Sarbu
2024-10-08Name local variables using lower_caseMaksim Denisov
...and private members using lower_case_
2024-10-07Enable readability-redundant-member-init check.Maksim Denisov
2024-10-07Enable bugprone-unhandled-exception-at-new check.Maksim Denisov
2024-09-16local execution: Check validity of symlinksPaul Cristian Sarbu
Invalid entries, currently all upwards symlinks (pending implementation of a better way of handling them), are now identified and handled similarly to remote execution: in compatible mode on the client side, during handling of local response, and in native mode during the population of the local action result.
2024-09-13Check compatibility in LocalAPI based on the hash typeMaksim Denisov
2024-09-13Rename Compatibility class to ProtocolTraitsMaksim Denisov
...and move it to the common stage.
2024-09-09Use ArtifactDigest in LocalActionMaksim Denisov
2024-09-09Return ArtifactDigest from CreateActionDigestFromCommandLineMaksim Denisov
2024-08-30Cast ArtifactDigest to bazel_re::Digest explicitlyMaksim Denisov
...to simplify further refactoring.
2024-08-30Replace bazel_re::Digest in BazelMsgFactory (local trees)Maksim Denisov
...with ArtifactDigest.
2024-08-30Replace bazel_re::Digest in LocalACMaksim Denisov
...with ArtifactDigest.
2024-08-01Execution API: support cwdKlaus Aehlig
... following the remote-execution standard that all output paths (but none of the input paths) are relative to the working directory. Therefore, the executor has to do the path translation. For our implementation of the API interface - the local API now handles cwd correctly, - the remote API forwards cwd correctly, and - the git API continues to report actions as not implemented.
2024-07-30Pass LocalContext to LocalApiPaul Cristian Sarbu
The context is passed by not_null const pointer to avoid binding to temporaries. The LocalApi also stores the context as const ref for further access and passing it to LocalAction.
2024-07-16Remove the LocalExecutionConfig singletonPaul Cristian Sarbu
...and replace it with passed instances created early via a builder pattern.
2024-07-16Pass LocalExecutionConfig to LocalAction and LocalApiPaul Cristian Sarbu
2024-07-12Capture in TreeReaders by pointer to avoid temporariesMaksim Denisov
2024-07-12Return std::nullopt if creation of an action digest failsMaksim Denisov
...instead of dereferencing nullptr.
2024-07-05local action: copy input file on reaching symlink limitKlaus Aehlig
... and continue with the newly created copy as target for the next hard links. In this way, we get rid of the restriction we used to have that the number of identical inputs be not greater than the hardlink limit.
2024-07-05Pass StorageConfig and Storage to LocalApiMaksim Denisov
2024-07-05Use StorageConfig functionality via Instance()Maksim Denisov
...to track changes during refactoring easier.
2024-06-07Remove unused codeMaksim Denisov
2024-05-27Use common interface for reading tree entries and leafsMaksim Denisov
...in LocalApi and BazelApi.
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-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-08SystemCommand: Transfer outfile responsibility to callerOliver Reiche
2023-11-22LocalAction: Fix staging of empty treesOliver Reiche
2023-08-24Execution: only take complete actions from cacheKlaus Aehlig
... which are only actions that, besides giving exit code 0 also created all the outputs they promised to.
2023-08-08just execute: Fix uncollected upwards symlinksPaul Cristian Sarbu
Upwards symlinks should still be collected from actions, even if only the non-upwards symlinks are supported artifact types. The client side is thus the one responsible with enforcing the non-upwardness condition.
2023-07-21bugfix: stage symlinks as symlinks when creating an action directoryAlberto Sartori
Before this patch, when creating an action directory, symlinks were staged as regular files.
2023-06-26Allow non-upwards symlinks with local APIPaul Cristian Sarbu
2023-06-26bazel_msg_factory: Allow non-upwards symlinks in uploaded treesPaul Cristian Sarbu
2023-05-23Storage config: also specify the location of the execution rootKlaus Aehlig
As local execution is tightly coupled to storage, also specify the layout in the storage configuration. In this way, we have a central place specifying the layout of just's cache directory and avoid accidentally getting into conflicting situations. While there, also move the execution root under the generation regime, to ensure that left-over execution directories (e.g., after a forceful termination of the program) eventually get cleaned up by garbage collection.
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-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-02-15just-execute: report un-tagged hashesAlberto Sartori
2023-01-20Introduce multiple cache generationsSascha Roloff
2022-11-04Remove unwanted native protocol prefixes from user-visible locationsSascha Roloff
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-11Refactor ReadTreeInfos function names and add documentationSascha Roloff
2022-10-07LocalTreeMap: Prevent tree objects from being storedOliver Reiche
... to align with the original idea of caching a flat list of blob objects, without the need to recursively traverse any trees. Consequently, we cannot create any map entry in places where we do not have all sub-tree entries at hand (e.g., LocalAPI, BazelAPI, BazelResponse).
2022-10-05LocalAction: Improve error message for stagingOliver Reiche