Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'xtask/src/install.rs')
-rw-r--r--xtask/src/install.rs16
1 files changed, 3 insertions, 13 deletions
diff --git a/xtask/src/install.rs b/xtask/src/install.rs
index dc932da80c..72e612f9e1 100644
--- a/xtask/src/install.rs
+++ b/xtask/src/install.rs
@@ -5,7 +5,7 @@ use std::{env, path::PathBuf, str};
use anyhow::{bail, format_err, Context};
use xshell::{cmd, Shell};
-use crate::flags;
+use crate::flags::{self, Malloc};
impl flags::Install {
pub(crate) fn run(self, sh: &Shell) -> anyhow::Result<()> {
@@ -34,12 +34,6 @@ pub(crate) struct ServerOpt {
pub(crate) dev_rel: bool,
}
-pub(crate) enum Malloc {
- System,
- Mimalloc,
- Jemalloc,
-}
-
fn fix_path_for_mac(sh: &Shell) -> anyhow::Result<()> {
let mut vscode_path: Vec<PathBuf> = {
const COMMON_APP_PATH: &str =
@@ -122,7 +116,7 @@ fn install_client(sh: &Shell, client_opt: ClientOpt) -> anyhow::Result<()> {
if !installed_extensions.contains("rust-analyzer") {
bail!(
"Could not install the Visual Studio Code extension. \
- Please make sure you have at least NodeJS 12.x together with the latest version of VS Code installed and try again. \
+ Please make sure you have at least NodeJS 16.x together with the latest version of VS Code installed and try again. \
Note that installing via xtask install does not work for VS Code Remote, instead you’ll need to install the .vsix manually."
);
}
@@ -131,11 +125,7 @@ fn install_client(sh: &Shell, client_opt: ClientOpt) -> anyhow::Result<()> {
}
fn install_server(sh: &Shell, opts: ServerOpt) -> anyhow::Result<()> {
- let features = match opts.malloc {
- Malloc::System => &[][..],
- Malloc::Mimalloc => &["--features", "mimalloc"],
- Malloc::Jemalloc => &["--features", "jemalloc"],
- };
+ let features = opts.malloc.to_features();
let profile = if opts.dev_rel { "dev-rel" } else { "release" };
let cmd = cmd!(sh, "cargo install --path crates/rust-analyzer --profile={profile} --locked --force --features force-always-assert {features...}");