bazelbuild / bazelbuild/bazel

Feature Request: Add flag to disable build event protocol uploads to remote cache when using --remote_cache

Open
#25,867 3 comments 0 reactions 0 assignees View on GitHub
team-Remote-Exec type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the feature request:

We’re using Bazel with --remote_cache enabled for build optimization and also need the Build Event Protocol (BEP) file json for post-processing and reporting.
```
--build_event_json_file=some/path/file.json
```
the generated BEP file’s artifacts also get uploaded to the remote cache, which we want to avoid. We would like a flag to explicitly disable BEP uploads to the remote cache, even when remote caching is enabled.

Tried using ```---noremote_upload_local_results``` doesn't stop uploading the build events.

This flag would:

- Ensure BEP artifacts are only written locally, not uploaded to the remote cache.
- Respect the configured --build_event_json_file, --build_event_binary_file, or --build_event_text_file.
- Be orthogonal to --remote_cache usage.

### Which category does this issue belong to?

Remote Execution

### What underlying problem are you trying to solve with this feature?

We have a large number of developers using a shared remote cache. While we want everyone to **read from the remote cache** for performance, we **do not want each developer's build events (BEP artifacts, logs, etc.) to be uploaded** to the remote cache. This leads to unnecessary storage usage, cache pollution, and increased network load.

So, the problem is: **there's no clean way to generate build event files locally while preventing their upload to the remote cache when `--remote_cache` is enabled**. We want to decouple BEP generation from cache uploads.

### Which operating system are you running Bazel on?

Windows

### What is the output of `bazel info release`?

release 8.1.1

### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.

_No response_

### What's the output of `git remote get-url origin; git rev-parse HEAD` ?

```text

```

### Have you found anything relevant by searching the web?

_No response_

### Any other information, logs, or outputs that you want to share?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by tracing the --remote_cache and --noremote_upload_local_results handling alongside the --build_event_json_file, --build_event_binary_file, and --build_event_text_file entry points. Determine where BEP artifacts are sent to the remote cache and define the new flag's behavior so those files remain local while cache reads continue. Done means the behavior is covered for the requested Windows Bazel configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.