summaryrefslogtreecommitdiff
path: root/src/buildtool/common/cli.hpp
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-06-12Add a flag to `gc` command: `--all`Maksim Denisov
2025-05-15Make --dump-artifacts-to-build act cummulativelyKlaus Aehlig
2025-04-25just: make --dump-artifacts act cummulativelyKlaus Aehlig
2025-03-10Add basic --profile option to justKlaus Aehlig
... so far only keeping track basic properties of the invocation. Still, the code is already organized to support future extensions; in particular, we do not have to rely on the Profile class being copyable.
2025-03-10Make graph-dumping options cummulativeKlaus Aehlig
If --dump-graph or --dump-plain-graph is given several times, the action graph wil also be written several times. In this way, regular use of those options will not be affected by adding them implicitly through invocation-logging options in the rc file.
2025-02-25just serve: allow clients to access execution endpoint with a different addressAlberto Sartori
To properly use `just serve`, both the client and the serve instance must talk to the very same execution endpoint. Typically, both the client and serve can reach out to the execution endpoint via the same IP address. However, it might be possible that the client and a serve instance know the same execution endpoint by means of differnet IP addresses. For example, the client knows the execution endpoint address through an _external_ IP address, while the serve instance, deployed within the same network infrastructure, only knows the _internal_ IP address. This patch adds the subkey `"client address"` -- of the key `"execution endpoint"` -- in the serve configuration file, to specify the alternative pair `address:port` used by the client.
2025-02-14just add-to-cas: Enable --resolve-special optionPaul Cristian Sarbu
2025-01-09just build: add new option -pKlaus Aehlig
... allowing to print the unique artifact built (if any). This allows convenient inspection of the build result of targets that define precisely one artifact.
2024-12-09analysis: Support artifact build argumentsPaul Cristian Sarbu
As analysis now can compute roots, i.e., can build artifacts, it needs to support setting the local launcher, action timeout, and the build jobs. The stage and rebuild arguments, which are also needed by the graph traversal, as well as other build-related arguments, remain not supported for the analysis subcomamnd, however they remain honored if set by subcommands that trigger an implicit analysis (e.g., build or install).
2024-11-14common: Implement IWYU suggestionsPaul Cristian Sarbu
2024-10-08just analyse: support dumping the action graph without originsKlaus Aehlig
The origins of actions are useful for understanding the action graph; if, however, the action graph is only to be used for further computaiton, this is unnecessary information. Therefore, add an option to dump the action graph without origins.
2024-10-07Enable readability-redundant-member-init check.Maksim Denisov
2024-09-13Remove Compatibility flag from justMaksim Denisov
2024-09-13Rename Compatibility class to ProtocolTraitsMaksim Denisov
...and move it to the common stage.
2024-08-07Replace classic C boolean operators with keywordsMaksim Denisov
! => not; && => and, || => or
2024-07-22cli: Make info_file type consistentPaul Cristian Sarbu
Both the serve and execution servers store the info_file and pid_file as strings, to be used for reading via std::ofstream. Read info_file then also as string, like pid_file is.
2024-07-19just: Fix operation cache threshold exponent maximum valuePaul Cristian Sarbu
The threshold exponent cannot pass the log2 of the maximum internal map size, of type size_t, thus it cannot be larger than 63. Update the documentation and enforce the upper limit of this argument during parsing of the command line.
2024-04-24just analyse: add --dump-result command line optionAlberto Sartori
The result of the analysis is a JSON object containing the keys `"artifacts"`, `"runfiles"`, and `"provides"`. This JSON object, by default, is logged. However, it might be useful to process the data contained in it, while, for example, developing new rules. This patch adds a new command line option (`--dump-result`), reserved to the subcommand `analyse`, to dump the analysis result to the given file or stdout (if `-` is given).
2024-04-18Move retry-related CLI parts into separate librariesKlaus Aehlig
... to simplify reuse.
2024-04-16just: support writing the error blobs from serve into a json fileKlaus Aehlig
... so that they are available in machine-readable form. In this way, all logs can automatically be collected without the need of parsing human-targeted error messages.
2024-04-10Add command-line option to restrict log limit on stderrKlaus Aehlig
2024-04-10bugfix: cli: remote-execution-property: allow for accumulating multiple pairs.Alberto Sartori
Before this patch, if the option `--remote-execution-property KEY:VAL` is repeated multiple times (also with different `KEY`s), only the last one is taken into account. This patch fixes the intended behavior.
2024-03-28just install-cas: add option --archiveKlaus Aehlig
Trees are first-class objects for justbuild. To allow interoperation with other tools, it is necessary to provide those objects in a standard format; for directories, those are archives. Hence procive a corresponding option.
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-20Add new subcommand add-to-casKlaus Aehlig
2024-03-20Add data-structure specific for adding files to CASKlaus Aehlig
2024-03-11gc: add option --no-rotationKlaus Aehlig
... to clean up what can be done without losing cache information.
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-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-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-09-13just serve: Add endpoint argumentsPaul Cristian Sarbu
2023-09-13just: Add handling of 'just serve' configurationPaul 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-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-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-24just install{,-cas}: add --remember optionKlaus Aehlig
... asking just to transfer everyting installed to the local CAS first.
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-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-18authentication: add TLS and mTLS supportAlberto Sartori