Skip to content

[8.8.0] Expand tree artifact inputs from metadata in the compact execution log - #30830

Merged
iancha1992 merged 2 commits into
bazelbuild:release-8.8.0from
fmeum:cp-8.8.0-30816
Aug 25, 2026
Merged

[8.8.0] Expand tree artifact inputs from metadata in the compact execution log#30830
iancha1992 merged 2 commits into
bazelbuild:release-8.8.0from
fmeum:cp-8.8.0-30816

Conversation

@fmeum

@fmeum fmeum commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

An empty tree artifact whose generating action template expands into no actions is never materialized on disk when a disk or remote cache is in use: nothing creates the directory and the RemoteActionFileSystem has no entries for it either. Logging a spawn that has such a tree artifact as an input then fails the action with

ERROR: Linking _nativedeps/6a5ccd5.so failed: IOException while logging spawn: .../bin/_objs/biome_proto.upb_minitable/iome (No such file or directory)

since expandDirectory readdirs the directory. This happens while logging inputs, which isn't covered by the try/catch around output logging added in #30717.

Expand tree artifacts from their TreeArtifactValue instead. Their contents are already known, so this avoids the traversal entirely and also keeps the log complete for trees whose files aren't materialized locally. Source directories and filesets keep using the filesystem traversal.

Fixes #22920 (comment)

Description

Motivation

Build API Changes

No

Checklist

  • I have added tests for the new use cases (if any).
  • I have updated the documentation (if applicable).

Release Notes

RELNOTES: Fixed a build failure with --execution_log_compact_file when a C++ action template has no inputs.

Closes #30816.

PiperOrigin-RevId: 968391836
Change-Id: Id05a603a4e1987eef2c50d7722a8ee5955530e83

(cherry picked from commit df9ab4f)

8.8.0 adaptation: InputMetadataProvider has no getTreeMetadata on this branch, so the pick adds one. It is keyed on the exec path rather than the ActionInput so that the existing ActionInputMap#getTreeMetadata(PathFragment) implements it as is, and it defaults to null, which keeps the filesystem traversal for providers that can't answer (StaticInputMetadataProvider, SingleBuildFileCache). The providers that a spawn is actually logged with forward to their delegates: ActionInputMetadataProvider, DelegatingPairInputMetadataProvider and ActionExecutionContext.OverriddenRunfilesPathInputMetadataProvider. internalToUnicode doesn't exist on this branch either, so paths are used as is, matching the surrounding code.

Closes #30818

bazelbuild#30816)

An empty tree artifact whose generating action template expands into no actions is never materialized on disk when a disk or remote cache is in use: nothing creates the directory and the `RemoteActionFileSystem` has no entries for it either. Logging a spawn that has such a tree artifact as an input then fails the action with

    ERROR: Linking _nativedeps/6a5ccd5.so failed: IOException while logging spawn: .../bin/_objs/biome_proto.upb_minitable/iome (No such file or directory)

since `expandDirectory` readdirs the directory. This happens while logging *inputs*, which isn't covered by the try/catch around output logging added in bazelbuild#30717.

Expand tree artifacts from their `TreeArtifactValue` instead. Their contents are already known, so this avoids the traversal entirely and also keeps the log complete for trees whose files aren't materialized locally. Source directories and filesets keep using the filesystem traversal.

Fixes bazelbuild#22920 (comment)

### Description

### Motivation

### Build API Changes

No

### Checklist

- [x] I have added tests for the new use cases (if any).
- [ ] I have updated the documentation (if applicable).

### Release Notes

RELNOTES: Fixed a build failure with `--execution_log_compact_file` when a C++ action template has no inputs.

Closes bazelbuild#30816.

PiperOrigin-RevId: 968391836
Change-Id: Id05a603a4e1987eef2c50d7722a8ee5955530e83

(cherry picked from commit df9ab4f)
@fmeum
fmeum marked this pull request as ready for review August 21, 2026 16:05
@fmeum
fmeum requested a review from a team as a code owner August 21, 2026 16:05
@fmeum
fmeum requested a review from tjgq August 21, 2026 16:05
@github-actions github-actions Bot added team-Performance Issues for Performance teams team-Core Skyframe, bazel query, BEP, options parsing, bazelrc awaiting-review PR is awaiting review from an assigned reviewer labels Aug 21, 2026
@iancha1992
iancha1992 enabled auto-merge August 21, 2026 18:49
@iancha1992
iancha1992 requested a review from coeuvre August 24, 2026 15:33
@iancha1992
iancha1992 added this pull request to the merge queue Aug 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 25, 2026
@iancha1992
iancha1992 added this pull request to the merge queue Aug 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 25, 2026
@Wyverald
Wyverald added this pull request to the merge queue Aug 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 25, 2026
@iancha1992
iancha1992 enabled auto-merge August 25, 2026 20:28
@iancha1992
iancha1992 added this pull request to the merge queue Aug 25, 2026
Merged via the queue into bazelbuild:release-8.8.0 with commit e5d31d4 Aug 25, 2026
42 checks passed
@github-actions github-actions Bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-Core Skyframe, bazel query, BEP, options parsing, bazelrc team-Performance Issues for Performance teams

3 participants