diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-12-09 12:53:50 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-12-09 17:38:22 +0100 |
commit | 992fa11457486eaa2be7ce58ee8bd4f7d5642021 (patch) | |
tree | a2a9b8639937db1ed38d1d141b6a705faffcc25d /src | |
parent | 344c00f1a63b628a0dff9335e106e005766c7d2f (diff) | |
download | justbuild-992fa11457486eaa2be7ce58ee8bd4f7d5642021.tar.gz |
Computed roots: only install artifacts
... however, also build the runfiles, as they are needed to write the
target-level cache for the underlying export target.
Diffstat (limited to 'src')
-rw-r--r-- | src/buildtool/computed_roots/TARGETS | 1 | ||||
-rw-r--r-- | src/buildtool/computed_roots/analyse_and_build.cpp | 16 | ||||
-rw-r--r-- | src/buildtool/computed_roots/analyse_and_build.hpp | 2 |
3 files changed, 12 insertions, 7 deletions
diff --git a/src/buildtool/computed_roots/TARGETS b/src/buildtool/computed_roots/TARGETS index 4ad06d17..768bf15b 100644 --- a/src/buildtool/computed_roots/TARGETS +++ b/src/buildtool/computed_roots/TARGETS @@ -15,6 +15,7 @@ , "stage": ["src", "buildtool", "computed_roots"] , "private-deps": [ ["src/buildtool/build_engine/target_map", "result_map"] + , ["src/buildtool/common", "artifact_description"] , ["src/buildtool/logging", "log_level"] , ["src/buildtool/main", "build_utils"] , ["src/buildtool/multithreading", "task_system"] diff --git a/src/buildtool/computed_roots/analyse_and_build.cpp b/src/buildtool/computed_roots/analyse_and_build.cpp index 48bf1998..f8a18cec 100644 --- a/src/buildtool/computed_roots/analyse_and_build.cpp +++ b/src/buildtool/computed_roots/analyse_and_build.cpp @@ -15,9 +15,12 @@ #include "src/buildtool/computed_roots/analyse_and_build.hpp" #include <functional> +#include <map> #include <utility> +#include <vector> #include "src/buildtool/build_engine/target_map/result_map.hpp" +#include "src/buildtool/common/artifact_description.hpp" #include "src/buildtool/logging/log_level.hpp" #include "src/buildtool/main/build_utils.hpp" #include "src/buildtool/multithreading/task_system.hpp" @@ -61,14 +64,13 @@ TaskSystem ts{jobs}; analysis_result->result_map.Clear(&ts); } + auto extra_artifacts = CollectNonKnownArtifacts(cache_targets); + for (auto const& [name, desc] : runfiles) { + extra_artifacts.emplace_back(desc); + } - auto build_result = - traverser.BuildAndStage(artifacts, - runfiles, - actions, - blobs, - trees, - CollectNonKnownArtifacts(cache_targets)); + auto build_result = traverser.BuildAndStage( + artifacts, {}, actions, blobs, trees, std::move(extra_artifacts)); if (not build_result) { if (logger != nullptr) { diff --git a/src/buildtool/computed_roots/analyse_and_build.hpp b/src/buildtool/computed_roots/analyse_and_build.hpp index a5cba540..aea4fc89 100644 --- a/src/buildtool/computed_roots/analyse_and_build.hpp +++ b/src/buildtool/computed_roots/analyse_and_build.hpp @@ -31,6 +31,8 @@ struct AnalyseAndBuildResult { GraphTraverser::BuildResult build_result; }; +// Analyse and build a given target; however, install only the artifacts, +// ignoring the runfiles. [[nodiscard]] auto AnalyseAndBuild( gsl::not_null<AnalyseContext*> const& analyse_context, GraphTraverser const& traverser, |