Skip to content

Commit 1fa96f9

Browse files
committed
Bump wit-bindgen to v0.43.0
Signed-off-by: Brian Hardock <[email protected]>
1 parent 196e743 commit 1fa96f9

File tree

11 files changed

+174
-126
lines changed

11 files changed

+174
-126
lines changed

Cargo.lock

Lines changed: 144 additions & 85 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ rust-version = "1.78"
9191
homepage = "https://spinframework.dev/rust-components"
9292

9393
[workspace.dependencies]
94-
wit-bindgen = "0.16.0"
94+
wit-bindgen = "0.43.0"
9595
futures = "0.3.28"
9696
once_cell = "1.18.0"
9797
# Pin to the last version that targeted WASI 0.2.0

crates/macro/src/lib.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,19 +159,19 @@ pub fn http_component(_attr: TokenStream, item: TokenStream) -> TokenStream {
159159

160160
impl From<self::preamble::wasi::http::types::IncomingRequest> for ::spin_sdk::http::IncomingRequest {
161161
fn from(req: self::preamble::wasi::http::types::IncomingRequest) -> Self {
162-
unsafe { Self::from_handle(req.into_handle()) }
162+
unsafe { Self::from_handle(req.take_handle()) }
163163
}
164164
}
165165

166166
impl From<::spin_sdk::http::OutgoingResponse> for self::preamble::wasi::http::types::OutgoingResponse {
167167
fn from(resp: ::spin_sdk::http::OutgoingResponse) -> Self {
168-
unsafe { Self::from_handle(resp.into_handle()) }
168+
unsafe { Self::from_handle(resp.take_handle()) }
169169
}
170170
}
171171

172172
impl From<self::preamble::wasi::http::types::ResponseOutparam> for ::spin_sdk::http::ResponseOutparam {
173173
fn from(resp: self::preamble::wasi::http::types::ResponseOutparam) -> Self {
174-
unsafe { Self::from_handle(resp.into_handle()) }
174+
unsafe { Self::from_handle(resp.take_handle()) }
175175
}
176176
}
177177
}
@@ -187,10 +187,6 @@ enum Export {
187187
}
188188

189189
fn preamble(export: Export) -> proc_macro2::TokenStream {
190-
let export_decl = match export {
191-
Export::WasiHttp => quote!("wasi:http/incoming-handler": Spin),
192-
Export::Redis => quote!("fermyon:spin/inbound-redis": Spin),
193-
};
194190
let world = match export {
195191
Export::WasiHttp => quote!("wasi-http-trigger"),
196192
Export::Redis => quote!("redis-trigger"),
@@ -201,10 +197,9 @@ fn preamble(export: Export) -> proc_macro2::TokenStream {
201197
world: #world,
202198
path: #WIT_PATH,
203199
runtime_path: "::spin_sdk::wit_bindgen::rt",
204-
exports: {
205-
#export_decl
206-
}
200+
generate_all,
207201
});
208202
pub struct Spin;
203+
export!(Spin);
209204
}
210205
}

src/lib.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,13 @@ pub mod wit {
3030
"wasi:io/[email protected]": ::wasi::io::error,
3131
"wasi:io/[email protected]": ::wasi::io::streams,
3232
"wasi:io/[email protected]": ::wasi::io::poll,
33-
}
33+
},
34+
generate_all,
3435
});
3536
pub use fermyon::spin2_0_0 as v2;
3637
pub use spin::postgres::postgres as pg3;
3738
}
3839

39-
/// Needed by the export macro
40-
///
41-
/// See [this commit](https://github.com/bytecodealliance/wit-bindgen/pull/394/commits/9d2ea88f986f4a883ba243449e3a070cac18958e) for more info.
42-
#[cfg(target_arch = "wasm32")]
43-
#[doc(hidden)]
44-
pub use wit::__link_section;
45-
4640
#[export_name = concat!("spin-sdk-version-", env!("SDK_VERSION"))]
4741
extern "C" fn __spin_sdk_version() {}
4842

