File tree 2 files changed +14
-2
lines changed
crates/rust-analyzer/tests/slow-tests 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 63
63
- name : Install Rust toolchain
64
64
run : |
65
65
rustup update --no-self-update ${{ env.RUST_CHANNEL }}
66
- rustup component add rustfmt rust-src
66
+ rustup component add --toolchain ${{ env.RUST_CHANNEL }} rustfmt rust-src
67
+ rustup default ${{ env.RUST_CHANNEL }}
67
68
68
69
- name : Cache Dependencies
69
70
uses : Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894
Original file line number Diff line number Diff line change @@ -839,6 +839,17 @@ fn resolve_proc_macro() {
839
839
return ;
840
840
}
841
841
842
+ // skip using the sysroot config as to prevent us from loading the sysroot sources
843
+ let mut rustc = std:: process:: Command :: new ( toolchain:: rustc ( ) ) ;
844
+ rustc. args ( [ "--print" , "sysroot" ] ) ;
845
+ let output = rustc. output ( ) . unwrap ( ) ;
846
+ let sysroot =
847
+ vfs:: AbsPathBuf :: try_from ( std:: str:: from_utf8 ( & output. stdout ) . unwrap ( ) . trim ( ) ) . unwrap ( ) ;
848
+
849
+ let standalone_server_name =
850
+ format ! ( "rust-analyzer-proc-macro-srv{}" , std:: env:: consts:: EXE_SUFFIX ) ;
851
+ let proc_macro_server_path = sysroot. join ( "libexec" ) . join ( & standalone_server_name) ;
852
+
842
853
let server = Project :: with_fixture (
843
854
r###"
844
855
//- /foo/Cargo.toml
@@ -916,7 +927,7 @@ pub fn foo(_input: TokenStream) -> TokenStream {
916
927
} ,
917
928
"procMacro" : {
918
929
"enable" : true ,
919
- "server" : PathBuf :: from ( env! ( "CARGO_BIN_EXE_rust-analyzer" ) ) ,
930
+ "server" : proc_macro_server_path . as_path ( ) . as_ref ( ) ,
920
931
}
921
932
} ) )
922
933
. root ( "foo" )
You can’t perform that action at this time.
0 commit comments