Skip to content

Commit 75c63c3

Browse files
authored
Resolve clippy remote execution build error (#944)
1 parent 696a4e7 commit 75c63c3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

rust/private/clippy.bzl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,10 @@ def _clippy_aspect_impl(target, ctx):
9797
if crate_info.is_test:
9898
args.rustc_flags.add("--test")
9999

100+
# For remote execution purposes, the clippy_out file must be a sibling of crate_info.output
101+
# or rustc may fail to create intermediate output files because the directory does not exist.
100102
if ctx.attr._capture_output[CaptureClippyOutputInfo].capture_output:
101-
clippy_out = ctx.actions.declare_file(ctx.label.name + ".clippy.out")
103+
clippy_out = ctx.actions.declare_file(ctx.label.name + ".clippy.out", sibling = crate_info.output)
102104
args.process_wrapper_flags.add("--stdout-file", clippy_out.path)
103105

104106
# If we are capturing the output, we want the build system to be able to keep going
@@ -107,7 +109,7 @@ def _clippy_aspect_impl(target, ctx):
107109
else:
108110
# A marker file indicating clippy has executed successfully.
109111
# This file is necessary because "ctx.actions.run" mandates an output.
110-
clippy_out = ctx.actions.declare_file(ctx.label.name + ".clippy.ok")
112+
clippy_out = ctx.actions.declare_file(ctx.label.name + ".clippy.ok", sibling = crate_info.output)
111113
args.process_wrapper_flags.add("--touch-file", clippy_out.path)
112114

113115
# Turn any warnings from clippy or rustc into an error, as otherwise

0 commit comments

Comments
 (0)