aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/install.rs
diff options
context:
space:
mode:
authorIvan Kozik <[email protected]>2020-07-14 01:12:49 +0100
committerIvan Kozik <[email protected]>2020-07-14 21:57:51 +0100
commit6710856c1098f71168c47451af53bac9a33b49dd (patch)
tree46a514e5fd86dd33f16f9abca6ab14f5063c9696 /xtask/src/install.rs
parent46d4487b8900324fc6a523c8b6ebe036d28fd0fb (diff)
Add opt-in mimalloc feature
Diffstat (limited to 'xtask/src/install.rs')
-rw-r--r--xtask/src/install.rs16
1 files changed, 13 insertions, 3 deletions
diff --git a/xtask/src/install.rs b/xtask/src/install.rs
index 9ba77a3aa..a0dc0c9c2 100644
--- a/xtask/src/install.rs
+++ b/xtask/src/install.rs
@@ -19,7 +19,13 @@ pub enum ClientOpt {
19} 19}
20 20
21pub struct ServerOpt { 21pub struct ServerOpt {
22 pub jemalloc: bool, 22 pub malloc: Malloc,
23}
24
25pub enum Malloc {
26 System,
27 Jemalloc,
28 Mimalloc,
23} 29}
24 30
25impl InstallCmd { 31impl InstallCmd {
@@ -130,8 +136,12 @@ fn install_server(opts: ServerOpt) -> Result<()> {
130 ) 136 )
131 } 137 }
132 138
133 let jemalloc = if opts.jemalloc { "--features jemalloc" } else { "" }; 139 let malloc_feature = match opts.malloc {
134 let res = run!("cargo install --path crates/rust-analyzer --locked --force {}", jemalloc); 140 Malloc::System => "",
141 Malloc::Jemalloc => "--features jemalloc",
142 Malloc::Mimalloc => "--features mimalloc",
143 };
144 let res = run!("cargo install --path crates/rust-analyzer --locked --force {}", malloc_feature);
135 145
136 if res.is_err() && old_rust { 146 if res.is_err() && old_rust {
137 eprintln!( 147 eprintln!(