From 082de35ad7419bb965a8f1d0226318c7fc0e85fd Mon Sep 17 00:00:00 2001 From: Ryan Blue Date: Sun, 6 Jul 2025 09:28:56 -0400 Subject: [PATCH] [bazel] Set remote cache header to prevent redirects (#8065) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Doesn’t fully fix the issue but improves things. --- .bazelrc | 2 ++ .github/actions/setup-artifactory-bazel/action.yml | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index 14df04a23e..63bbc01292 100644 --- a/.bazelrc +++ b/.bazelrc @@ -44,6 +44,8 @@ build:base_remote --nolegacy_important_outputs common:base_remote_readonly --noremote_upload_local_results build:artifactory_readonly --config=base_remote_readonly build:artifactory_readonly --remote_cache=https://frcmaven.wpi.edu/artifactory/wpilib-generic-cache-bazel-local +# workaround for https://github.com/bazelbuild/bazel/issues/17700 +build:artifactory_readonly --remote_cache_header=X-JFrog-Download-Redirect-To=None # Build Buddy Cache Setup build:build_buddy --bes_results_url=https://app.buildbuddy.io/invocation/ diff --git a/.github/actions/setup-artifactory-bazel/action.yml b/.github/actions/setup-artifactory-bazel/action.yml index cab0e682f9..f2be1fb149 100644 --- a/.github/actions/setup-artifactory-bazel/action.yml +++ b/.github/actions/setup-artifactory-bazel/action.yml @@ -26,4 +26,5 @@ runs: shell: bash run: | echo "API Key detected!" - echo "build:base_remote --remote_cache=https://${{ inputs.username }}:${{ inputs.token }}@frcmaven.wpi.edu/artifactory/wpilib-generic-cache-bazel-local" > bazel_auth.rc + # X-JFrog-Download-Redirect-To is a workaround for https://github.com/bazelbuild/bazel/issues/17700 + echo "build:base_remote --remote_cache=https://${{ inputs.username }}:${{ inputs.token }}@frcmaven.wpi.edu/artifactory/wpilib-generic-cache-bazel-local --remote_cache_header=X-JFrog-Download-Redirect-To=None" > bazel_auth.rc