Skip to content

Commit 58897bf

Browse files
authored
Add a small README.md for wit-bindgen-rt (#1162)
Requested in rust-lang/rust#136395 (comment)
1 parent fc4f633 commit 58897bf

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

crates/guest-rust/rt/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ repository = { workspace = true }
66
license = { workspace = true }
77
homepage = 'https://github.com/bytecodealliance/wit-bindgen'
88
description = """
9-
Runtime support for the `wit-bindgen` crate
9+
Internal runtime support for the `wit-bindgen` crate.
1010
"""
1111

1212
[dependencies]

crates/guest-rust/rt/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# `wit-bindgen-rt`
2+
3+
This is an internal implementation detail of the [`wit-bindgen`] crate. The
4+
source for this crate lives at https://github.com/bytecodealliance/wit-bindgen
5+
and this crate is located in `crates/guest-rust/rt` folder. The purpose of this
6+
crate is to contain "runtime" code related to the macro-expansion of the
7+
`wit_bindgen::generate!` macro such that the `wit-bindgen` crate dependency can
8+
be removed in some situations.
9+
10+
This crate contains a precompiled object file and archive at
11+
`src/cabi_realloc.o` and `src/libwit_bindgen_cabi_realloc.a`. This is compiled
12+
from the source `src/cabi_realloc.c` and is checked in as precompiled to avoid
13+
needing a C compiler at compile-time which isn't always available. This object
14+
file is only used on wasm targets.
15+
16+
The object file is compiled by
17+
[this script]https://github.com/bytecodealliance/wit-bindgen/blob/main/ci/rebuild-libcabi-realloc.sh)
18+
and is verified in repository continuous integration that the checked-in
19+
versions match what CI produces.
20+
21+
[`wit-bindgen`]: https://crates.io/crates/wit-bindgen
22+

0 commit comments

Comments
 (0)