From afb6e412f0b9160fc65c67464cd0a897c2378c87 Mon Sep 17 00:00:00 2001 From: Cornelius Riemenschneider Date: Thu, 18 Jul 2024 08:52:04 +0200 Subject: [PATCH] pkg.bzl: Disable remote caching of zipmerge steps. --- misc/bazel/pkg.bzl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/misc/bazel/pkg.bzl b/misc/bazel/pkg.bzl index 5b91783510f..62c2ee19945 100644 --- a/misc/bazel/pkg.bzl +++ b/misc/bazel/pkg.bzl @@ -140,6 +140,16 @@ def _zipmerge_impl(ctx): executable = ctx.executable._zipmerge, inputs = depset(zips, transitive = transitive_zips), arguments = args, + # Disable remote caching for zipmerge: + # * One of the inputs to zipmerge (often the larger one) comes from a lazy-lfs rule. + # Those are retrieved by bazel even in the presence of a build cache, so downloading the whole zipmerged + # artifact is slower than downloading the smaller bazel-produced zip and rerunning zipmerge on that + # and the (already-present) LFS artifact. + # * This prevents unnecessary cache usage - every change to the Swift extractor would otherwise + # trigger a build of a >500MB zip file that'd quickly fill up the cache. + execution_requirements = { + "no-remote-cache": "1", + }, ) return [