Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: output generated proto sources and descriptor set #2992

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion proto/prost/private/prost.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,10 @@ def _rust_prost_aspect_impl(target, ctx):
package_info = package_info_file,
),
rust_analyzer_info,
OutputGroupInfo(rust_generated_srcs = [lib_rs]),
OutputGroupInfo(
rust_generated_srcs = [lib_rs],
proto_descriptor_set = [proto_info.direct_descriptor_set],
),
]

rust_prost_aspect = aspect(
Expand Down Expand Up @@ -316,6 +319,8 @@ rust_prost_aspect = aspect(
def _rust_prost_library_impl(ctx):
proto_dep = ctx.attr.proto
rust_proto_info = proto_dep[ProstProtoInfo]
rust_generated_srcs = proto_dep[OutputGroupInfo].rust_generated_srcs
proto_descriptor_set = proto_dep[OutputGroupInfo].proto_descriptor_set
dep_variant_info = rust_proto_info.dep_variant_info

prost_toolchain = ctx.toolchains[TOOLCHAIN_TYPE]
Expand All @@ -332,6 +337,10 @@ def _rust_prost_library_impl(ctx):
transitive = transitive,
),
),
OutputGroupInfo(
rust_generated_srcs = rust_generated_srcs,
proto_descriptor_set = proto_descriptor_set,
),
RustAnalyzerGroupInfo(deps = [proto_dep[RustAnalyzerInfo]]),
]

Expand Down
Loading