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
336 changes: 328 additions & 8 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ members = [
]

[workspace.dependencies]
wit-bindgen = "0.58.0"
chrono = { git = "https://github.com/chronotope/chrono.git", branch = "0.5.x" }
heck = "0.5"
wit-bindgen = { version = "0.58.0", git = "https://github.com/bytecodealliance/wit-bindgen.git", branch = "main" }
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@ components: $(foreach component,$(COMPONENTS),lib/$(component).wasm $(foreach co

define BUILD_COMPONENT

.PHONY: components/$1
components/$1: lib/$1.wasm lib/$1.debug.wasm

lib/$1.wasm: Cargo.toml Cargo.lock wit/deps $(shell find components/$1 -type f)
cargo component build -p $1 --target wasm32-unknown-unknown --release
cp target/wasm32-unknown-unknown/release/$(subst -,_,$1).wasm lib/$1.wasm
cargo build -p $1 --target wasm32-unknown-unknown --release
wasm-tools component new target/wasm32-unknown-unknown/release/$(subst -,_,$1).wasm -o lib/$1.wasm
cp components/$1/README.md lib/$1.wasm.md

lib/$1.debug.wasm: Cargo.toml Cargo.lock wit/deps $(shell find components/$1 -type f)
cargo component build -p $1 --target wasm32-wasip2
cp target/wasm32-wasip2/debug/$(subst -,_,$1).wasm lib/$1.debug.wasm
cargo build -p $1 --target wasm32-unknown-unknown
wasm-tools component new target/wasm32-unknown-unknown/debug/$(subst -,_,$1).wasm -o lib/$1.debug.wasm
cp components/$1/README.md lib/$1.debug.wasm.md

endef
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ A collection of utility components that remix wasi:filesystem types and interfac

Prereqs:
- a rust toolchain
- [`cargo component`](https://github.com/bytecodealliance/cargo-component)
- [`wasm-tools`](https://github.com/bytecodealliance/wasm-tools)
- [`wkg`](https://github.com/bytecodealliance/wasm-pkg-tools)

```sh
Expand Down
Loading