Skip to content

Commit

Permalink
make bazel recognize rust outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
tempoz committed Nov 15, 2024
1 parent a3ab0a0 commit 0c39775
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion rust/aspects.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,20 @@ def _generate_rust_gencode(
),
)

proto_root = proto_info.proto_source_root
# Handles virtual import cases
if proto_root.startswith(ctx.bin_dir.path):
proto_root = proto_root[len(ctx.bin_dir.path) + 1:]


proto_common.compile(
actions = ctx.actions,
proto_info = proto_info,
additional_inputs = depset(direct = [crate_mapping]),
additional_args = additional_args,
generated_files = rs_outputs + cc_outputs,
proto_lang_toolchain_info = proto_lang_toolchain,
plugin_output = ctx.bin_dir.path,
plugin_output = ctx.bin_dir.path + "/" + proto_root
)
return (rs_outputs, cc_outputs)

Expand Down

0 comments on commit 0c39775

Please sign in to comment.