File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -644,7 +644,8 @@ def collect_inputs(
644644 Args:
645645 ctx (ctx): The rule's context object.
646646 file (struct): A struct containing files defined in label type attributes marked as `allow_single_file`.
647- files (list): A list of all inputs (`ctx.files`).
647+ files (struct): A struct of all inputs (`ctx.files`). When aspects are involved, the rule context
648+ may not correspond to a rust target, so check that files attributes are present before accessing them.
648649 linkstamps (depset): A depset of CcLinkstamps that need to be compiled and linked into all linked binaries.
649650 toolchain (rust_toolchain): The current `rust_toolchain`.
650651 cc_toolchain (CcToolchainInfo): The current `cc_toolchain`.
@@ -717,7 +718,7 @@ def collect_inputs(
717718
718719 # The old default behavior was to include data files at compile time.
719720 # This flag controls whether to include data files in compile_data.
720- if not toolchain ._incompatible_do_not_include_data_in_compile_data :
721+ if hasattr ( files , "data" ) and not toolchain ._incompatible_do_not_include_data_in_compile_data :
721722 nolinkstamp_compile_direct_inputs += files .data
722723
723724 if toolchain .target_json :
You can’t perform that action at this time.
0 commit comments