@@ -10,18 +10,24 @@ mod rust_project;
1010
1111pub fn generate_crate_info (
1212 bazel : impl AsRef < Path > ,
13+ config : & Option < String > ,
1314 workspace : impl AsRef < Path > ,
1415 rules_rust : impl AsRef < str > ,
1516 targets : & [ String ] ,
1617) -> anyhow:: Result < ( ) > {
1718 log:: debug!( "Building rust_analyzer_crate_spec files for {:?}" , targets) ;
19+ let config_args = match config {
20+ Some ( config) => vec ! [ "--config" , config] ,
21+ None => Vec :: new ( ) ,
22+ } ;
1823
1924 let output = Command :: new ( bazel. as_ref ( ) )
2025 . current_dir ( workspace. as_ref ( ) )
2126 . env_remove ( "BAZELISK_SKIP_WRAPPER" )
2227 . env_remove ( "BUILD_WORKING_DIRECTORY" )
2328 . env_remove ( "BUILD_WORKSPACE_DIRECTORY" )
2429 . arg ( "build" )
30+ . args ( config_args)
2531 . arg ( "--norun_validations" )
2632 . arg ( "--remote_download_all" )
2733 . arg ( format ! (
@@ -43,8 +49,10 @@ pub fn generate_crate_info(
4349 Ok ( ( ) )
4450}
4551
52+ #[ allow( clippy:: too_many_arguments) ]
4653pub fn write_rust_project (
4754 bazel : impl AsRef < Path > ,
55+ config : & Option < String > ,
4856 workspace : impl AsRef < Path > ,
4957 rules_rust_name : & impl AsRef < str > ,
5058 targets : & [ String ] ,
@@ -54,6 +62,7 @@ pub fn write_rust_project(
5462) -> anyhow:: Result < ( ) > {
5563 let crate_specs = aquery:: get_crate_specs (
5664 bazel. as_ref ( ) ,
65+ config,
5766 workspace. as_ref ( ) ,
5867 execution_root. as_ref ( ) ,
5968 targets,
0 commit comments