-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent failures creating output directories (#18062)
I would receive reports of build failures along these lines: > ERROR: some/path/BUILD:156:32: Executing genrule //some/path:some_target failed: failed to create output directory '.../some/path/foo' In order to root cause this, I made a minor change to Bazel to extend its logging. See #17951. With that change applied, the error became: > ERROR: some/path/BUILD:156:32: Executing genrule //some/path:some_target failed: failed to create output directory '.../some/path/foo': .../some/path/foo (Not a directory) I was eventually able to reproduce this by manually creating an output file at bazel-bin/some/path, followed by attempting to build the target. It looks like Bazel simply attempts to create output directories without taking into consideration whether a file already exists at the target location. This is problematic when someone alters an existing build target to emit a directory instead of a regular file. Note that this only an issue when the remote action file system is used. Plain builds (ones that don't use Builds without the Bytes or bb_clientd) are unaffected. This change addresses this issue by reusing the same fallback path creation strategy that plain builds already use. Closes #17968. PiperOrigin-RevId: 523408378 Change-Id: I0d7559352687c317de72e0bf5bc6b5ba7452f97e Co-authored-by: Ed Schouten <[email protected]>
- Loading branch information
1 parent
3775296
commit b9e6f7d
Showing
2 changed files
with
99 additions
and
61 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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