[8.8.0] Expand tree artifact inputs from metadata in the compact execution log - #30830
Merged
Conversation
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
marked this pull request as ready for review
August 21, 2026 16:05
iancha1992
enabled auto-merge
August 21, 2026 18:49
coeuvre
approved these changes
Aug 25, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Aug 25, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Aug 25, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Aug 25, 2026
iancha1992
enabled auto-merge
August 25, 2026 20:28
Merged
via the queue into
bazelbuild:release-8.8.0
with commit Aug 25, 2026
e5d31d4
42 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
RemoteActionFileSystemhas no entries for it either. Logging a spawn that has such a tree artifact as an input then fails the action withsince
expandDirectoryreaddirs 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
TreeArtifactValueinstead. 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
Release Notes
RELNOTES: Fixed a build failure with
--execution_log_compact_filewhen a C++ action template has no inputs.Closes #30816.
PiperOrigin-RevId: 968391836
Change-Id: Id05a603a4e1987eef2c50d7722a8ee5955530e83
(cherry picked from commit df9ab4f)
8.8.0 adaptation:
InputMetadataProviderhas nogetTreeMetadataon this branch, so the pick adds one. It is keyed on the exec path rather than theActionInputso that the existingActionInputMap#getTreeMetadata(PathFragment)implements it as is, and it defaults tonull, 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,DelegatingPairInputMetadataProviderandActionExecutionContext.OverriddenRunfilesPathInputMetadataProvider.internalToUnicodedoesn't exist on this branch either, so paths are used as is, matching the surrounding code.Closes #30818