Skip to content

Commit

Permalink
Merge pull request #29 from dhil/wasmfx-merge
Browse files Browse the repository at this point in the history
Merge with upstream
  • Loading branch information
dhil authored Oct 11, 2024
2 parents 08fb654 + 5807a59 commit 6d38d1a
Show file tree
Hide file tree
Showing 13 changed files with 173 additions and 132 deletions.
251 changes: 146 additions & 105 deletions Cargo.lock

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ resolver = "2"

[workspace.package]
edition = "2021"
version = "0.33.0"
version = "0.34.0"
license = "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT"
repository = "https://github.com/bytecodealliance/wasi-rs"

Expand All @@ -32,21 +32,21 @@ indexmap = "2.0.0"
prettyplease = "0.2.20"
syn = { version = "2.0", features = ["printing"] }

wasmparser = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "v1.218.0" }
wasm-metadata = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "v1.218.0" }
wasm-encoder = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "v1.218.0" }
wit-parser = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "v1.218.0" }
wit-component = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "v1.218.0" }
wasmparser = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "v1.219.0" }
wasm-metadata = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "v1.219.0" }
wasm-encoder = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "v1.219.0" }
wit-parser = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "v1.219.0" }
wit-component = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "v1.219.0" }

wit-bindgen-core = { path = 'crates/core', version = '0.33.0' }
wit-bindgen-c = { path = 'crates/c', version = '0.33.0' }
wit-bindgen-rust = { path = "crates/rust", version = "0.33.0" }
wit-bindgen-teavm-java = { path = 'crates/teavm-java', version = '0.33.0' }
wit-bindgen-go = { path = 'crates/go', version = '0.33.0' }
wit-bindgen-csharp = { path = 'crates/csharp', version = '0.33.0' }
wit-bindgen-markdown = { path = 'crates/markdown', version = '0.33.0' }
wit-bindgen-moonbit = { path = 'crates/moonbit', version = '0.33.0' }
wit-bindgen = { path = 'crates/guest-rust', version = '0.33.0', default-features = false }
wit-bindgen-core = { path = 'crates/core', version = '0.34.0' }
wit-bindgen-c = { path = 'crates/c', version = '0.34.0' }
wit-bindgen-rust = { path = "crates/rust", version = "0.34.0" }
wit-bindgen-teavm-java = { path = 'crates/teavm-java', version = '0.34.0' }
wit-bindgen-go = { path = 'crates/go', version = '0.34.0' }
wit-bindgen-csharp = { path = 'crates/csharp', version = '0.34.0' }
wit-bindgen-markdown = { path = 'crates/markdown', version = '0.34.0' }
wit-bindgen-moonbit = { path = 'crates/moonbit', version = '0.34.0' }
wit-bindgen = { path = 'crates/guest-rust', version = '0.34.0', default-features = false }

[[bin]]
name = "wit-bindgen"
Expand Down
2 changes: 1 addition & 1 deletion crates/c/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1778,7 +1778,7 @@ impl InterfaceGenerator<'_> {
self.src.c_fns("\n");

let core_module_name = interface_name.map(|s| self.resolve.name_world_key(s));
let export_name = func.core_export_name(core_module_name.as_deref());
let export_name = func.legacy_core_export_name(core_module_name.as_deref());

// Print the actual header for this function into the header file, and
// it's what we'll be calling.
Expand Down
2 changes: 1 addition & 1 deletion crates/csharp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ impl InterfaceGenerator<'_> {

let interop_name = format!("wasmExport{}", func.name.to_upper_camel_case());
let core_module_name = interface_name.map(|s| self.resolve.name_world_key(s));
let export_name = func.core_export_name(core_module_name.as_deref());
let export_name = func.legacy_core_export_name(core_module_name.as_deref());
let access = self.gen.access_modifier();

