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
12 changes: 2 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@ jobs:
steps:
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.84.1
components: rustfmt
target: wasm32-unknown-unknown,wasm32-wasip2
- name: Install cargo binstall
uses: cargo-bins/cargo-binstall@main
- name: Install cargo component
run: cargo binstall --force cargo-component
- name: Install wkg
run: cargo binstall --force wkg
- name: Install cargo-component
run: cargo binstall --force cargo-component
- name: Install wasm-tools
run: cargo binstall --force wasm-tools
- name: Fetch wit
Expand Down Expand Up @@ -61,10 +57,6 @@ jobs:
steps:
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.84.1
components: rustfmt
target: wasm32-unknown-unknown
- name: Install cargo binstall
uses: cargo-bins/cargo-binstall@main
- name: Install wkg
Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ components: $(foreach component,$(COMPONENTS),lib/$(component).wasm $(foreach co
define BUILD_COMPONENT

lib/$1.wasm: Cargo.toml Cargo.lock wit/deps $(shell find components/$1 -type f)
@$(eval TARGET := $(if $(findstring $1,keyvalue-to-filesystem),wasm32-wasip2,wasm32-unknown-unknown))
cargo component build -p $1 --target $(TARGET) --release
cp target/$(TARGET)/release/$(subst -,_,$1).wasm lib/$1.wasm
cargo component build -p $1 --target wasm32-unknown-unknown --release
cp target/wasm32-unknown-unknown/release/$(subst -,_,$1).wasm 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)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ A collection of utility components that remix wasi:filesystem types and interfac
## Build

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

Expand Down
3 changes: 3 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[toolchain]
channel = "1.91"
targets = [ "wasm32-unknown-unknown", "wasm32-wasip2" ]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:clocks@0.2.3;
package wasi:clocks@0.2.6;

interface wall-clock {
record datetime {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:filesystem@0.2.3;
package wasi:filesystem@0.2.6;

/// WASI filesystem is a filesystem API primarily intended to let users run WASI
/// programs that access their files on their existing filesystems, without
Expand Down Expand Up @@ -27,9 +27,9 @@ package wasi:filesystem@0.2.3;
@since(version = 0.2.0)
interface types {
@since(version = 0.2.0)
use wasi:io/streams@0.2.3.{input-stream, output-stream, error};
use wasi:io/streams@0.2.6.{input-stream, output-stream, error};
@since(version = 0.2.0)
use wasi:clocks/wall-clock@0.2.3.{datetime};
use wasi:clocks/wall-clock@0.2.6.{datetime};

/// File size or length of a region within a file.
@since(version = 0.2.0)
Expand Down Expand Up @@ -446,6 +446,10 @@ interface types {
set-times-at: func(path-flags: path-flags, path: string, data-access-timestamp: new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code>;
/// Create a hard link.
///
/// Fails with `error-code::no-entry` if the old path does not exist,
/// with `error-code::exist` if the new path already exists, and
/// `error-code::not-permitted` if the old path is not a file.
///
/// Note: This is similar to `linkat` in POSIX.
@since(version = 0.2.0)
link-at: func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow<descriptor>, new-path: string) -> result<_, error-code>;
Expand Down Expand Up @@ -516,12 +520,12 @@ interface types {
///
/// Implementations are encouraged to provide the following properties:
///
/// - If the file is not modified or replaced, the computed hash value should
/// usually not change.
/// - If the object is modified or replaced, the computed hash value should
/// usually change.
/// - The inputs to the hash should not be easily computable from the
/// computed hash.
/// - If the file is not modified or replaced, the computed hash value should
/// usually not change.
/// - If the object is modified or replaced, the computed hash value should
/// usually change.
/// - The inputs to the hash should not be easily computable from the
/// computed hash.
///
/// However, none of these is required.
@since(version = 0.2.0)
Expand Down Expand Up @@ -569,13 +573,13 @@ interface preopens {
@since(version = 0.2.0)
world imports {
@since(version = 0.2.0)
import wasi:io/error@0.2.3;
import wasi:io/error@0.2.6;
@since(version = 0.2.0)
import wasi:io/poll@0.2.3;
import wasi:io/poll@0.2.6;
@since(version = 0.2.0)
import wasi:io/streams@0.2.3;
import wasi:io/streams@0.2.6;
@since(version = 0.2.0)
import wasi:clocks/wall-clock@0.2.3;
import wasi:clocks/wall-clock@0.2.6;
@since(version = 0.2.0)
import types;
@since(version = 0.2.0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:io@0.2.3;
package wasi:io@0.2.6;

interface error {
resource error {
Expand Down
8 changes: 4 additions & 4 deletions wit/worlds.wit
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package componentized:filesystem;
world filesystem {
import wasi:config/store@0.2.0-rc.1;
import wasi:logging/logging@0.1.0-draft;
import wasi:filesystem/preopens@0.2.3;
export wasi:filesystem/preopens@0.2.3;
import wasi:filesystem/types@0.2.3;
export wasi:filesystem/types@0.2.3;
import wasi:filesystem/preopens@0.2.6;
export wasi:filesystem/preopens@0.2.6;
import wasi:filesystem/types@0.2.6;
export wasi:filesystem/types@0.2.6;
}
6 changes: 3 additions & 3 deletions wkg.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ name = "wasi:filesystem"
registry = "wasi.dev"

[[packages.versions]]
requirement = "=0.2.3"
version = "0.2.3"
digest = "sha256:a8e65d5b946d9c374ae6832ca6f90316e9b51e6f2a8d9691032cd91e25fe221f"
requirement = "=0.2.6"
version = "0.2.6"
digest = "sha256:7b735005e020ee3d727d995c05849c59bbf084b51a054013c0f0796c571e1ab0"

[[packages]]
name = "wasi:logging"
Expand Down