feat(cache): add shared HTTP action cache and parallel snapshot hashing
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 4s

- D1: RemoteCasClient + registry /api/v1/cas endpoints with bearer auth and digest verification, StateStore remote action/blob APIs, build-path-independent action keys, --remote-cache CLI
- D2: parallel snapshot revalidation hashing via Void::Concurrency::ThreadPool
- Verified in Docker GCC 16: 8/8 CTest suites, cross-build-dir 100% cache hit, 5001-file warm no-op 374 ms
- Fix self-host recipe source list for RemoteCache.cpp and accept GCC 16 -lgcc_s_asneeded
This commit is contained in:
faumaray committed 2026-12-03 12:36:21 +03:00
1 parent 6c225c2dff
commit 09c0a91d1d
19 files changed
+1213 -18

No files matched your search

+22
View File
@@ -502,6 +502,8 @@ struct BuildCmdOptions {
std::optional<std::string> editor_profile;
std::optional<std::string> compiler_arg;
std::optional<std::string> jobs_arg;
std::optional<std::string> remote_cache_arg;
std::optional<std::string> remote_cache_token_env;
bool no_cache{false};
bool locked{false};
bool offline{false};
@@ -591,6 +593,21 @@ int execute_build_or_test(BuildCmdOptions opts, bool run_tests) {
return 1;
}
const std::string remote_cache_url =
opts.remote_cache_arg
? *opts.remote_cache_arg
: std::string{Void::Configuration::get_env_or("VBS_REMOTE_CACHE", "")};
if (!remote_cache_url.empty()) {
State::RemoteCacheConfig remote_cfg;
remote_cfg.url = remote_cache_url;
const std::string token_env = opts.remote_cache_token_env
? *opts.remote_cache_token_env
: std::string{"VBS_REMOTE_CACHE_TOKEN"};
remote_cfg.bearer_token = Void::Configuration::get_env_or(token_env, "");
state->configure_remote_cache(std::move(remote_cfg));
Void::Log::info("Cache", "Using shared remote action cache at {}", remote_cache_url);
}
const auto lock_path = project_root / "vbs.lock";
auto pinned_lock = Package::load_pinned_lock(lock_path);
if (!pinned_lock) {
@@ -1980,6 +1997,11 @@ int main(int argc, char **argv) {
.option_many("--build-source", "", "Additional build description source",
build_opts.extra_build_sources)
.option("--jobs", "-j", "Maximum parallel compilation/link jobs", build_opts.jobs_arg)
.option("--remote-cache", "", "Shared HTTP action cache URL (or VBS_REMOTE_CACHE)",
build_opts.remote_cache_arg)
.option("--remote-cache-token-env", "",
"Environment variable holding the remote cache bearer token",
build_opts.remote_cache_token_env)
.flag("--locked", "", "Require existing up-to-date vbs.lock", build_opts.locked)
.flag("--offline", "", "Disallow network fetches", build_opts.offline)
.flag("--no-cache", "", "Bypass action cache reads", build_opts.no_cache)