This repository was archived by the owner on Dec 29, 2022. It is now read-only.
File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 37
37
) ]
38
38
extern "C" { }
39
39
40
+ use log:: warn;
40
41
use env_logger;
41
42
use rustc_tools_util:: * ;
42
43
@@ -60,6 +61,7 @@ pub mod server;
60
61
mod test;
61
62
62
63
const RUSTC_SHIM_ENV_VAR_NAME : & str = "RLS_RUSTC_SHIM" ;
64
+ const RUSTC_WRAPPER_ENV_VAR : & str = "RUSTC_WRAPPER" ;
63
65
64
66
type Span = rls_span:: Span < rls_span:: ZeroIndexed > ;
65
67
@@ -73,6 +75,19 @@ pub fn main() {
73
75
fn main_inner ( ) -> i32 {
74
76
env_logger:: init ( ) ;
75
77
78
+ // [workaround]
79
+ // Currently sccache breaks RLS with obscure error messages.
80
+ // Until it's actually fixed disable the wrapper completely
81
+ // in the current process tree.
82
+ //
83
+ // See https://github.com/rust-lang/rls/issues/703
84
+ // and https://github.com/mozilla/sccache/issues/303
85
+ if env:: var_os ( RUSTC_WRAPPER_ENV_VAR ) . is_some ( ) {
86
+ warn ! ( "The {} environment variable is incompatible with RLS, \
87
+ removing it from the process environment", RUSTC_WRAPPER_ENV_VAR ) ;
88
+ env:: remove_var ( RUSTC_WRAPPER_ENV_VAR ) ;
89
+ }
90
+
76
91
if env:: var ( RUSTC_SHIM_ENV_VAR_NAME )
77
92
. map ( |v| v != "0" )
78
93
. unwrap_or ( false )
You can’t perform that action at this time.
0 commit comments