This repository was archived by the owner on May 28, 2025. It is now read-only.
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 @@ -428,8 +428,9 @@ impl WorkspaceBuildScripts {
428
428
for p in rustc. packages ( ) {
429
429
let package = & rustc[ p] ;
430
430
if package. targets . iter ( ) . any ( |& it| rustc[ it] . is_proc_macro ) {
431
- if let Some ( ( _, path) ) =
432
- proc_macro_dylibs. iter ( ) . find ( |( name, _) | * name == package. name )
431
+ if let Some ( ( _, path) ) = proc_macro_dylibs
432
+ . iter ( )
433
+ . find ( |( name, _) | * name. trim_start_matches ( "lib" ) == package. name )
433
434
{
434
435
bs. outputs [ p] . proc_macro_dylib_path = Some ( path. clone ( ) ) ;
435
436
}
Original file line number Diff line number Diff line change @@ -932,7 +932,7 @@ fn cargo_to_crate_graph(
932
932
if has_private {
933
933
// If the user provided a path to rustc sources, we add all the rustc_private crates
934
934
// and create dependencies on them for the crates which opt-in to that
935
- if let Some ( ( rustc_workspace, build_scripts ) ) = rustc {
935
+ if let Some ( ( rustc_workspace, rustc_build_scripts ) ) = rustc {
936
936
handle_rustc_crates (
937
937
& mut crate_graph,
938
938
& mut pkg_to_lib_crate,
@@ -945,7 +945,13 @@ fn cargo_to_crate_graph(
945
945
& pkg_crates,
946
946
& cfg_options,
947
947
override_cfg,
948
- build_scripts,
948
+ if rustc_workspace. workspace_root ( ) == cargo. workspace_root ( ) {
949
+ // the rustc workspace does not use the installed toolchain's proc-macro server
950
+ // so we need to make sure we don't use the pre compiled proc-macros there either
951
+ build_scripts
952
+ } else {
953
+ rustc_build_scripts
954
+ } ,
949
955
target_layout,
950
956
) ;
951
957
}
You can’t perform that action at this time.
0 commit comments