File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
crates/rust-analyzer/tests/slow-tests Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 6363 - name : Install Rust toolchain
6464 run : |
6565 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 }}
6768
6869 - name : Cache Dependencies
6970 uses : Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894
Original file line number Diff line number Diff line change @@ -839,6 +839,17 @@ fn resolve_proc_macro() {
839839 return ;
840840 }
841841
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+
842853 let server = Project :: with_fixture (
843854 r###"
844855//- /foo/Cargo.toml
@@ -916,7 +927,7 @@ pub fn foo(_input: TokenStream) -> TokenStream {
916927 } ,
917928 "procMacro" : {
918929 "enable" : true ,
919- "server" : PathBuf :: from ( env! ( "CARGO_BIN_EXE_rust-analyzer" ) ) ,
930+ "server" : proc_macro_server_path . as_path ( ) . as_ref ( ) ,
920931 }
921932 } ) )
922933 . root ( "foo" )
You can’t perform that action at this time.
0 commit comments