Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions bazel-bep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Based on [crate](https://crates.io/crates/bazel-bep), [repo](https://github.com/

Original protos found [here](https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto)

The protos in `proto/` are from **Bazel 9.0.1**.

## Updating Protos for New Bazel Versions

### Current Situation
Expand All @@ -27,14 +29,11 @@ When a new Bazel version is released, follow these steps to update the proto def
- Check the [Bazel releases page](https://github.com/bazelbuild/bazel/releases) for the latest version
- The proto files are located in the Bazel repository at:
- `src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto`
- `src/main/java/com/google/devtools/build/lib/buildeventstream/proto/action_cache.proto`
- `src/main/java/com/google/devtools/build/lib/buildeventstream/proto/command_line.proto`
- `src/main/java/com/google/devtools/build/lib/buildeventstream/proto/failure_details.proto`
- `src/main/java/com/google/devtools/build/lib/buildeventstream/proto/package_load_metrics.proto`
- `src/main/java/com/google/devtools/build/lib/buildeventstream/proto/publish_build_event.proto`
- `src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_events.proto`
- `src/main/java/com/google/devtools/build/lib/buildeventstream/proto/option_filters.proto`
- `src/main/java/com/google/devtools/build/lib/buildeventstream/proto/invocation_policy.proto`
- `src/main/java/com/google/devtools/build/lib/packages/metrics/package_load_metrics.proto`
- `src/main/protobuf/`: `action_cache.proto`, `command_line.proto`, `failure_details.proto`, `invocation_policy.proto`, `option_filters.proto` and `strategy_policy.proto`
- `third_party/googleapis/google/devtools/build/v1/`: `build_events.proto` and `publish_build_event.proto`
- Every file sits directly in `bazel-bep/proto/`, so rewrite each `import "src/main/…/<name>.proto"` to `import "<name>.proto"`.
- A new proto package needs a module in `src/lib.rs`, as `blaze.strategy_policy` has.

2. **Download the updated proto files**

Expand Down
28 changes: 23 additions & 5 deletions bazel-bep/proto/action_cache.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ syntax = "proto3";

package blaze;

option java_package = "com.google.devtools.build.lib.actions.cache";
option java_outer_classname = "Protos";

// Information about the action cache behavior during a single build.
message ActionCacheStatistics {
// Size of the action cache in bytes.
Expand All @@ -30,13 +33,24 @@ message ActionCacheStatistics {

// Reasons for not finding an action in the cache.
enum MissReason {
DIFFERENT_ACTION_KEY = 0;
DIFFERENT_DEPS = 1;
DIFFERENT_ENVIRONMENT = 2;
DIFFERENT_FILES = 3;
DIFFERENT_ACTION_KEY = 0; // currently not used

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should copy these verbatim from source imo, without the annotations here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are verbatim. The // currently not used comments are Bazel's: src/main/protobuf/action_cache.proto at 9.0.1, lines 36–39. Our copy matches it byte for byte.

I diffed all eight files against Bazel 9.0.1. The only lines that differ are the import paths: import "src/main/protobuf/option_filters.proto" becomes import "option_filters.proto", because every file sits directly in bazel-bep/proto/ and build.rs compiles with proto/ as the only include root. The README's update steps now say so.

DIFFERENT_DEPS = 1; // currently not used
DIFFERENT_ENVIRONMENT = 2; // currently not used
DIFFERENT_FILES = 3; // currently not used

// A cache entry was found, but it was corrupted and we ignored it.
CORRUPTED_CACHE_ENTRY = 4;

// No cache entry was found.
NOT_CACHED = 5;

// Unconditional execution was requested.
UNCONDITIONAL_EXECUTION = 6;

// A cache entry was found, but it contained a different digest.
// This could be due to a change in the command line, input or output file
// paths or contents, environment variables, or certain build flags.
DIGEST_MISMATCH = 7;
}

// Detailed information for a particular miss reason.
Expand All @@ -56,5 +70,9 @@ message ActionCacheStatistics {
// action cache has not been loaded in this invocation.
uint64 load_time_in_ms = 6;

// NEXT TAG: 7
// Time spent waiting for the cache hit semaphore. Reported as 0 if the
// semaphore was not used.
uint64 cache_check_semaphore_wait_time_in_ms = 7;

// NEXT TAG: 8
}
Loading
Loading