Merge pull request #20852 from ChayimFriedman2/xtask-install-never
Do not use `force-always-assert` in `xtask install` by default
This commit is contained in:
commit
e1a923a21e
2 changed files with 24 additions and 3 deletions
|
|
@ -49,6 +49,9 @@ xflags::xflags! {
|
|||
/// build in release with debug info set to 2.
|
||||
optional --dev-rel
|
||||
|
||||
/// Make `never!()`, `always!()` etc. panic instead of just logging an error.
|
||||
optional --force-always-assert
|
||||
|
||||
/// Apply PGO optimizations
|
||||
optional --pgo pgo: PgoTrainingCrate
|
||||
}
|
||||
|
|
@ -124,6 +127,7 @@ pub struct Install {
|
|||
pub jemalloc: bool,
|
||||
pub proc_macro_server: bool,
|
||||
pub dev_rel: bool,
|
||||
pub force_always_assert: bool,
|
||||
pub pgo: Option<PgoTrainingCrate>,
|
||||
}
|
||||
|
||||
|
|
@ -300,7 +304,12 @@ impl Install {
|
|||
} else {
|
||||
Malloc::System
|
||||
};
|
||||
Some(ServerOpt { malloc, dev_rel: self.dev_rel, pgo: self.pgo.clone() })
|
||||
Some(ServerOpt {
|
||||
malloc,
|
||||
dev_rel: self.dev_rel,
|
||||
pgo: self.pgo.clone(),
|
||||
force_always_assert: self.force_always_assert,
|
||||
})
|
||||
}
|
||||
pub(crate) fn proc_macro_server(&self) -> Option<ProcMacroServerOpt> {
|
||||
if !self.proc_macro_server {
|
||||
|
|
|
|||
|
|
@ -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)?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue