summaryrefslogtreecommitdiff
path: root/src/buildtool/file_system/file_root.hpp
AgeCommit message (Collapse)Author
2025-06-16Ensure equality operators are really noexcept.Klaus T. Aehlig
... by explicitly catching any possible exception. Mainly to make clang-tidy happy. ...
2025-06-04directory_map: Correctly report fatal on failures to read from workspace rootsPaul Cristian Sarbu
2025-06-04FileRoot: Improve documentationPaul Cristian Sarbu
2025-06-04FileRoot: Ensure all read blobs and trees contain valid entriesPaul Cristian Sarbu
In particular, ensure that Git roots check for, e.g., upwards symlinks, before returning blobs and trees. To ensure that only the bear minimum extra work is performed for this purpose, Git roots now keep also the root's GitTreeEntry as a field, allowing the validity check of root source trees to take place only once and only if required.
2025-06-04FileRoot: Small format fixPaul Cristian Sarbu
2025-06-04FileRoot: Give git-based roots access to storage configPaul Cristian Sarbu
2025-03-05FileSystemManager: Let caller decide log level for reading directoryPaul Cristian Sarbu
Do not emit errors when it does not lead to build failures. Callers handle the log level at which failures of this method should be logged.
2024-12-19FileRoot: disclose RootGit data.Maksim Denisov
2024-12-19Remove FileRoot::ComputedRootMaksim Denisov
2024-12-19Use PrecomputedRoots during evaluationMaksim Denisov
2024-12-19Support PrecomputedRoots in FileRootMaksim Denisov
2024-12-09Use expected to return an error from ParseRootMaksim Denisov
2024-11-21FileRoot::ComputedRoot: add ToString() methodKlaus Aehlig
2024-11-21Add data structure for the description of a computed rootKlaus Aehlig
2024-11-14file_system: Implement IWYU suggestionsPaul Cristian Sarbu
2024-10-08Name local variables using lower_caseMaksim Denisov
...and private members using lower_case_
2024-10-08Name classes, structs and enums using CamelCase.Maksim Denisov
2024-10-07Enable readability-* checks.Maksim Denisov
2024-10-07Enable bugprone-empty-catch check.Maksim Denisov
2024-09-13Pass HashFunction::Type to FileRoot::AsKnownTreeMaksim Denisov
...to get the protocol type.
2024-09-13Pass HashFunction::Type to SourceTargetMapMaksim Denisov
...that is to be used by FileRoot::ToArtifactDescription.
2024-09-13Rename Compatibility class to ProtocolTraitsMaksim Denisov
...and move it to the common stage.
2024-09-13Move to GitHashesConverter functionality related to conversion of git hashesMaksim Denisov
...from Compatibility.
2024-09-11Use ArtifactDigestFactory in file_rootMaksim Denisov
...to create ArtifactDigests.
2024-07-12Use static Create functions to construct ArtifactDescriptionMaksim Denisov
...instead of unobvious ctors relying on overload resolution.
2024-07-12Move implementation details of ArtifactDescription to the cpp fileMaksim Denisov
2024-05-17FileRoot: Fix parsing of ignore-special Git tree rootsPaul Cristian Sarbu
When populating the GitTree instance stored in a Git tree-type FileRoot with the ignore-special flag set, the GitTree instance would be created with an empty raw_id_ field, signaling that some of the entries might have been skipped and thus the root tree id is not anymore in a one-to-one correspondence with the stored list of entries. This however caused FileRoot instances with missing tree id information. This commit fixes the issue by always storing the raw_id_ field as the root id of the Git tree, as well as clarifying the relationship between this field and the ignore_special_ flag, including refactoring the tree id getters.
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
2023-12-05FileRoot: Add ignore-special flag getter and remove unneeded inliningPaul Cristian Sarbu
2023-12-05just main: Move root parser into static FileRoot method...Paul Cristian Sarbu
...to make it available also for setting up 'just serve' builds.
2023-11-30FileRoot: Fix content description for ignore-special rootsPaul Cristian Sarbu
Ignore-special git-tree-based roots are still content defined, so one should use the correct marker in the JSON description of the root that will be stored in the repository description of target cache keys. This commit fixes the issue and improves documentation.
2023-11-15FileRoot: Add new absent root underlying type variantPaul Cristian Sarbu
Absent roots are characterised only by a Git tree hash, so a new variant of the underlying stored information was added in the form of a plain string. In order to avoid unwanted implicit conversions when instantiating via literal strings, we force callers of the constructors to explicitly differentiate between plain strings and filesystem paths. Existing tests were updated to reflect this. Co-authored-by: Alberto Sartori <alberto.sartori@huawei.com>
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-11Git: Fix handling of symlinks in tree artifactsPaul Cristian Sarbu
The introduction of non-upwards symlinks as first-class objects should have updated the handling of known git tree artifacts containing symlinks. In particular, one should consider trees in their entirety when uploading (irrespective of the ignore_special flag), and git trees should only be reported as known only if the ignore_special flag is set to false.
2023-06-26FileRoot: Add handling of non-upwards symlink...Paul Cristian Sarbu
...and update tests accordingly.
2023-06-26ObjectType: Add non-upwards symlinks as a known object type...Paul Cristian Sarbu
...but make sure it is still considered a special type. The only non-special entry types remain file, executable, and tree.
2023-05-31just: Add handling of ignore-special rootsPaul Cristian Sarbu
2023-05-31FileRoot: Add ignore-special roots logicPaul Cristian Sarbu
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-01-24FileSystemManager: Do not follow symlinksOliver Reiche
... and ensure that cascades of checks are performed with only a single filesystem stat per method.
2022-10-12Add copyright and license notice to all source and header filesKlaus Aehlig
Signed-off-by: Goetz Brasche <goetz.brasche@huawei.com>
2022-08-05Allow to read git trees from global CAS as well as local workspace rootSascha Roloff
2022-08-05Directory entries can detect themselves as known trees and return according ↵Sascha Roloff
description
2022-08-05Modified artifact digest to provide wire digest on demandSascha Roloff
2022-06-13FileRoot: support content descriptionKlaus Aehlig
For some file roots, in particular git trees, we can give a complete selfcontained description of the content without accessing any external resources. For those, add a method to return such a complete description that will be used to compute the keys of content-defined repositories.
2022-04-26bug fix: FileRoot::DirectoryEntries cannot hold std::monostate anymoreAlberto Sartori
DirectoryEntries must be constructed explicitly either via a GitTree* or an unordered_map<string,ObjectType>. So, the case of an empty directory, is represented by an empty map. Before this patch, empty directories were represented by std::monostate and missing checks on that led to a seg-fault.
2022-04-21add compatibility with original remote build protocolAlberto Sartori
2022-04-07refactor FileRoot::DirectoryEntriesAlberto Sartori
... to foster the implementation of the built-in target "TREE"
2022-02-22Initial self-hosting commitKlaus Aehlig
This is the initial version of our tool that is able to build itself. In can be bootstrapped by ./bin/bootstrap.py Co-authored-by: Oliver Reiche <oliver.reiche@huawei.com> Co-authored-by: Victor Moreno <victor.moreno1@huawei.com>