uwrite!(
Expand Down
4 changes: 2 additions & 2 deletions crates/guest-rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Used when compiling Rust programs to the component model.
"""

[dependencies]
wit-bindgen-rust-macro = { path = "./macro", optional = true, version = "0.33.0" }
wit-bindgen-rt = { path = "./rt", version = "0.33.0", features = ["bitflags"] }
wit-bindgen-rust-macro = { path = "./macro", optional = true, version = "0.34.0" }
wit-bindgen-rt = { path = "./rt", version = "0.34.0", features = ["bitflags"] }

[features]
default = ["macros", "realloc"]
Expand Down
4 changes: 2 additions & 2 deletions crates/guest-rust/rt/src/cabi_realloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

#include <stdint.h>

extern void *cabi_realloc_wit_bindgen_0_33_0(void *ptr, size_t old_size, size_t align, size_t new_size);
extern void *cabi_realloc_wit_bindgen_0_34_0(void *ptr, size_t old_size, size_t align, size_t new_size);

__attribute__((__weak__, __export_name__("cabi_realloc")))
void *cabi_realloc(void *ptr, size_t old_size, size_t align, size_t new_size) {
return cabi_realloc_wit_bindgen_0_33_0(ptr, old_size, align, new_size);
return cabi_realloc_wit_bindgen_0_34_0(ptr, old_size, align, new_size);
}
Binary file modified crates/guest-rust/rt/src/cabi_realloc.o
Binary file not shown.
2 changes: 1 addition & 1 deletion crates/guest-rust/rt/src/cabi_realloc.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file is generated by ./ci/rebuild-libcabi-realloc.sh

#[no_mangle]
pub unsafe extern "C" fn cabi_realloc_wit_bindgen_0_33_0(
pub unsafe extern "C" fn cabi_realloc_wit_bindgen_0_34_0(
old_ptr: *mut u8,
old_len: usize,
align: usize,
Expand Down
Binary file modified crates/guest-rust/rt/src/libwit_bindgen_cabi_realloc.a
Binary file not shown.
2 changes: 1 addition & 1 deletion crates/moonbit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ impl InterfaceGenerator<'_> {

let func_sig = self.sig_string(func, true);

let export_name = func.core_export_name(interface_name);
let export_name = func.legacy_core_export_name(interface_name);

let mut toplevel_generator =
self.gen
Expand Down
2 changes: 1 addition & 1 deletion crates/rust/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ macro_rules! {macro_name} {{
Identifier::World(_) => None,
};
let export_prefix = self.gen.opts.export_prefix.as_deref().unwrap_or("");
let export_name = func.core_export_name(wasm_module_export_name.as_deref());
let export_name = func.legacy_core_export_name(wasm_module_export_name.as_deref());
uwrite!(
self.src,
"\
Expand Down
2 changes: 1 addition & 1 deletion crates/teavm-java/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ impl InterfaceGenerator<'_> {
fn export(&mut self, interface_name: Option<&str>, func: &Function) {
let sig = self.resolve.wasm_signature(AbiVariant::GuestExport, func);

let export_name = func.core_export_name(interface_name);
let export_name = func.legacy_core_export_name(interface_name);

let mut bindgen = FunctionBindgen::new(
self,
Expand Down
4 changes: 2 additions & 2 deletions crates/test-helpers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::process::Command;
use wasm_encoder::{Encode, Section};
use wit_bindgen_core::Files;
use wit_component::StringEncoding;
use wit_parser::{Resolve, WorldId};
use wit_parser::{Mangling, Resolve, WorldId};

/// Returns a suitable directory to place output for tests within.
///
Expand Down Expand Up @@ -96,7 +96,7 @@ pub fn run_component_codegen_test(
) {
let (resolve, world) = parse_wit(wit_path);
let world_name = &resolve.worlds[world].name;
let mut wasm = wit_component::dummy_module(&resolve, world);
let mut wasm = wit_component::dummy_module(&resolve, world, Mangling::Standard32);
let encoded =
wit_component::metadata::encode(&resolve, world, StringEncoding::UTF8, None).unwrap();
let section = wasm_encoder::CustomSection {
Expand Down

0 comments on commit 6d38d1a

Please sign in to comment.