Is it possible to keep the intermediate `.rs` file used during `rust_prost_library`?
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- rust
- Domain
- build-system
Research direction
Start with extensions/prost/private/prost.bzl, especially the rust_prost_library implementation and the lines around 316-323, then reproduce the shown bazel build command with --subcommands. Determine how the generated *.lib.rs artifact is handled and make it remain accessible after the build; done when users can inspect that file for a generated proto target.
Written by the indexing model from the issue text.
Description
rust_prost_library's ProstGenProto action will - it seems - create an ephemeral *.lib.rs file before building the resulting *.rlib file.
Note the --out_librs=bazel-out/k8-fastbuild/bin/rust/proto/connect_proto.lib.rs arg in the protoc_wrapper command:
$ bazel build --subcommands //rust/proto:connect_rust_proto
...
SUBCOMMAND: # //rust/proto:connect_proto [action 'ProstGenProto //rust/proto:connect_proto', configuration: ce57de3d3d3898ef19a604dc9e90220b91db82beb22d97846032d915a639010f, execution platform: //tools/bazel/rbe/config/config:platform, mnemonic: ProstGenProto]
(cd /usr/local/google/home/dthor/.cache/bazel/_bazel_dthor/0f8c52850e7230283fc2f8033149fba2/execroot/_main && \
exec env - \
BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 \
PATH=/bin:/usr/bin:/usr/local/bin \
bazel-out/k8-opt-exec-ST-7ac76b60419a/bin/external/rules_rust_prost+/private/protoc_wrapper '--prost_out=bazel-out/k8-fastbuild/bin' '--plugin=protoc-gen-prost=bazel-out/k8-opt-exec-ST-7ac76b60419a/bin/external/rules_rust++crate+crates__protoc-gen-prost-0.4.0/protoc-gen-prost__bin' -I. rust/proto/connect.proto '--protoc=bazel-out/k8-opt-exec-ST-7ac76b60419a/bin/external/protobuf+/protoc' '--label=//rust/proto:connect_proto' '--out_librs=bazel-out/k8-fastbuild/bin/rust/proto/connect_proto.lib.rs' '--package_info_output=connect_proto=bazel-out/k8-fastbuild/bin/rust/proto/connect_proto.prost_package_info' '--deps_info=bazel-out/k8-fastbuild/bin/rust/proto/connect_proto.prost_deps_info' '--descriptor_set=bazel-out/k8-fastbuild/bin/rust/proto/connect_proto-descriptor-set.proto.bin' '--prost_opt=enable_type_names' '--plugin=protoc-gen-tonic=bazel-out/k8-opt-exec-ST-7ac76b60419a/bin/external/rules_rust++crate+crates__protoc-gen-tonic-0.4.1/protoc-gen-tonic__bin' '--tonic_opt=no_include' --is_tonic '--rustfmt=external/rules_rust++rust+rustfmt_nightly-2025-04-03__x86_64-unknown-linux-gnu_tools/bin/rustfmt')
# Configuration: ce57de3d3d3898ef19a604dc9e90220b91db82beb22d97846032d915a639010f
# Execution platform: //tools/bazel/rbe/config/config:platform
# Runner: remote
Is it possible to keep that *.lib.rs file around? Even just in the sandbox or outdir or cache or something. Having it accessible can help debug issues with protos.
- Dominant language
- Starlark
- Stars
- 857
- Forks
- 701
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 46
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bazelbuild/rules_rust
-
`rust_test(crate = ...)` does not stage the crate's transitive dynamic libraries into runfilesPossibly taken @Wito-1 claimed this 65 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
bazelbuild/rules_rust#4309 ·
Maintainers usually reply within 3 days
-
Windows (no-symlink path): drain_runfiles_dir_windows deletes retained runfiles — inverted filename_suffixes_to_retain conditionPossibly taken @Mattbusel claimed this 17 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
bazelbuild/rules_rust#4266 ·
Maintainers usually reply within 3 days
-
rust.toolchain(strip_level = ...) is silently ignoredPossibly taken @Mattbusel claimed this 17 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
bazelbuild/rules_rust#4223 ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
bazelbuild/rules_rust#4152 · 1 reaction ·
Maintainers usually reply within 3 days
-
awaiting-response
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bazelbuild/rules_rust#3599 · 1 comment ·
Maintainers usually reply within 3 days
All issues in bazelbuild/rules_rust
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
bazelbuild/apple_support#707 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
out-of-date
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CachyOS/CachyOS-PKGBUILDS#2232 ·
Maintainers usually reply within 1 day
-
blast/large refactor risk/low spend-dem
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
chriskelly/MusicWall#87 · 2 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
neilotoole/sq#1503 ·
Maintainers usually reply within 1 day