summaryrefslogtreecommitdiff
path: root/src/buildtool/common
AgeCommit message (Collapse)Author
2024-02-16ArtifactDigest: Hashing the object should not take size into accountPaul Cristian Sarbu
As it is common to use ArtifactDigest objects with a default value of 0, the std::hash implementation should not take the size into account. The is_tree member however should be kept in as it always needs to have a value and has no sensible default.
2024-01-31dispatch file parsing: Improve std::variant usagePaul Cristian Sarbu
2023-12-21remote/client_common.hpp: add utility functions for logging status of rpc callsAlberto Sartori
2023-12-14just describe: Improve cli description and code documentation of --json optionPaul Cristian Sarbu
2023-12-14just analyse: support dumping the provides map of a targetKlaus Aehlig
2023-12-13Add command line options to tune the retry strategy for rpc callsAlberto Sartori
Three new command line options have been added: - `--max-attempts` - `--initial-backoff-seconds` - `--max-backoff-seconds`
2023-12-13Add a retry lib that provides useful wrappers to allow to retry...Alberto Sartori
...the provided function until either the function succeeds, maximum number of attempts is reached or the function returns an error indicating that we cannot simply retry. It is meant to be used with rpc calls, but the logic can be applied to other scenarios.
2023-12-12execution_api: Move dispatch file parser into separate utilityPaul Cristian Sarbu
2023-12-12Fix formatting of blob used to shard target cachePaul Cristian Sarbu
The ToJson method of RemoteAddress was wrongly creating a list instead of a simple string, thus a wrongly formatted backend description was being used to shard the target cache. This however does not affect the correctness of the build. Changelog also updated accordingly.
2023-12-06install-cas cli: Remove remote execution properties and dispatch file...Paul Cristian Sarbu
...options from the generated help messages, as these are not used for the install-cas subcommand. This also updates the man page accordingly, where the dispatch file was marked as supported, as well as update any test affected by these changes.
2023-12-06Add CLI option to set write strategy for target-level cacheKlaus Aehlig
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-16Add -R as short option for --remote-serve-addressKlaus Aehlig
The `just serve` command defaults to also provide the remote-execution endpoint if none is specified. The `just build` implicitly uses the serve endpoint as remote-execution endpoint if no other endpoint is specified. In this way, the serve endpoint has become the universal endpoint for simple set ups. Simplify that usage further by providing a short command-line option.
2023-11-15artifact.hpp: make ToJson and FromJson consistentAlberto Sartori
The function ToJson used `file_type` key to express the type of the artifact, on the other hand, FromJson was expecting `type`. This patch makes the two functions consistent, prefering `file_type` for historical reasons.
2023-11-02Decoupling symlinks map and CAS utilities from just-mrPaul Cristian Sarbu
This is required in order to make them available to 'just serve' in a minimal just installation.
2023-09-22RemoteServeConfig: Remove problematic inheritancePaul Cristian Sarbu
This was causing the remote serve address to overwrite the one set for remote execution. Also, to keep things clean, some common remote server-related methods and definitions were moved into their own library.
2023-09-13just serve: Add endpoint argumentsPaul Cristian Sarbu
2023-09-13just: Add handling of 'just serve' configurationPaul Cristian Sarbu
2023-09-13remote: Extract port parsing in own libraryPaul Cristian Sarbu
2023-09-13remote: Extract common client implementation utils in own libraryPaul Cristian Sarbu
2023-07-27Add option -P to just-install-casKlaus Aehlig
... to allow selecting a sub object of a specified tree.
2023-07-05Add CLI argument to dispatch endpointKlaus Aehlig
In this way, the user can specify which execution endpoint to use depending on the execution properties.
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-06-05just: improve error reporting on missing pwdKlaus Aehlig
... also, gracefully handle the case of a missing working directory when determining the current module, falling back to the top-level module.
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-04clean up targets filesKlaus Aehlig
- deduplicate dependencies - remove unused dependency
2023-03-24just install{,-cas}: add --remember optionKlaus Aehlig
... asking just to transfer everyting installed to the local CAS first.
2023-03-23targets: Fix deps structurePaul Cristian Sarbu
2023-03-15bazel api: fix include of proto files...Alberto Sartori
...bazel_types.hpp just requires the messages, not the grpc related services and classes
2023-03-15add missing ldflags -pthread and use -pthread consistentlyAlberto Sartori
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-13Artifact: No user error on object info parse failOliver Reiche
2023-03-10Move common defaults for just and just-mr into a separate libraryKlaus Aehlig
... and, in this way, avoid duplication of these constants that might lead to inconsistencies between those two tools later.
2023-03-10execution service: implement WaitExecution and ↵Alberto Sartori
google::longrunning::Operations::GetOperation For each action that is executed, an entry is added to a shared thread safe cache. Once the number of operations stored exceeds twice 2^n, where n is given by the option --log-operations-threshold, at most 2^n operations will be removed, in a FIFO scheme.
2023-03-02just: make -D options overlayKlaus Aehlig
... instead of only honoring the latest argument. In this way, standard overlays coming from the launcher configuration can be amended in individual invocations.
2023-02-27Logging: Add --log-append clarg to justPaul Cristian Sarbu
2023-02-22cleanup: Fix typos in code line comments and logging messagesPaul Cristian Sarbu
2023-02-15CLI: enforce maximal number of positional argumentsKlaus Aehlig
..., i.e., the requirement that the positional arguments form a syntactically valid target name. An explicit error message (created by the target-name parsing) is preferrable over tacitly dropping all but the last up to two arguments (which is the meaning of CLI11's expected(2)). While there, drop duplicate full stop in error message.
2023-02-02execution-service: add new subcommand executeAlberto Sartori
This subcommand starts a single node remote execution service honoring the just native remote protocol. If the flag --compatible is provided, the execution service will honor the original remote build execution protocol. New command line args supported by this subcommand: -p,--port INT: Execution service will listen to this port. If unset, the service will listen to the first available one. --info-file TEXT: Write the used port, interface, and pid to this file in JSON format. If the file exists, it will be overwritten. -i,--interface TEXT: Interface to use. If unset, the loopback device is used. --pid-file TEXT Write pid to this file in plain txt. If the file exists, it will be overwritten. --tls-server-cert TEXT: Path to the TLS server certificate. --tls-server-key TEXT: Path to the TLS server key. Co-authored by: Klaus Aehlig <klaus.aehlig@huawei.com>
2023-02-01Update fmtlib to version 9.1.0Klaus Aehlig
Co-authored-by: Michael Thies <mail@mhthies.de>
2023-01-20Add gc subcommandSascha Roloff
2023-01-20Cleanup local CAS dependency for repository configSascha Roloff
2023-01-18authentication: add TLS and mTLS supportAlberto Sartori
2022-12-22Add option --dump-export-targetsKlaus Aehlig
... dumping only the configured targets that are export targets. Those targets are of particular interest as those are the targets, as they are the high-level caching points and also often serve as interface between projects.
2022-12-07just: Allow multiple log filesPaul Cristian Sarbu
2022-12-07just: Fix typos in command descriptions (--help)Paul Cristian Sarbu
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.