File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,8 @@ def rustdoc_compile_action(
48
48
toolchain ,
49
49
crate_info ,
50
50
output = None ,
51
- rustdoc_flags = []):
51
+ rustdoc_flags = [],
52
+ is_test = False ):
52
53
"""Create a struct of information needed for a `rustdoc` compile action based on crate passed to the rustdoc rule.
53
54
54
55
Args:
@@ -57,6 +58,7 @@ def rustdoc_compile_action(
57
58
crate_info (CrateInfo): The provider of the crate passed to a rustdoc rule.
58
59
output (File, optional): An optional output a `rustdoc` action is intended to produce.
59
60
rustdoc_flags (list, optional): A list of `rustdoc` specific flags.
61
+ is_test (bool, optional): If True, the action will be configured for `rust_doc_test` targets
60
62
61
63
Returns:
62
64
struct: A struct of some `ctx.actions.run` arguments.
@@ -102,7 +104,7 @@ def rustdoc_compile_action(
102
104
attr = ctx .attr ,
103
105
file = ctx .file ,
104
106
toolchain = toolchain ,
105
- tool_path = toolchain .rust_doc .path ,
107
+ tool_path = toolchain .rust_doc .short_path if is_test else toolchain . rust_doc . path ,
106
108
cc_toolchain = cc_toolchain ,
107
109
feature_configuration = feature_configuration ,
108
110
crate_info = rustdoc_crate_info ,
Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ def _rust_doc_test_impl(ctx):
116
116
toolchain = find_toolchain (ctx ),
117
117
crate_info = crate_info ,
118
118
rustdoc_flags = rustdoc_flags ,
119
+ is_test = True ,
119
120
)
120
121
121
122
tools = action .tools + [ctx .executable ._process_wrapper ]
You can’t perform that action at this time.
0 commit comments