diff options
author | Connor Peet <connor@peet.io> | 2022-11-12 00:32:41 +0300 |
---|---|---|
committer | Connor Peet <connor@peet.io> | 2022-11-12 00:32:41 +0300 |
commit | 0cd1422809b52b0a6e1592eb92193c5cf6260a43 (patch) | |
tree | 2bd8766699ee483743b4a448f6ec81eccbfc240e | |
parent | f8995e0b1aae1e6cafe677eb76fbae047034a8c8 (diff) |
cli: skip glibc check for nixos
Fixes https://github.com/microsoft/vscode-remote-release/issues/7129
-rw-r--r-- | cli/src/util/prereqs.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/cli/src/util/prereqs.rs b/cli/src/util/prereqs.rs index dd240b412d8..0070858ddeb 100644 --- a/cli/src/util/prereqs.rs +++ b/cli/src/util/prereqs.rs @@ -23,6 +23,8 @@ lazy_static! { static ref MIN_LDD_VERSION: SimpleSemver = SimpleSemver::new(2, 17, 0); } +const NIXOS_TEST_PATH: &str = "/etc/NIXOS"; + pub struct PreReqChecker {} impl Default for PreReqChecker { @@ -45,13 +47,14 @@ impl PreReqChecker { #[cfg(target_os = "linux")] pub async fn verify(&self) -> Result<Platform, AnyError> { - let (gnu_a, gnu_b, or_musl) = tokio::join!( + let (is_nixos, gnu_a, gnu_b, or_musl) = tokio::join!( + check_is_nixos(), check_glibc_version(), check_glibcxx_version(), check_musl_interpreter() ); - if gnu_a.is_ok() && gnu_b.is_ok() { + if (gnu_a.is_ok() && gnu_b.is_ok()) || is_nixos { return Ok(if cfg!(target_arch = "x86_64") { Platform::LinuxX64 } else if cfg!(target_arch = "armhf") { @@ -132,6 +135,13 @@ async fn check_glibc_version() -> Result<(), String> { Ok(()) } +/// Check for nixos to avoid mandating glibc versions. See: +/// https://github.com/microsoft/vscode-remote-release/issues/7129 +#[allow(dead_code)] +async fn check_is_nixos() -> bool { + fs::metadata(NIXOS_TEST_PATH).await.is_ok() +} + #[allow(dead_code)] async fn check_glibcxx_version() -> Result<(), String> { let mut libstdc_path: Option<String> = None; |