Skip to content
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
76 changes: 38 additions & 38 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ syn = { version = "2.0.89", features = ["printing"] }
futures = "0.3.31"
macro-string = "0.2.0"

wat = "1.254.0"
wasmparser = "0.254.0"
wasm-encoder = "0.254.0"
wasm-metadata = { version = "0.254.0", default-features = false }
wit-parser = "0.254.0"
wit-component = "0.254.0"
wasm-compose = "0.254.0"
wat = "1.257.0"
wasmparser = "0.257.0"
wasm-encoder = "0.257.0"
wasm-metadata = { version = "0.257.0", default-features = false }
wit-parser = "0.257.0"
wit-component = "0.257.0"
wasm-compose = "0.257.0"

wit-bindgen-core = { path = 'crates/core', version = '0.60.0' }
wit-bindgen-c = { path = 'crates/c', version = '0.60.0' }
Expand Down
23 changes: 23 additions & 0 deletions ci/rebuild-libwit-bindgen-cabi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ set -ex
version=$(./ci/print-current-version.sh | sed 's/\./_/g')

realloc=cabi_realloc_wit_bindgen_$version
wasip3_get=wit_bindgen_${version}_get_task_context
wasip3_set=wit_bindgen_${version}_set_task_context

rm -f crates/guest-rust/src/rt/wit_bindgen_*.{rs,o,c}
rm -f crates/guest-rust/src/rt/libwit_bindgen_cabi.a
Expand All @@ -60,6 +62,17 @@ pub unsafe extern "C" fn $realloc(
}
EOF

cat >./crates/guest-rust/src/rt/async_support/wasip3_context.rs <<-EOF
// This file is generated by $0

unsafe extern "C" {
#[link_name = "$wasip3_get"]
pub fn get() -> *mut u8;
#[link_name = "$wasip3_set"]
pub fn set(ptr: *mut u8);
}
EOF

cat >./crates/guest-rust/src/rt/wit_bindgen_cabi_realloc.c <<-EOF
// This file is generated by $0

Expand All @@ -86,6 +99,16 @@ void *wasip3_task_set(void *ptr) {
WASIP3_TASK = ptr;
return ret;
}

static _Thread_local void *task_context = NULL;

void *$wasip3_get(void) {
return task_context;
}

void $wasip3_set(void *ptr) {
task_context = ptr;
}
EOF

build() {
Expand Down
Loading
Loading