Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded to Wasmtime v27.0.0 #1200

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,032 changes: 717 additions & 315 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,14 @@ typed-path = "0.10.0"
url = "2.5.4"
uuid = { version = "1.11.0", features = ["serde", "v4", "v5"] }
wasm-wave = "=0.6.0"
wasmtime = { version = "=21.0.1", features = ["component-model"] }
wasmtime-wasi = { version = "=21.0.1" }
wasmtime-wasi-http = { version = "=21.0.1" }
wasmtime = { version = "=27.0.0", features = ["component-model"] }
wasmtime-wasi = { version = "=27.0.0" }
wasmtime-wasi-http = { version = "=27.0.0" }
webpki-roots = { version = "0.26.7" }
xdg = "2.5.2"

[patch.crates-io]
redis-protocol = { git = "https://github.com/golemcloud/redis-protocol.rs.git", branch = "unpin-cookie-factory" }
wasmtime = { git = "https://github.com/golemcloud/wasmtime.git", branch = "golem-wasmtime-v21.0.1" }
wasmtime-wasi = { git = "https://github.com/golemcloud/wasmtime.git", branch = "golem-wasmtime-v21.0.1" }
wasmtime-wasi-http = { git = "https://github.com/golemcloud/wasmtime.git", branch = "golem-wasmtime-v21.0.1" }
wasmtime = { git = "https://github.com/golemcloud/wasmtime.git", branch = "golem-wasmtime-v27.0.0" }
wasmtime-wasi = { git = "https://github.com/golemcloud/wasmtime.git", branch = "golem-wasmtime-v27.0.0" }
wasmtime-wasi-http = { git = "https://github.com/golemcloud/wasmtime.git", branch = "golem-wasmtime-v27.0.0" }
2 changes: 1 addition & 1 deletion golem-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ where
.or_else(|| oss_profile.as_ref().map(|(_, p)| p.config.default_format))
.unwrap_or_default();

init_tracing(parsed.verbosity.clone());
init_tracing(parsed.verbosity);

info!(
profile = format!("{:?}", oss_profile.as_ref().map(|(n, _)| n)),
Expand Down
118 changes: 59 additions & 59 deletions golem-rib/src/function_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,6 @@ use serde::{Deserialize, Serialize};
use std::borrow::Cow;
use std::fmt::Display;

#[derive(Debug, PartialEq, Eq, Clone, Encode, Decode)]
pub enum ParsedFunctionSite {
Global,
Interface {
name: String,
},
PackagedInterface {
namespace: String,
package: String,
interface: String,
version: Option<SemVer>,
},
}

#[derive(PartialEq, Eq, Clone)]
pub struct SemVer(pub semver::Version);

Expand Down Expand Up @@ -108,6 +94,20 @@ impl<'de> BorrowDecode<'de> for SemVer {
}
}

#[derive(Debug, PartialEq, Eq, Clone, Encode, Decode)]
pub enum ParsedFunctionSite {
Global,
Interface {
name: String,
},
PackagedInterface {
namespace: String,
package: String,
interface: String,
version: Option<SemVer>,
},
}

