File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -429,8 +429,9 @@ impl WorkspaceBuildScripts {
429429 for p in rustc. packages ( ) {
430430 let package = & rustc[ p] ;
431431 if package. targets . iter ( ) . any ( |& it| rustc[ it] . is_proc_macro ) {
432- if let Some ( ( _, path) ) =
433- proc_macro_dylibs. iter ( ) . find ( |( name, _) | * name == package. name )
432+ if let Some ( ( _, path) ) = proc_macro_dylibs
433+ . iter ( )
434+ . find ( |( name, _) | * name. trim_start_matches ( "lib" ) == package. name )
434435 {
435436 bs. outputs [ p] . proc_macro_dylib_path = Some ( path. clone ( ) ) ;
436437 }
Original file line number Diff line number Diff line change @@ -940,7 +940,7 @@ fn cargo_to_crate_graph(
940940 if has_private {
941941 // If the user provided a path to rustc sources, we add all the rustc_private crates
942942 // and create dependencies on them for the crates which opt-in to that
943- if let Some ( ( rustc_workspace, build_scripts ) ) = rustc {
943+ if let Some ( ( rustc_workspace, rustc_build_scripts ) ) = rustc {
944944 handle_rustc_crates (
945945 & mut crate_graph,
946946 & mut pkg_to_lib_crate,
@@ -953,7 +953,13 @@ fn cargo_to_crate_graph(
953953 & pkg_crates,
954954 & cfg_options,
955955 override_cfg,
956- build_scripts,
956+ if rustc_workspace. workspace_root ( ) == cargo. workspace_root ( ) {
957+ // the rustc workspace does not use the installed toolchain's proc-macro server
958+ // so we need to make sure we don't use the pre compiled proc-macros there either
959+ build_scripts
960+ } else {
961+ rustc_build_scripts
962+ } ,
957963 target_layout,
958964 ) ;
959965 }
You can’t perform that action at this time.
0 commit comments