Skip to content

Commit 4aedf77

Browse files
authored
Merge pull request #3 from wasmfx/wasmfx-merge
Merge with upstream
2 parents 5a338f5 + 2e72a77 commit 4aedf77

File tree

30 files changed

+375
-283
lines changed

30 files changed

+375
-283
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@ jobs:
137137
- run: cargo build --no-default-features --features csharp
138138
- run: cargo build --no-default-features --features markdown
139139

140+
# Feature combos of the `wit-bindgen` crate
141+
- run: cargo build --target wasm32-wasi -p wit-bindgen --no-default-features
142+
- run: cargo build --target wasm32-wasi -p wit-bindgen --no-default-features --features realloc
143+
- run: cargo build --target wasm32-wasi -p wit-bindgen --no-default-features --features macros
144+
- run: cargo build --target wasm32-wasi -p wit-bindgen --no-default-features --features macros,realloc
145+
140146
# Verity that documentation can be generated for the rust bindings crate.
141147
- run: cargo doc -p wit-bindgen --no-deps
142148
env:

Cargo.lock

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

Cargo.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ resolver = "2"
1818

1919
[workspace.package]
2020
edition = "2021"
21-
version = "0.20.0"
21+
version = "0.21.0"
2222

2323
[workspace.dependencies]
2424
anyhow = "1.0.72"
@@ -35,14 +35,14 @@ wasm-encoder = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "wasmfx-
3535
wit-parser = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "wasmfx-tools-1.201.0+rev.1" }
3636
wit-component = { git = "https://github.com/wasmfx/wasmfx-tools", tag = "wasmfx-tools-1.201.0+rev.1" }
3737

38-
wit-bindgen-core = { path = 'crates/core', version = '0.20.0' }
39-
wit-bindgen-c = { path = 'crates/c', version = '0.20.0' }
40-
wit-bindgen-rust = { path = "crates/rust", version = "0.20.0" }
41-
wit-bindgen-teavm-java = { path = 'crates/teavm-java', version = '0.20.0' }
42-
wit-bindgen-go = { path = 'crates/go', version = '0.20.0' }
43-
wit-bindgen-csharp = { path = 'crates/csharp', version = '0.20.0' }
44-
wit-bindgen-markdown = { path = 'crates/markdown', version = '0.20.0' }
45-
wit-bindgen = { path = 'crates/guest-rust', version = '0.20.0', default-features = false }
38+
wit-bindgen-core = { path = 'crates/core', version = '0.21.0' }
39+
wit-bindgen-c = { path = 'crates/c', version = '0.21.0' }
40+
wit-bindgen-rust = { path = "crates/rust", version = "0.21.0" }
41+
wit-bindgen-teavm-java = { path = 'crates/teavm-java', version = '0.21.0' }
42+
wit-bindgen-go = { path = 'crates/go', version = '0.21.0' }
43+
wit-bindgen-csharp = { path = 'crates/csharp', version = '0.21.0' }
44+
wit-bindgen-markdown = { path = 'crates/markdown', version = '0.21.0' }
45+
wit-bindgen = { path = 'crates/guest-rust', version = '0.21.0', default-features = false }
4646

4747
[[bin]]
4848
name = "wit-bindgen"

ci/publish.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const CRATES_TO_PUBLISH: &[&str] = &[
2525
"wit-bindgen-teavm-java",
2626
"wit-bindgen-markdown",
2727
"wit-bindgen-rust-macro",
28+
"wit-bindgen-rt",
2829
"wit-bindgen",
2930
"wit-bindgen-cli",
3031
];

ci/rebuild-libcabi-realloc.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ version=$(grep '^version =' ./Cargo.toml | sed 's/.*"\(.*\)"/\1/' | sed 's/\./_/
4343

4444
sym=cabi_realloc_wit_bindgen_$version
4545

46-
cat >./crates/guest-rust/src/cabi_realloc.rs <<-EOF
46+
cat >./crates/guest-rust/rt/src/cabi_realloc.rs <<-EOF
4747
// This file is generated by $0
4848
4949
#[no_mangle]
@@ -53,11 +53,11 @@ pub unsafe extern "C" fn $sym(
5353
align: usize,
5454
new_len: usize,
5555
) -> *mut u8 {
56-
crate::rt::cabi_realloc(old_ptr, old_len, align, new_len)
56+
crate::cabi_realloc(old_ptr, old_len, align, new_len)
5757
}
5858
EOF
5959

60-
cat >./crates/guest-rust/src/cabi_realloc.c <<-EOF
60+
cat >./crates/guest-rust/rt/src/cabi_realloc.c <<-EOF
6161
// This file is generated by $0
6262
6363
#include <stdint.h>
@@ -70,16 +70,16 @@ void *cabi_realloc(void *ptr, size_t old_size, size_t align, size_t new_size) {
7070
}
7171
EOF
7272

73-
rm -f crates/guest-rust/src/cabi_realloc.o
74-
$WASI_SDK_PATH/bin/clang crates/guest-rust/src/cabi_realloc.c \
75-
-O -c -o crates/guest-rust/src/cabi_realloc.o
73+
rm -f crates/guest-rust/rt/src/cabi_realloc.o
74+
$WASI_SDK_PATH/bin/clang crates/guest-rust/rt/src/cabi_realloc.c \
75+
-O -c -o crates/guest-rust/rt/src/cabi_realloc.o
7676

7777
# Remove the `producers` section. This appears to differ whether the host for
7878
# clang is either macOS or Linux. Not needed here anyway, so discard it to help
7979
# either host produce the same object.
80-
wasm-tools strip -d producers ./crates/guest-rust/src/cabi_realloc.o \
81-
-o ./crates/guest-rust/src/cabi_realloc.o
80+
wasm-tools strip -d producers ./crates/guest-rust/rt/src/cabi_realloc.o \
81+
-o ./crates/guest-rust/rt/src/cabi_realloc.o
8282

83-
rm -f crates/guest-rust/src/libwit_bindgen_cabi_realloc.a
84-
$WASI_SDK_PATH/bin/llvm-ar crus crates/guest-rust/src/libwit_bindgen_cabi_realloc.a \
85-
crates/guest-rust/src/cabi_realloc.o
83+
rm -f crates/guest-rust/rt/src/libwit_bindgen_cabi_realloc.a
84+
$WASI_SDK_PATH/bin/llvm-ar crus crates/guest-rust/rt/src/libwit_bindgen_cabi_realloc.a \
85+
crates/guest-rust/rt/src/cabi_realloc.o

0 commit comments

Comments
 (0)