File tree 2 files changed +11
-4
lines changed
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -429,8 +429,9 @@ impl WorkspaceBuildScripts {
429
429
for p in rustc. packages ( ) {
430
430
let package = & rustc[ p] ;
431
431
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 )
434
435
{
435
436
bs. outputs [ p] . proc_macro_dylib_path = Some ( path. clone ( ) ) ;
436
437
}
Original file line number Diff line number Diff line change @@ -940,7 +940,7 @@ fn cargo_to_crate_graph(
940
940
if has_private {
941
941
// If the user provided a path to rustc sources, we add all the rustc_private crates
942
942
// 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 {
944
944
handle_rustc_crates (
945
945
& mut crate_graph,
946
946
& mut pkg_to_lib_crate,
@@ -953,7 +953,13 @@ fn cargo_to_crate_graph(
953
953
& pkg_crates,
954
954
& cfg_options,
955
955
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
+ } ,
957
963
target_layout,
958
964
) ;
959
965
}
You can’t perform that action at this time.
0 commit comments