@@ -25,6 +25,7 @@ lazy_static! {
25
25
}
26
26
27
27
const NIXOS_TEST_PATH : & str = "/etc/NIXOS" ;
28
+ const SKIP_REQ_FILE : & str = "/tmp/vscode-skip-server-requirements-check" ;
28
29
29
30
pub struct PreReqChecker { }
30
31
@@ -52,13 +53,20 @@ impl PreReqChecker {
52
53
53
54
#[ cfg( target_os = "linux" ) ]
54
55
pub async fn verify ( & self ) -> Result < Platform , CodeError > {
55
- let ( is_nixos, gnu_a , gnu_b , or_musl) = tokio:: join!(
56
+ let ( is_nixos, skip_glibc_checks , or_musl) = tokio:: join!(
56
57
check_is_nixos( ) ,
57
- check_glibc_version( ) ,
58
- check_glibcxx_version( ) ,
58
+ check_skip_req_file( ) ,
59
59
check_musl_interpreter( )
60
60
) ;
61
61
62
+ let ( gnu_a, gnu_b) = if !skip_glibc_checks {
63
+ tokio:: join!( check_glibc_version( ) , check_glibcxx_version( ) )
64
+ } else {
65
+ println ! ( "!!! WARNING: Skipping server pre-requisite check !!!" ) ;
66
+ println ! ( "!!! Server stability is not guaranteed. Proceed at your own risk. !!!" ) ;
67
+ ( Ok ( ( ) ) , Ok ( ( ) ) )
68
+ } ;
69
+
62
70
if ( gnu_a. is_ok ( ) && gnu_b. is_ok ( ) ) || is_nixos {
63
71
return Ok ( if cfg ! ( target_arch = "x86_64" ) {
64
72
Platform :: LinuxX64
@@ -157,6 +165,15 @@ async fn check_is_nixos() -> bool {
157
165
fs:: metadata ( NIXOS_TEST_PATH ) . await . is_ok ( )
158
166
}
159
167
168
+ /// Do not remove this check.
169
+ /// Provides a way to skip the server glibc requirements check from
170
+ /// outside the install flow. A system process can create this
171
+ /// file before the server is downloaded and installed.
172
+ #[ allow( dead_code) ]
173
+ async fn check_skip_req_file ( ) -> bool {
174
+ fs:: metadata ( SKIP_REQ_FILE ) . await . is_ok ( )
175
+ }
176
+
160
177
#[ allow( dead_code) ]
161
178
async fn check_glibcxx_version ( ) -> Result < ( ) , String > {
162
179
let mut libstdc_path: Option < String > = None ;
0 commit comments