releases: Add build number to Nightly builds (#42990)
- **Remove semantic_version crate and use semver instead** - **Update upload-nightly** Release Notes: - N/A --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
co-authored by
Conrad Irwin
parent
a0fa5d57c1
commit
2d55c088cc
@@ -44,7 +44,7 @@ use node_runtime::NodeRuntime;
|
||||
use project::ContextProviderWithTasks;
|
||||
use release_channel::ReleaseChannel;
|
||||
use remote::RemoteClient;
|
||||
use semantic_version::SemanticVersion;
|
||||
use semver::Version;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use settings::Settings;
|
||||
use std::ops::RangeInclusive;
|
||||
@@ -98,7 +98,7 @@ pub fn is_version_compatible(
|
||||
.manifest
|
||||
.wasm_api_version
|
||||
.as_ref()
|
||||
.and_then(|wasm_api_version| SemanticVersion::from_str(wasm_api_version).ok())
|
||||
.and_then(|wasm_api_version| Version::from_str(wasm_api_version).ok())
|
||||
&& !is_supported_wasm_api_version(release_channel, wasm_api_version)
|
||||
{
|
||||
return false;
|
||||
@@ -639,9 +639,8 @@ impl ExtensionStore {
|
||||
this.extension_index.extensions.get(&extension.id)
|
||||
{
|
||||
let installed_version =
|
||||
SemanticVersion::from_str(&installed_extension.manifest.version).ok()?;
|
||||
let latest_version =
|
||||
SemanticVersion::from_str(&extension.manifest.version).ok()?;
|
||||
Version::from_str(&installed_extension.manifest.version).ok()?;
|
||||
let latest_version = Version::from_str(&extension.manifest.version).ok()?;
|
||||
|
||||
if installed_version >= latest_version {
|
||||
return None;
|
||||
|
||||
@@ -8,7 +8,7 @@ use collections::{BTreeMap, HashSet};
|
||||
use extension::ExtensionHostProxy;
|
||||
use fs::{FakeFs, Fs, RealFs};
|
||||
use futures::{AsyncReadExt, StreamExt, io::BufReader};
|
||||
use gpui::{AppContext as _, SemanticVersion, TestAppContext};
|
||||
use gpui::{AppContext as _, TestAppContext};
|
||||
use http_client::{FakeHttpClient, Response};
|
||||
use language::{BinaryStatus, LanguageMatcher, LanguageName, LanguageRegistry};
|
||||
use language_extension::LspAccess;
|
||||
@@ -866,7 +866,7 @@ fn init_test(cx: &mut TestAppContext) {
|
||||
cx.update(|cx| {
|
||||
let store = SettingsStore::test(cx);
|
||||
cx.set_global(store);
|
||||
release_channel::init(SemanticVersion::default(), cx);
|
||||
release_channel::init(semver::Version::new(0, 0, 0), cx);
|
||||
extension::init(cx);
|
||||
theme::init(theme::LoadThemes::JustBase, cx);
|
||||
gpui_tokio::init(cx);
|
||||
|
||||
@@ -28,7 +28,7 @@ use lsp::LanguageServerName;
|
||||
use moka::sync::Cache;
|
||||
use node_runtime::NodeRuntime;
|
||||
use release_channel::ReleaseChannel;
|
||||
use semantic_version::SemanticVersion;
|
||||
use semver::Version;
|
||||
use settings::Settings;
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
@@ -68,7 +68,7 @@ pub struct WasmExtension {
|
||||
pub manifest: Arc<ExtensionManifest>,
|
||||
pub work_dir: Arc<Path>,
|
||||
#[allow(unused)]
|
||||
pub zed_api_version: SemanticVersion,
|
||||
pub zed_api_version: Version,
|
||||
_task: Arc<Task<Result<(), gpui_tokio::JoinError>>>,
|
||||
}
|
||||
|
||||
@@ -630,7 +630,7 @@ impl WasmHost {
|
||||
&executor,
|
||||
&mut store,
|
||||
this.release_channel,
|
||||
zed_api_version,
|
||||
zed_api_version.clone(),
|
||||
&component,
|
||||
)
|
||||
.await?;
|
||||
@@ -713,10 +713,7 @@ impl WasmHost {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn parse_wasm_extension_version(
|
||||
extension_id: &str,
|
||||
wasm_bytes: &[u8],
|
||||
) -> Result<SemanticVersion> {
|
||||
pub fn parse_wasm_extension_version(extension_id: &str, wasm_bytes: &[u8]) -> Result<Version> {
|
||||
let mut version = None;
|
||||
|
||||
for part in wasmparser::Parser::new(0).parse_all(wasm_bytes) {
|
||||
@@ -743,9 +740,9 @@ pub fn parse_wasm_extension_version(
|
||||
version.with_context(|| format!("extension {extension_id} has no zed:api-version section"))
|
||||
}
|
||||
|
||||
fn parse_wasm_extension_version_custom_section(data: &[u8]) -> Option<SemanticVersion> {
|
||||
fn parse_wasm_extension_version_custom_section(data: &[u8]) -> Option<Version> {
|
||||
if data.len() == 6 {
|
||||
Some(SemanticVersion::new(
|
||||
Some(Version::new(
|
||||
u16::from_be_bytes([data[0], data[1]]) as _,
|
||||
u16::from_be_bytes([data[2], data[3]]) as _,
|
||||
u16::from_be_bytes([data[4], data[5]]) as _,
|
||||
|
||||
@@ -19,7 +19,7 @@ use crate::wasm_host::wit::since_v0_6_0::dap::StartDebuggingRequestArgumentsRequ
|
||||
|
||||
use super::{WasmState, wasm_engine};
|
||||
use anyhow::{Context as _, Result, anyhow};
|
||||
use semantic_version::SemanticVersion;
|
||||
use semver::Version;
|
||||
use since_v0_6_0 as latest;
|
||||
use std::{ops::RangeInclusive, path::PathBuf, sync::Arc};
|
||||
use wasmtime::{
|
||||
@@ -54,16 +54,13 @@ fn wasi_view(state: &mut WasmState) -> &mut WasmState {
|
||||
}
|
||||
|
||||
/// Returns whether the given Wasm API version is supported by the Wasm host.
|
||||
pub fn is_supported_wasm_api_version(
|
||||
release_channel: ReleaseChannel,
|
||||
version: SemanticVersion,
|
||||
) -> bool {
|
||||
pub fn is_supported_wasm_api_version(release_channel: ReleaseChannel, version: Version) -> bool {
|
||||
wasm_api_version_range(release_channel).contains(&version)
|
||||
}
|
||||
|
||||
/// Returns the Wasm API version range that is supported by the Wasm host.
|
||||
#[inline(always)]
|
||||
pub fn wasm_api_version_range(release_channel: ReleaseChannel) -> RangeInclusive<SemanticVersion> {
|
||||
pub fn wasm_api_version_range(release_channel: ReleaseChannel) -> RangeInclusive<Version> {
|
||||
// Note: The release channel can be used to stage a new version of the extension API.
|
||||
let _ = release_channel;
|
||||
|
||||
@@ -114,7 +111,7 @@ impl Extension {
|
||||
executor: &BackgroundExecutor,
|
||||
store: &mut Store<WasmState>,
|
||||
release_channel: ReleaseChannel,
|
||||
version: SemanticVersion,
|
||||
version: Version,
|
||||
component: &Component,
|
||||
) -> Result<Self> {
|
||||
// Note: The release channel can be used to stage a new version of the extension API.
|
||||
|
||||
@@ -5,11 +5,11 @@ use anyhow::Result;
|
||||
use extension::{ExtensionLanguageServerProxy, WorktreeDelegate};
|
||||
use gpui::BackgroundExecutor;
|
||||
use language::BinaryStatus;
|
||||
use semantic_version::SemanticVersion;
|
||||
use semver::Version;
|
||||
use std::sync::{Arc, OnceLock};
|
||||
use wasmtime::component::{Linker, Resource};
|
||||
|
||||
pub const MIN_VERSION: SemanticVersion = SemanticVersion::new(0, 0, 1);
|
||||
pub const MIN_VERSION: Version = Version::new(0, 0, 1);
|
||||
|
||||
wasmtime::component::bindgen!({
|
||||
async: true,
|
||||
|
||||
@@ -3,11 +3,11 @@ use crate::wasm_host::WasmState;
|
||||
use anyhow::Result;
|
||||
use extension::WorktreeDelegate;
|
||||
use gpui::BackgroundExecutor;
|
||||
use semantic_version::SemanticVersion;
|
||||
use semver::Version;
|
||||
use std::sync::{Arc, OnceLock};
|
||||
use wasmtime::component::{Linker, Resource};
|
||||
|
||||
pub const MIN_VERSION: SemanticVersion = SemanticVersion::new(0, 0, 4);
|
||||
pub const MIN_VERSION: Version = Version::new(0, 0, 4);
|
||||
|
||||
wasmtime::component::bindgen!({
|
||||
async: true,
|
||||
|
||||
@@ -3,11 +3,11 @@ use crate::wasm_host::WasmState;
|
||||
use anyhow::Result;
|
||||
use extension::WorktreeDelegate;
|
||||
use gpui::BackgroundExecutor;
|
||||
use semantic_version::SemanticVersion;
|
||||
use semver::Version;
|
||||
use std::sync::{Arc, OnceLock};
|
||||
use wasmtime::component::{Linker, Resource};
|
||||
|
||||
pub const MIN_VERSION: SemanticVersion = SemanticVersion::new(0, 0, 6);
|
||||
pub const MIN_VERSION: Version = Version::new(0, 0, 6);
|
||||
|
||||
wasmtime::component::bindgen!({
|
||||
async: true,
|
||||
|
||||
@@ -11,7 +11,7 @@ use gpui::BackgroundExecutor;
|
||||
use language::LanguageName;
|
||||
use language::{BinaryStatus, language_settings::AllLanguageSettings};
|
||||
use project::project_settings::ProjectSettings;
|
||||
use semantic_version::SemanticVersion;
|
||||
use semver::Version;
|
||||
use std::{
|
||||
path::{Path, PathBuf},
|
||||
sync::{Arc, OnceLock},
|
||||
@@ -23,7 +23,7 @@ use wasmtime::component::{Linker, Resource};
|
||||
|
||||
use super::latest;
|
||||
|
||||
pub const MIN_VERSION: SemanticVersion = SemanticVersion::new(0, 1, 0);
|
||||
pub const MIN_VERSION: Version = Version::new(0, 1, 0);
|
||||
|
||||
wasmtime::component::bindgen!({
|
||||
async: true,
|
||||
|
||||
@@ -2,13 +2,13 @@ use crate::wasm_host::WasmState;
|
||||
use anyhow::Result;
|
||||
use extension::{KeyValueStoreDelegate, ProjectDelegate, WorktreeDelegate};
|
||||
use gpui::BackgroundExecutor;
|
||||
use semantic_version::SemanticVersion;
|
||||
use semver::Version;
|
||||
use std::sync::{Arc, OnceLock};
|
||||
use wasmtime::component::{Linker, Resource};
|
||||
|
||||
use super::latest;
|
||||
|
||||
pub const MIN_VERSION: SemanticVersion = SemanticVersion::new(0, 2, 0);
|
||||
pub const MIN_VERSION: Version = Version::new(0, 2, 0);
|
||||
|
||||
wasmtime::component::bindgen!({
|
||||
async: true,
|
||||
|
||||
@@ -2,13 +2,13 @@ use crate::wasm_host::WasmState;
|
||||
use anyhow::Result;
|
||||
use extension::{KeyValueStoreDelegate, ProjectDelegate, WorktreeDelegate};
|
||||
use gpui::BackgroundExecutor;
|
||||
use semantic_version::SemanticVersion;
|
||||
use semver::Version;
|
||||
use std::sync::{Arc, OnceLock};
|
||||
use wasmtime::component::{Linker, Resource};
|
||||
|
||||
use super::latest;
|
||||
|
||||
pub const MIN_VERSION: SemanticVersion = SemanticVersion::new(0, 3, 0);
|
||||
pub const MIN_VERSION: Version = Version::new(0, 3, 0);
|
||||
|
||||
wasmtime::component::bindgen!({
|
||||
async: true,
|
||||
|
||||
@@ -2,13 +2,13 @@ use crate::wasm_host::WasmState;
|
||||
use anyhow::Result;
|
||||
use extension::{KeyValueStoreDelegate, ProjectDelegate, WorktreeDelegate};
|
||||
use gpui::BackgroundExecutor;
|
||||
use semantic_version::SemanticVersion;
|
||||
use semver::Version;
|
||||
use std::sync::{Arc, OnceLock};
|
||||
use wasmtime::component::{Linker, Resource};
|
||||
|
||||
use super::latest;
|
||||
|
||||
pub const MIN_VERSION: SemanticVersion = SemanticVersion::new(0, 4, 0);
|
||||
pub const MIN_VERSION: Version = Version::new(0, 4, 0);
|
||||
|
||||
wasmtime::component::bindgen!({
|
||||
async: true,
|
||||
|
||||
@@ -2,13 +2,13 @@ use crate::wasm_host::WasmState;
|
||||
use anyhow::Result;
|
||||
use extension::{KeyValueStoreDelegate, ProjectDelegate, WorktreeDelegate};
|
||||
use gpui::BackgroundExecutor;
|
||||
use semantic_version::SemanticVersion;
|
||||
use semver::Version;
|
||||
use std::sync::{Arc, OnceLock};
|
||||
use wasmtime::component::{Linker, Resource};
|
||||
|
||||
use super::latest;
|
||||
|
||||
pub const MIN_VERSION: SemanticVersion = SemanticVersion::new(0, 5, 0);
|
||||
pub const MIN_VERSION: Version = Version::new(0, 5, 0);
|
||||
|
||||
wasmtime::component::bindgen!({
|
||||
async: true,
|
||||
|
||||
@@ -21,7 +21,7 @@ use futures::{FutureExt as _, io::BufReader};
|
||||
use gpui::{BackgroundExecutor, SharedString};
|
||||
use language::{BinaryStatus, LanguageName, language_settings::AllLanguageSettings};
|
||||
use project::project_settings::ProjectSettings;
|
||||
use semantic_version::SemanticVersion;
|
||||
use semver::Version;
|
||||
use std::{
|
||||
env,
|
||||
net::Ipv4Addr,
|
||||
@@ -36,8 +36,8 @@ use util::{
|
||||
};
|
||||
use wasmtime::component::{Linker, Resource};
|
||||
|
||||
pub const MIN_VERSION: SemanticVersion = SemanticVersion::new(0, 6, 0);
|
||||
pub const MAX_VERSION: SemanticVersion = SemanticVersion::new(0, 7, 0);
|
||||
pub const MIN_VERSION: Version = Version::new(0, 6, 0);
|
||||
pub const MAX_VERSION: Version = Version::new(0, 7, 0);
|
||||
|
||||
wasmtime::component::bindgen!({
|
||||
async: true,
|
||||
|
||||
Reference in New Issue
Block a user