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, 14 insertions, 2 deletions
diff --git a/xtask/src/install.rs b/xtask/src/install.rs
index b794f53e76..975e361ba5 100644
--- a/xtask/src/install.rs
+++ b/xtask/src/install.rs
@@ -39,6 +39,18 @@ pub(crate) struct ServerOpt {
pub(crate) malloc: Malloc,
pub(crate) dev_rel: bool,
pub(crate) pgo: Option<PgoTrainingCrate>,
+ pub(crate) force_always_assert: bool,
+}
+
+impl ServerOpt {
+ fn to_features(&self) -> Vec<&'static str> {
+ let mut features = Vec::new();
+ features.extend(self.malloc.to_features());
+ if self.force_always_assert {
+ features.extend(["--features", "force-always-assert"]);
+ }
+ features
+ }
}
pub(crate) struct ProcMacroServerOpt {
@@ -136,7 +148,7 @@ fn install_client(sh: &Shell, client_opt: ClientOpt) -> anyhow::Result<()> {
}
fn install_server(sh: &Shell, opts: ServerOpt) -> anyhow::Result<()> {
- let features = opts.malloc.to_features();
+ let features = &opts.to_features();
let profile = if opts.dev_rel { "dev-rel" } else { "release" };
let mut install_cmd = cmd!(
@@ -148,7 +160,7 @@ fn install_server(sh: &Shell, opts: ServerOpt) -> anyhow::Result<()> {
let target = detect_target(sh);
let build_cmd = cmd!(
sh,
- "cargo build --manifest-path ./crates/rust-analyzer/Cargo.toml --bin rust-analyzer --target {target} --profile={profile} --locked --features force-always-assert {features...}"
+ "cargo build --manifest-path ./crates/rust-analyzer/Cargo.toml --bin rust-analyzer --target {target} --profile={profile} --locked {features...}"
);
let profile = crate::pgo::gather_pgo_profile(sh, build_cmd, &target, train_crate)?;