Open
Description
There are some raw bazel cmds in gen_rust_project binary:
- aquery: https://github.com/bazelbuild/rules_rust/blob/main/tools/rust_analyzer/aquery.rs#L78
- info: https://github.com/bazelbuild/rules_rust/blob/main/tools/rust_analyzer/main.rs#L68
- build: https://github.com/bazelbuild/rules_rust/blob/main/tools/rust_analyzer/lib.rs#L23
The default compilation_mode in bazel is fastbuild
. So the root_module
value in rust-project.json
looks like "xxx/bazel-out/k8-fastbuild/bin/xxx"
In our usage scenario, we manage build commands through bazel config, like:
build:scene1 -c opt
build:scene2 -c fastbuild
When we build the target using opt mode, the generated content of rust-project.json will not match.
So, is there a way for us to support the transparent compilation_mode or config so that the internal bazel commands can also be built using the same mode?
bazel run --config:scene1 @rules_rust//tools/rust_analyzer:gen_rust_project -- {target}
# or
bazel run @rules_rust//tools/rust_analyzer:gen_rust_project -- --inner_comilation_mode=opt {target}