Skip to content

Commit

Permalink
Auto merge of rust-lang#12755 - Veykril:server-version, r=lnicola
Browse files Browse the repository at this point in the history
fix: Set server binary version when distributing
  • Loading branch information
bors committed Jul 13, 2022
2 parents 90b5097 + ec51dcb commit 794ecd5
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions xtask/src/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ impl flags::Dist {
sh.remove_path(&dist)?;
sh.create_dir(&dist)?;

let release_channel = if stable { "stable" } else { "nightly" };
dist_server(sh, release_channel, &target)?;

if let Some(patch_version) = self.client_patch_version {
let version = if stable {
format!("{}.{}", VERSION_STABLE, patch_version)
} else {
// A hack to make VS Code prefer nightly over stable.
format!("{}.{}", VERSION_NIGHTLY, patch_version)
};
dist_server(sh, &format!("{version}-standalone"), &target)?;
let release_tag = if stable { date_iso(sh)? } else { "nightly".to_string() };
dist_client(sh, &version, &release_tag, &target)?;
} else {
dist_server(sh, "0.0.0-standalone", &target)?;
}
Ok(())
}
Expand Down Expand Up @@ -71,9 +71,8 @@ fn dist_client(
Ok(())
}

fn dist_server(sh: &Shell, release_channel: &str, target: &Target) -> anyhow::Result<()> {
let _e = sh.push_env("CFG_RELEASE_CHANNEL", release_channel);
let _e = sh.push_env("CFG_RELEASE", "0.0.0");
fn dist_server(sh: &Shell, release: &str, target: &Target) -> anyhow::Result<()> {
let _e = sh.push_env("CFG_RELEASE", release);
let _e = sh.push_env("CARGO_PROFILE_RELEASE_LTO", "thin");

// Uncomment to enable debug info for releases. Note that:
Expand Down

0 comments on commit 794ecd5

Please sign in to comment.