feat(package,daemon): show binary variant details; list installed files
This commit is contained in:
1 parent
b8c362917f
commit
27d909fdad
10 files changed
+145
-1
No files matched your search
+28
-1
@@ -54,7 +54,8 @@
|
||||
// The daemon control socket is a POSIX Unix-domain socket (Linux/macOS). Windows support is
|
||||
// planned (Track C3) and would need a named-pipe transport instead.
|
||||
#if defined(_WIN32)
|
||||
#error "The vbs daemon Unix-socket transport requires a POSIX host (Track C3 Windows port is planned)."
|
||||
#error \
|
||||
"The vbs daemon Unix-socket transport requires a POSIX host (Track C3 Windows port is planned)."
|
||||
#endif
|
||||
#include <vector>
|
||||
|
||||
@@ -75,6 +76,8 @@ constexpr std::size_t kMaxDescribeTargetNames = 128U;
|
||||
constexpr std::size_t kMaxDescribeTargetNameBytes = 200U;
|
||||
constexpr std::size_t kMaxDoctorToolPathBytes = 4096U;
|
||||
constexpr std::size_t kMaxBuildTargets = 64U;
|
||||
constexpr std::size_t kMaxInstallFiles = 128U;
|
||||
constexpr std::size_t kMaxInstallPathBytes = 512U;
|
||||
constexpr std::size_t kMaxCompdbArguments = 256U;
|
||||
constexpr std::size_t kMaxCompdbArgumentBytes = 1024U;
|
||||
constexpr std::size_t kMaxCompdbEntries = 500U;
|
||||
@@ -982,6 +985,30 @@ std::string install_project_op(const DaemonOptions &options, State::StateStore &
|
||||
object.emplace("manifest", JsonValue{installed->manifest_path.string()});
|
||||
object.emplace("files",
|
||||
JsonValue{static_cast<std::int64_t>(installed->installed_files.size())});
|
||||
std::vector<std::string> installed_paths;
|
||||
installed_paths.reserve(installed->installed_files.size());
|
||||
for (const auto &file : installed->installed_files) {
|
||||
installed_paths.push_back(file.string());
|
||||
}
|
||||
std::ranges::sort(installed_paths);
|
||||
bool installed_files_truncated = false;
|
||||
if (installed_paths.size() > kMaxInstallFiles) {
|
||||
installed_paths.resize(kMaxInstallFiles);
|
||||
installed_files_truncated = true;
|
||||
}
|
||||
JsonValue::Array installed_files;
|
||||
installed_files.reserve(installed_paths.size());
|
||||
for (auto &path : installed_paths) {
|
||||
if (path.size() > kMaxInstallPathBytes) {
|
||||
path.resize(kMaxInstallPathBytes);
|
||||
installed_files_truncated = true;
|
||||
}
|
||||
installed_files.emplace_back(std::move(path));
|
||||
}
|
||||
object.emplace("installed_files", JsonValue{std::move(installed_files)});
|
||||
if (installed_files_truncated) {
|
||||
object.emplace("installed_files_truncated", JsonValue{true});
|
||||
}
|
||||
return serialize_response(JsonValue{std::move(object)});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user