impl ParsedFunctionSite {
pub fn interface_name(&self) -> Option<String> {
match self {
Expand All @@ -129,45 +129,6 @@ impl ParsedFunctionSite {
}
}

#[derive(Debug, PartialEq, Eq, Clone, Encode, Decode)]
pub enum ParsedFunctionReference {
Function {
function: String,
},
RawResourceConstructor {
resource: String,
},
RawResourceDrop {
resource: String,
},
RawResourceMethod {
resource: String,
method: String,
},
RawResourceStaticMethod {
resource: String,
method: String,
},
IndexedResourceConstructor {
resource: String,
resource_params: Vec<String>,
},
IndexedResourceMethod {
resource: String,
resource_params: Vec<String>,
method: String,
},
IndexedResourceStaticMethod {
resource: String,
resource_params: Vec<String>,
method: String,
},
IndexedResourceDrop {
resource: String,
resource_params: Vec<String>,
},
}

#[derive(Debug, PartialEq, Eq, Clone)]
pub enum DynamicParsedFunctionReference {
Function {
Expand Down Expand Up @@ -317,6 +278,45 @@ impl DynamicParsedFunctionReference {
}
}

#[derive(Debug, PartialEq, Eq, Clone, Encode, Decode)]
pub enum ParsedFunctionReference {
Function {
function: String,
},
RawResourceConstructor {
resource: String,
},
RawResourceDrop {
resource: String,
},
RawResourceMethod {
resource: String,
method: String,
},
RawResourceStaticMethod {
resource: String,
method: String,
},
IndexedResourceConstructor {
resource: String,
resource_params: Vec<String>,
},
IndexedResourceMethod {
resource: String,
resource_params: Vec<String>,
method: String,
},
IndexedResourceStaticMethod {
resource: String,
resource_params: Vec<String>,
method: String,
},
IndexedResourceDrop {
resource: String,
resource_params: Vec<String>,
},
}

impl Display for ParsedFunctionReference {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let function_name = match self {
Expand Down Expand Up @@ -491,12 +491,6 @@ impl ParsedFunctionReference {
}
}

#[derive(Debug, PartialEq, Eq, Clone, Encode, Decode)]
pub struct ParsedFunctionName {
pub site: ParsedFunctionSite,
pub function: ParsedFunctionReference,
}

// DynamicParsedFunctionName is different from ParsedFunctionName.
// In `DynamicParsedFunctionName` the resource parameters are `Expr` (Rib) while they are `String`
// in `ParsedFunctionName`.
Expand Down Expand Up @@ -571,6 +565,12 @@ impl Display for DynamicParsedFunctionName {
}
}

#[derive(Debug, PartialEq, Eq, Clone, Encode, Decode)]
pub struct ParsedFunctionName {
pub site: ParsedFunctionSite,
pub function: ParsedFunctionReference,
}

impl Serialize for ParsedFunctionName {
fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let function_name = self.to_string();
Expand Down
2 changes: 1 addition & 1 deletion golem-worker-executor-base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fs-set-times = "0.20.2"
futures = { workspace = true }
futures-util = { workspace = true }
gethostname = "0.5.0"
golem-wit = { version = "=1.1.0" }
golem-wit = { version = "=1.1.1" }
hex = { workspace = true }
http = { workspace = true }
http-body = "1.0.1" # keep in sync with wasmtime
Expand Down
34 changes: 19 additions & 15 deletions golem-worker-executor-base/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,27 @@ fn preview2_mod_gen(golem_wit_path: &str) -> String {
format!(
r#"wasmtime::component::bindgen!({{
path: r"{golem_wit_path}",
interfaces: "
import golem:api/[email protected];
import golem:api/[email protected];
import golem:api/[email protected];
inline: "
package golem:api;

import wasi:blobstore/blobstore;
import wasi:blobstore/container;
import wasi:blobstore/types;
import wasi:keyvalue/[email protected];
import wasi:keyvalue/[email protected];
import wasi:keyvalue/[email protected];
import wasi:keyvalue/[email protected];
import wasi:keyvalue/[email protected];
import wasi:keyvalue/[email protected];
import wasi:logging/logging;
world golem {{
import golem:api/[email protected];
import golem:api/[email protected];
import golem:api/[email protected];

import wasi:blobstore/blobstore;
import wasi:blobstore/container;
import wasi:blobstore/types;
import wasi:keyvalue/[email protected];
import wasi:keyvalue/[email protected];
import wasi:keyvalue/[email protected];
import wasi:keyvalue/[email protected];
import wasi:keyvalue/[email protected];
import wasi:keyvalue/[email protected];
import wasi:logging/logging;
}}
",
world: "golem:api/golem",
tracing: false,
async: true,
trappable_imports: true,
Expand All @@ -94,7 +99,6 @@ fn preview2_mod_gen(golem_wit_path: &str) -> String {
"golem:api/oplog/get-oplog": super::durable_host::golem::v11::GetOplogEntry,
"golem:api/oplog/search-oplog": super::durable_host::golem::v11::SearchOplogEntry
}},
skip_mut_forwarding_impls: true,
}});
"#
)
Expand Down
Loading