From 4eedbdedaee67a38a064b91138ff572e139d2407 Mon Sep 17 00:00:00 2001 From: Thorsten Ball Date: Tue, 7 May 2024 17:50:19 +0200 Subject: [PATCH] linux: Use optional compile-time RELEASE_VERSION variable (#11490) This implements `app_version` on Linux by using an optional, compile-time `RELEASE_VERSION` env var that can be set. We settled on the `RELEASE_VERSION` as the name, since it's similar to `RELEASE_CHANNEL` which we use in Zed. cc @ConradIrwin @mikayla-maki Release Notes: - N/A Co-authored-by: Bennet --- crates/gpui/src/platform/linux/platform.rs | 7 ++++++- script/bundle-linux | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/gpui/src/platform/linux/platform.rs b/crates/gpui/src/platform/linux/platform.rs index 842b0d6f53..f09f92d31a 100644 --- a/crates/gpui/src/platform/linux/platform.rs +++ b/crates/gpui/src/platform/linux/platform.rs @@ -348,7 +348,12 @@ impl Platform for P { } fn app_version(&self) -> Result { - Ok(SemanticVersion::new(1, 0, 0)) + const VERSION: Option<&str> = option_env!("RELEASE_VERSION"); + if let Some(version) = VERSION { + version.parse() + } else { + Ok(SemanticVersion::new(1, 0, 0)) + } } fn app_path(&self) -> Result { diff --git a/script/bundle-linux b/script/bundle-linux index 6097e638c9..9cf869dc01 100755 --- a/script/bundle-linux +++ b/script/bundle-linux @@ -26,7 +26,11 @@ done export ZED_BUNDLE=true channel=$(