wit/deps/[email protected]/postgres.wit

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ interface postgres {
3535
int16(s16),
3636
int32(s32),
3737
int64(s64),
38-
floating32(float32),
39-
floating64(float64),
38+
floating32(f32),
39+
floating64(f64),
4040
str(string),
4141
binary(list<u8>),
4242
date(tuple<s32, u8, u8>), // (year, month, day)
@@ -57,8 +57,8 @@ interface postgres {
5757
int16(s16),
5858
int32(s32),
5959
int64(s64),
60-
floating32(float32),
61-
floating64(float64),
60+
floating32(f32),
61+
floating64(f64),
6262
str(string),
6363
binary(list<u8>),
6464
date(tuple<s32, u8, u8>), // (year, month, day)

wit/deps/[email protected]/llm.wit

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ interface llm {
1010
/// Note: the backing implementation may return less tokens.
1111
max-tokens: u32,
1212
/// The amount the model should avoid repeating tokens.
13-
repeat-penalty: float32,
13+
repeat-penalty: f32,
1414
/// The number of tokens the model should apply the repeat penalty to.
1515
repeat-penalty-last-n-token-count: u32,
1616
/// The randomness with which the next token is selected.
17-
temperature: float32,
17+
temperature: f32,
1818
/// The number of possible next tokens the model will choose from.
1919
top-k: u32,
2020
/// The probability total of next tokens the model will choose from.
21-
top-p: float32
21+
top-p: f32
2222
}
2323

2424
/// The set of errors which may be raised by functions in this interface
@@ -57,7 +57,7 @@ interface llm {
5757
/// Result of generating embeddings
5858
record embeddings-result {
5959
/// The embeddings generated by the request
60-
embeddings: list<list<float32>>,
60+
embeddings: list<list<f32>>,
6161
/// Usage related to the embeddings generation request
6262
usage: embeddings-usage
6363
}

wit/deps/[email protected]/rdbms-types.wit

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ interface rdbms-types {
3737
uint16(u16),
3838
uint32(u32),
3939
uint64(u64),
40-
floating32(float32),
41-
floating64(float64),
40+
floating32(f32),
41+
floating64(f64),
4242
str(string),
4343
binary(list<u8>),
4444
db-null,
@@ -56,8 +56,8 @@ interface rdbms-types {
5656
uint16(u16),
5757
uint32(u32),
5858
uint64(u64),
59-
floating32(float32),
60-
floating64(float64),
59+
floating32(f32),
60+
floating64(f64),
6161
str(string),
6262
binary(list<u8>),
6363
db-null,

wit/deps/[email protected]/sqlite.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ interface sqlite {
4242
/// A single column's result from a database query
4343
variant value {
4444
integer(s64),
45-
real(float64),
45+
real(f64),
4646
text(string),
4747
blob(list<u8>),
4848
null

wit/deps/spin@unversioned/llm.wit

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ interface llm {
1010
/// Note: the backing implementation may return less tokens.
1111
max-tokens: u32,
1212
/// The amount the model should avoid repeating tokens.
13-
repeat-penalty: float32,
13+
repeat-penalty: f32,
1414
/// The number of tokens the model should apply the repeat penalty to.
1515
repeat-penalty-last-n-token-count: u32,
1616
/// The randomness with which the next token is selected.
17-
temperature: float32,
17+
temperature: f32,
1818
/// The number of possible next tokens the model will choose from.
1919
top-k: u32,
2020
/// The probability total of next tokens the model will choose from.
21-
top-p: float32
21+
top-p: f32
2222
}
2323

2424
/// The set of errors which may be raised by functions in this interface
@@ -57,7 +57,7 @@ interface llm {
5757
/// Result of generating embeddings
5858
record embeddings-result {
5959
/// The embeddings generated by the request
60-
embeddings: list<list<float32>>,
60+
embeddings: list<list<f32>>,
6161
/// Usage related to the embeddings generation request
6262
usage: embeddings-usage
6363
}

wit/deps/spin@unversioned/rdbms-types.wit

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ interface rdbms-types {
2626
uint16(u16),
2727
uint32(u32),
2828
uint64(u64),
29-
floating32(float32),
30-
floating64(float64),
29+
floating32(f32),
30+
floating64(f64),
3131
str(string),
3232
binary(list<u8>),
3333
db-null,
@@ -44,8 +44,8 @@ interface rdbms-types {
4444
uint16(u16),
4545
uint32(u32),
4646
uint64(u64),
47-
floating32(float32),
48-
floating64(float64),
47+
floating32(f32),
48+
floating64(f64),
4949
str(string),
5050
binary(list<u8>),
5151
db-null,

0 commit comments

Comments
 (0)