Skip to content

Commit de290cf

Browse files
authored
Update wasi interfaces to 0.2.6 (#14)
- pin rust to 1.91 Signed-off-by: Scott Andrews <scott@andrews.me>
1 parent d7c0c75 commit de290cf

9 files changed

Lines changed: 34 additions & 36 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,12 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v6
1616
- uses: actions-rust-lang/setup-rust-toolchain@v1
17-
with:
18-
toolchain: 1.84.1
19-
components: rustfmt
20-
target: wasm32-unknown-unknown,wasm32-wasip2
2117
- name: Install cargo binstall
2218
uses: cargo-bins/cargo-binstall@main
23-
- name: Install cargo component
24-
run: cargo binstall --force cargo-component
2519
- name: Install wkg
2620
run: cargo binstall --force wkg
21+
- name: Install cargo-component
22+
run: cargo binstall --force cargo-component
2723
- name: Install wasm-tools
2824
run: cargo binstall --force wasm-tools
2925
- name: Fetch wit
@@ -61,10 +57,6 @@ jobs:
6157
steps:
6258
- uses: actions/checkout@v6
6359
- uses: actions-rust-lang/setup-rust-toolchain@v1
64-
with:
65-
toolchain: 1.84.1
66-
components: rustfmt
67-
target: wasm32-unknown-unknown
6860
- name: Install cargo binstall
6961
uses: cargo-bins/cargo-binstall@main
7062
- name: Install wkg

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ components: $(foreach component,$(COMPONENTS),lib/$(component).wasm $(foreach co
2020
define BUILD_COMPONENT
2121

2222
lib/$1.wasm: Cargo.toml Cargo.lock wit/deps $(shell find components/$1 -type f)
23-
@$(eval TARGET := $(if $(findstring $1,keyvalue-to-filesystem),wasm32-wasip2,wasm32-unknown-unknown))
24-
cargo component build -p $1 --target $(TARGET) --release
25-
cp target/$(TARGET)/release/$(subst -,_,$1).wasm lib/$1.wasm
23+
cargo component build -p $1 --target wasm32-unknown-unknown --release
24+
cp target/wasm32-unknown-unknown/release/$(subst -,_,$1).wasm lib/$1.wasm
2625
cp components/$1/README.md lib/$1.wasm.md
2726

2827
lib/$1.debug.wasm: Cargo.toml Cargo.lock wit/deps $(shell find components/$1 -type f)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ A collection of utility components that remix wasi:filesystem types and interfac
2121
## Build
2222

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

rust-toolchain.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[toolchain]
2+
channel = "1.91"
3+
targets = [ "wasm32-unknown-unknown", "wasm32-wasip2" ]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:clocks@0.2.3;
1+
package wasi:clocks@0.2.6;
22

33
interface wall-clock {
44
record datetime {

wit/deps/wasi-filesystem-0.2.3/package.wit renamed to wit/deps/wasi-filesystem-0.2.6/package.wit

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:filesystem@0.2.3;
1+
package wasi:filesystem@0.2.6;
22

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

3434
/// File size or length of a region within a file.
3535
@since(version = 0.2.0)
@@ -446,6 +446,10 @@ interface types {
446446
set-times-at: func(path-flags: path-flags, path: string, data-access-timestamp: new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code>;
447447
/// Create a hard link.
448448
///
449+
/// Fails with `error-code::no-entry` if the old path does not exist,
450+
/// with `error-code::exist` if the new path already exists, and
451+
/// `error-code::not-permitted` if the old path is not a file.
452+
///
449453
/// Note: This is similar to `linkat` in POSIX.
450454
@since(version = 0.2.0)
451455
link-at: func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow<descriptor>, new-path: string) -> result<_, error-code>;
@@ -516,12 +520,12 @@ interface types {
516520
///
517521
/// Implementations are encouraged to provide the following properties:
518522
///
519-
/// - If the file is not modified or replaced, the computed hash value should
520-
/// usually not change.
521-
/// - If the object is modified or replaced, the computed hash value should
522-
/// usually change.
523-
/// - The inputs to the hash should not be easily computable from the
524-
/// computed hash.
523+
/// - If the file is not modified or replaced, the computed hash value should
524+
/// usually not change.
525+
/// - If the object is modified or replaced, the computed hash value should
526+
/// usually change.
527+
/// - The inputs to the hash should not be easily computable from the
528+
/// computed hash.
525529
///
526530
/// However, none of these is required.
527531
@since(version = 0.2.0)
@@ -569,13 +573,13 @@ interface preopens {
569573
@since(version = 0.2.0)
570574
world imports {
571575
@since(version = 0.2.0)
572-
import wasi:io/error@0.2.3;
576+
import wasi:io/error@0.2.6;
573577
@since(version = 0.2.0)
574-
import wasi:io/poll@0.2.3;
578+
import wasi:io/poll@0.2.6;
575579
@since(version = 0.2.0)
576-
import wasi:io/streams@0.2.3;
580+
import wasi:io/streams@0.2.6;
577581
@since(version = 0.2.0)
578-
import wasi:clocks/wall-clock@0.2.3;
582+
import wasi:clocks/wall-clock@0.2.6;
579583
@since(version = 0.2.0)
580584
import types;
581585
@since(version = 0.2.0)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:io@0.2.3;
1+
package wasi:io@0.2.6;
22

33
interface error {
44
resource error {

wit/worlds.wit

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package componentized:filesystem;
33
world filesystem {
44
import wasi:config/store@0.2.0-rc.1;
55
import wasi:logging/logging@0.1.0-draft;
6-
import wasi:filesystem/preopens@0.2.3;
7-
export wasi:filesystem/preopens@0.2.3;
8-
import wasi:filesystem/types@0.2.3;
9-
export wasi:filesystem/types@0.2.3;
6+
import wasi:filesystem/preopens@0.2.6;
7+
export wasi:filesystem/preopens@0.2.6;
8+
import wasi:filesystem/types@0.2.6;
9+
export wasi:filesystem/types@0.2.6;
1010
}

wkg.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ name = "wasi:filesystem"
1616
registry = "wasi.dev"
1717

1818
[[packages.versions]]
19-
requirement = "=0.2.3"
20-
version = "0.2.3"
21-
digest = "sha256:a8e65d5b946d9c374ae6832ca6f90316e9b51e6f2a8d9691032cd91e25fe221f"
19+
requirement = "=0.2.6"
20+
version = "0.2.6"
21+
digest = "sha256:7b735005e020ee3d727d995c05849c59bbf084b51a054013c0f0796c571e1ab0"
2222

2323
[[packages]]
2424
name = "wasi:logging"

0 commit comments

Comments
 (0)