aboutsummaryrefslogtreecommitdiff
path: root/xtask
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-22 12:44:05 +0100
committerGitHub <[email protected]>2020-07-22 12:44:05 +0100
commit2dd8ba2b21e3262f25e4245e37549206c8a3bc2d (patch)
tree6dfcadbf3b6a333777f22f54db773118bf1916d4 /xtask
parent26932e0060b74525f74df5e31ae0c88997e5d667 (diff)
parent9ad41eb9085cd7ceaf479f659a7071df81059b7c (diff)
Merge #5487
5487: Setup global allocator in the correct crate r=matklad a=matklad It worked before, but was roundabout bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'xtask')
-rw-r--r--xtask/src/dist.rs2
-rw-r--r--xtask/src/install.rs2
-rw-r--r--xtask/src/main.rs12
3 files changed, 2 insertions, 14 deletions
diff --git a/xtask/src/dist.rs b/xtask/src/dist.rs
index b8f68027c..c198c0907 100644
--- a/xtask/src/dist.rs
+++ b/xtask/src/dist.rs
@@ -57,8 +57,6 @@ fn dist_server() -> Result<()> {
57 env::set_var("CC", "clang"); 57 env::set_var("CC", "clang");
58 run!( 58 run!(
59 "cargo build --manifest-path ./crates/rust-analyzer/Cargo.toml --bin rust-analyzer --release" 59 "cargo build --manifest-path ./crates/rust-analyzer/Cargo.toml --bin rust-analyzer --release"
60 // We'd want to add, but that requires setting the right linker somehow
61 // --features=jemalloc
62 )?; 60 )?;
63 } else { 61 } else {
64 run!("cargo build --manifest-path ./crates/rust-analyzer/Cargo.toml --bin rust-analyzer --release")?; 62 run!("cargo build --manifest-path ./crates/rust-analyzer/Cargo.toml --bin rust-analyzer --release")?;
diff --git a/xtask/src/install.rs b/xtask/src/install.rs
index a0dc0c9c2..b25a6e301 100644
--- a/xtask/src/install.rs
+++ b/xtask/src/install.rs
@@ -24,7 +24,6 @@ pub struct ServerOpt {
24 24
25pub enum Malloc { 25pub enum Malloc {
26 System, 26 System,
27 Jemalloc,
28 Mimalloc, 27 Mimalloc,
29} 28}
30 29
@@ -138,7 +137,6 @@ fn install_server(opts: ServerOpt) -> Result<()> {
138 137
139 let malloc_feature = match opts.malloc { 138 let malloc_feature = match opts.malloc {
140 Malloc::System => "", 139 Malloc::System => "",
141 Malloc::Jemalloc => "--features jemalloc",
142 Malloc::Mimalloc => "--features mimalloc", 140 Malloc::Mimalloc => "--features mimalloc",
143 }; 141 };
144 let res = run!("cargo install --path crates/rust-analyzer --locked --force {}", malloc_feature); 142 let res = run!("cargo install --path crates/rust-analyzer --locked --force {}", malloc_feature);
diff --git a/xtask/src/main.rs b/xtask/src/main.rs
index 399ff7204..53d3ce3e7 100644
--- a/xtask/src/main.rs
+++ b/xtask/src/main.rs
@@ -45,7 +45,6 @@ USAGE:
45FLAGS: 45FLAGS:
46 --client-code Install only VS Code plugin 46 --client-code Install only VS Code plugin
47 --server Install only the language server 47 --server Install only the language server
48 --jemalloc Use jemalloc for server
49 --mimalloc Use mimalloc for server 48 --mimalloc Use mimalloc for server
50 -h, --help Prints help information 49 -h, --help Prints help information
51 " 50 "
@@ -62,15 +61,8 @@ FLAGS:
62 return Ok(()); 61 return Ok(());
63 } 62 }
64 63
65 let malloc = match (args.contains("--jemalloc"), args.contains("--mimalloc")) { 64 let malloc =
66 (false, false) => Malloc::System, 65 if args.contains("--mimalloc") { Malloc::Mimalloc } else { Malloc::System };
67 (true, false) => Malloc::Jemalloc,
68 (false, true) => Malloc::Mimalloc,
69 (true, true) => {
70 eprintln!("error: Cannot use both `--jemalloc` and `--mimalloc`");
71 return Ok(());
72 }
73 };
74 66
75 args.finish()?; 67 args.finish()?;
76 68