Skip to content

executor: return untouched output directories from the input root in strict mode - #53

Merged
dzbarsky merged 1 commit into
hermeticbuild:mainfrom
rafikk:rafikk/ukwyzvroonou
Oct 20, 2026
Merged

dzbarsky merged 1 commit into
hermeticbuild:mainfrom
rafikk:rafikk/ukwyzvroonou

Conversation

@rafikk

@rafikk rafikk commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Bazel adds every declared output directory (tree artifact) to the input root as an empty directory (bazelbuild/bazel#15366, MerkleTreeComputer). In actiondfs_strict mode outputs are collected from the stage only, so an output directory the action never writes into is silently skipped and Bazel fails with mandatory output <path> was not created.

This breaks rules_go's nogo on every package: RunNogo declares a <pkg>_nogo directory that it only writes into when an analyzer suggests fixes.

Per the REAPI spec, ActionResult.output_directories must contain an entry for each requested output directory that "existed after the action completed", so the empty directory should be returned. BuildBuddy and Buildbarn both do this because they collect outputs from the merged input/output tree.

Change

  • OutputParentValidator.validate now walks the full output path and reports whether the path itself is a directory in the input root. Parent conflict checks (input file/symlink as an output parent) are unchanged.
  • In strict mode, validateOutputParentsAgainstInputsWithCancellation collects those paths during the existing validation pass, and they are created in the stage before execution. actiondfs already merges staged and input directories, so the action's view is unchanged, and the directory is now collected like any other staged output.
  • Output directories that are not in the input root are still not created, so this keeps the spec's "parents only" rule and the existing prepareOutputParents test.
  • Overlay mode (mutates_inputs) is unaffected; its collection path already sees input directories.

@dzbarsky
dzbarsky merged commit 5a0335c into hermeticbuild:main Oct 20, 2026
0 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants