Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
c3c806d
An initial preview1 polyfill stub.
sunfishcode Oct 3, 2022
9f317d0
Add test on CI and infrastructure for wasm globals (#1)
alexcrichton Oct 5, 2022
77cfc4d
Add a comment about a disabled lint.
sunfishcode Oct 5, 2022
3c9e371
Add an `extern "C"` to the Rust code comment.
sunfishcode Oct 5, 2022
7ad3b58
Use `*mut u8` instead of `usize` to hold pointers.
sunfishcode Oct 5, 2022
1b33770
Mark the WASI functions `unsafe`.
sunfishcode Oct 5, 2022
3a9d476
Fix the inline asm comment to match the code.
sunfishcode Oct 5, 2022
2b14421
Implement a polyfill for `path_readlink`.
sunfishcode Oct 5, 2022
541eba9
Use raw_strings, disable integer overflow checks, and suppress jump t…
sunfishcode Oct 5, 2022
394847a
Use a compiler_fence.
sunfishcode Oct 5, 2022
7823878
Add a slow-path to handle smaller buffers passed to `path_readlink`.
sunfishcode Oct 5, 2022
105914e
These `forget`s aren't needed because they just have references.
sunfishcode Oct 5, 2022
b02371b
Properly forget returned buffers.
sunfishcode Oct 5, 2022
f27cb00
Remove the code that disabled the global allocator.
sunfishcode Oct 5, 2022
533bd31
Mark `path_readlink_slow` as inline(never).
sunfishcode Oct 5, 2022
22def17
Minor cleanups.
sunfishcode Oct 5, 2022
bec95fa
Remove `unregister_buffer`.
sunfishcode Oct 6, 2022
cd71cd1
Implement file descriptors.
sunfishcode Oct 7, 2022
c0551ad
Implement more stuff.
sunfishcode Oct 7, 2022
ab9a1ac
Implement more functions.
sunfishcode Oct 7, 2022
3cc7342
Fixes to avoid static inits.
sunfishcode Oct 7, 2022
a30558a
Add a file descriptor bounds check.
sunfishcode Oct 7, 2022
ac64e34
Simplify a few casts.
sunfishcode Oct 7, 2022
0e29983
Multiply memory.grow's result by the page size, and handle failure.
sunfishcode Oct 10, 2022
629231e
Remove an unneeded `register_buffer`.
sunfishcode Oct 10, 2022
b5175d3
Convert to use `u32` indices instead of handles.
sunfishcode Oct 18, 2022
66f6c66
fd_info fixup
Oct 24, 2022
5db1242
switch to latest wit_bindgen_guest_rust macro
Oct 24, 2022
3b637e2
notes for what to do next
Oct 28, 2022
5abb9d3
adapter: take args, have two cabi_{import,export}_realloc funcs, and …
Nov 8, 2022
2ab5b8c
skip codegen for command, and fill in the entrypoint manually
Nov 9, 2022
58497fd
cabi_export_realloc is another bad allocator for our bad allocator mu…
Nov 10, 2022
f4baeb2
Merge pull request #5 from sunfishcode/no-handles
pchickey Nov 14, 2022
4974e79
Implement polyfills for several wasi-filesystem functions
sunfishcode Nov 22, 2022
41b94d5
Implement fd_filestat_set_size, fd_pread, and fd_pwrite.
sunfishcode Nov 22, 2022
4a102a2
Implement path_create_directory, path_filestat_get, path_link.
sunfishcode Nov 23, 2022
be17956
Implement path_rename, path_symlink, and path_unlink_file.
sunfishcode Nov 23, 2022
28cb8bd
Swap `info` and `fd-info`
sunfishcode Nov 23, 2022
87854bb
Implement `fd_fdstat_get` and `fd_fdstat_set_flags`.
sunfishcode Nov 23, 2022
acf9dc2
Implement `clock_{time,res}_get` (#12)
alexcrichton Nov 30, 2022
567d941
Update Wasmtime/tooling dependencies (#14)
alexcrichton Dec 1, 2022
2503102
Simplify global state management in adapter (#13)
alexcrichton Dec 1, 2022
b541187
Implement `args_{get,sizes_get}` functions (#16)
alexcrichton Dec 1, 2022
20bccd2
sketch of `poll_oneoff` polyfill (#11)
dicej Dec 6, 2022
3477cd0
Update a few aspects of the adapter build (#17)
alexcrichton Dec 7, 2022
91fff49
Implement `path_open`. (#18)
sunfishcode Dec 7, 2022
6f0e31c
Add a `badf` error code.
sunfishcode Dec 7, 2022
57b934c
Fix prints in non-command builds (#19)
alexcrichton Dec 8, 2022
0a54cdf
Implement the `fd_readdir` function (#23)
alexcrichton Dec 13, 2022
bf3d212
Implement `fd_renumber`. (#21)
sunfishcode Dec 13, 2022
e0c00bd
Don't print extra metadata in stdout/stderr, and implement proc_exit …
sunfishcode Dec 16, 2022
6dc3646
add tests for `wasi-random`, `wasi-clocks`, and stdin (#30)
dicej Dec 17, 2022
e20ab42
Add a way to get a random `u64`. (#36)
sunfishcode Dec 22, 2022
36a0fa7
Fix `fd_renumber` to handle output fds that aren't previously allocat…
sunfishcode Dec 23, 2022
32c1a87
add support for environment variables and preopens
dicej Dec 23, 2022
bad0f20
implement more host filesystem functions
dicej Dec 23, 2022
decb08c
Add pseudo-streams. (#29)
sunfishcode Dec 23, 2022
21ba68b
Implement `command` exit statuses. (#40)
sunfishcode Dec 24, 2022
359a796
implement `wasi-filesystem::readdir` and related functions (#45)
dicej Jan 4, 2023
3a49d68
Minor cleanups (#49)
sunfishcode Jan 6, 2023
72feade
Try to detect memory corruption with "magic" canaries (#52)
alexcrichton Jan 9, 2023
49cd5e4
Implement file append functionality. (#50)
sunfishcode Jan 9, 2023
e34b6d9
Fix some bugs turned up in the Wasmtime testsuite.
sunfishcode Dec 27, 2022
e5ee34f
Allocate bool results at the end of the events buffer.
sunfishcode Jan 18, 2023
6a41baf
Don't fail poll for per-fd failures.
sunfishcode Jan 18, 2023
902ca94
Implement `sync` and `datasync` on files and directories.
sunfishcode Jan 11, 2023
66e39bb
Add `eprintln`, `unreachable`, and other macros. (#62)
sunfishcode Jan 19, 2023
528f095
Use the `wasi-stderr` API for stderr (#59)
sunfishcode Jan 21, 2023
9b10c0b
Change the filesystem timestamp to seconds+nanoseconds. (#55)
sunfishcode Jan 21, 2023
710cc4c
Update wasmtime and wit-bindgen (#68)
alexcrichton Jan 25, 2023
556cea3
Use a more targeted means of specifying link flags (#71)
alexcrichton Jan 26, 2023
a25f3f6
Fix the non-command build (#72)
alexcrichton Jan 26, 2023
56048d4
Rename `wasi-future` to `waitable`. (#70)
sunfishcode Jan 30, 2023
1c79bde
use main module's `cabi_realloc` instead of `memory.grow`
dicej Feb 1, 2023
4a552e5
Merge pull request #74 from dicej/use-realloc
dicej Feb 1, 2023
3c4e2ff
Add basic TCP socket APIs. (#33)
sunfishcode Feb 2, 2023
b81c321
Add the preview1 `sock_accept` function declaration to the polyfill. …
sunfishcode Feb 4, 2023
60178d0
Split wasi-stream into separate input and output stream types. (#73)
sunfishcode Feb 6, 2023
b808197
polyfill: fill in fdflags_append from File::append
Feb 6, 2023
b1f5309
short-circuit reentrance when allocating stack and `State` (#83)
dicej Feb 13, 2023
0d9bc47
Move to crates.io/releases of dependencies (#84)
alexcrichton Feb 13, 2023
11e24c2
replace `fn unwrap` and `fn unwrap_result` with postfix `.trapping_un…
pchickey Feb 15, 2023
fb8997a
Update wasi-filesystem, wasi-clocks, wasi-io, and wasi-poll.
sunfishcode Feb 15, 2023
2339c01
Merge pull request #87 from bytecodealliance/sunfishcode/update-wasi
pchickey Feb 15, 2023
7989053
Refactor adapter's allocators (#88)
pchickey Feb 17, 2023
505ed0b
get environment and preopens through import functions
Feb 9, 2023
cf2446e
add arena allocator for get_environment and get_preopens
Feb 16, 2023
0e8ee1d
comments
Feb 16, 2023
6ba1658
Merge pull request #90 from bytecodealliance/pch/import_preopens_envi…
pchickey Feb 17, 2023
8c51e15
Make Preview2's directory iterator omit `.` and `..`. (#89)
sunfishcode Feb 21, 2023
f807e25
Fix timestamp-to-nanosecond conversion in the adapter (#93)
alexcrichton Feb 22, 2023
ed90c0e
short-circuit `fd_write` in the adapter
dicej Feb 22, 2023
107b07d
Merge pull request #94 from dicej/fd-write-short-circuit
dicej Feb 23, 2023
a8295ae
Rebase on the new wasi-sockets. (#91)
sunfishcode Feb 25, 2023
70a1528
Rebase on the wasi-cli world. (#100)
sunfishcode Mar 6, 2023
34aaaa7
code motion: cli related feature names (#104)
pchickey Mar 8, 2023
6019641
Update to the latest wit files.
sunfishcode Feb 27, 2023
bb86a3e
Support command-line argument preopens.
sunfishcode Mar 8, 2023
684bebb
Minor code simplification.
sunfishcode Mar 8, 2022
028c1bb
Merge pull request #106 from bytecodealliance/sunfishcode/update-wit
pchickey Mar 8, 2023
d4df7eb
drop cli- prefix from reactor, command features & artifact names
Mar 8, 2023
3059748
Merge pull request #107 from bytecodealliance/pch/features_drop_cli
pchickey Mar 8, 2023
788e3d2
intrinsics: just abstract the archive syms a little bit
Mar 8, 2023
b5f6a9c
intrinsics: add stderr stream to globals, plus getter/setter funcs
Mar 8, 2023
777dd77
wire up adapter macros to stderr stream print
Mar 8, 2023
f806863
adapter: make it a little clearer where unreachable is coming from
Mar 9, 2023
9d23a6c
host and adapter: provide stdio via preopens, dont pass stdio or arg …
Mar 21, 2023
ffa75f0
get rid of arg_preopens from state, env_preopens are just preopens
Mar 22, 2023
1af3c41
factor descriptors out into a separate module
Mar 22, 2023
e199109
fix macros
Mar 23, 2023
0be419f
fix
Mar 23, 2023
a9ddff8
renumber: allow overwriting. note it may invalidate preopen table
Mar 23, 2023
c5ca3f1
poll_oneoff: use import allocator solely on the import func call
Mar 23, 2023
378537c
Update build.rs
pchickey Mar 23, 2023
fdd91a9
Descriptors is initialized on creation, use refcell<option<descriptor…
Mar 23, 2023
071041a
Merge pull request #123 from bytecodealliance/pch/stdio3
pchickey Mar 23, 2023
f336265
adapter: arguments are lazily initialized in State instead of passed …
Mar 24, 2023
566da91
rename command's `main` to `run` (unfortunately)
Mar 24, 2023
d9eb1fa
Merge pull request #125 from bytecodealliance/pch/environ_args
pchickey Mar 24, 2023
e5b6452
Remove resource abstraction from clocks (#129)
pchickey Apr 4, 2023
de9711a
Rename the command entrypoint from `run` back to `main`. (#131)
sunfishcode Apr 5, 2023
77845fc
fix wasi renumber test: return an error in adapter if closing a close…
Apr 6, 2023
0042b6f
NFC: pull eventtype const definitions out to be reused further down
Apr 7, 2023
8f80add
size assertion: refactor to de-duplicate MAX_DESCRIPTORS definition
Apr 7, 2023
8a32f7d
File: we need to have the DescriptorType around to handle certain cor…
Apr 7, 2023
2078d13
fd_seek: return the expected errno when trying to seek on a directory.
Apr 7, 2023
f9b73d9
Merge pull request #137 from bytecodealliance/pch/fix_renumber
pchickey Apr 11, 2023
4755464
fix fd_filestat_get: adapter special-case StreamType::Unknown (#139)
pchickey Apr 11, 2023
b6d5f24
return ERRNO_BADF on directory descriptors in appropriate fd operations
Apr 13, 2023
e0071af
Merge remote-tracking branch 'origin/main' into pch/fix_more_fs_tests
Apr 14, 2023
ea15c6f
dead code
Apr 14, 2023
81b4ffe
adapter: fd_allocate gives notsup on all files
Apr 17, 2023
3d6e55e
adapter: remove incorrect assertions from path_readlink
Apr 17, 2023
4bba05d
readlink: fix adapter to return right len, and test to expect truncation
Apr 17, 2023
34d237e
Merge pull request #143 from bytecodealliance/pch/deprecate_fd_allocate
pchickey Apr 17, 2023
0c293aa
Merge pull request #144 from bytecodealliance/pch/fix_readlink
pchickey Apr 19, 2023
b8018ed
adapter: track blocking state in File, remove uses of set-flags
Apr 20, 2023
b0fed76
adapter: change logic around interpeting ATIM and ATIM_NOW (and MTIM …
Apr 20, 2023
3110ec5
Merge remote-tracking branch 'origin/main' into pch/atim_now
Apr 20, 2023
ed353db
Merge pull request #150 from bytecodealliance/pch/atim_now
pchickey Apr 20, 2023
fddf6ca
fd_seek: error with invalid offsets in the adapter
Apr 20, 2023
93e4bd1
NFC, looks more consistient to my eye though
Apr 20, 2023
f0ed67a
fix bug in adapter fd_fdstat_set_flags to frob the append flag.
Apr 21, 2023
806d23d
delete spurrious extra line in adapter (this same var is created below)
Apr 21, 2023
70dce69
Merge pull request #151 from bytecodealliance/pch/seek
pchickey Apr 21, 2023
0229260
adapter poll_oneoff: when descriptors.get_*_stream(fd) fails, die wit…
pchickey Apr 24, 2023
87f74e9
adapter: path_ apis return NOTDIR instead of BADF when passed file; f…
pchickey Apr 27, 2023
1e04bf2
adapter: StreamType::Unknown is actually Stdio (#161)
pchickey May 3, 2023
4f84e64
Revert #131, renaming `main` back to `run`. (#165)
sunfishcode May 3, 2023
e176feb
prepare adapter directory layout for upstreaming (#172)
pchickey May 12, 2023
669ab55
Merge remote-tracking branch 'origin/main' into pch/merge_adapter_to_…
May 12, 2023
3504c0c
ci: add build-preview1-component-adapter step. prtest:full
May 12, 2023
bb5d051
temporary: always run the adapter build CI step
May 12, 2023
424deb9
add ci/build-wasi-preview1-component-adapter script
May 12, 2023
880f94a
put both adapter binaries in one artifact, name it bins-*, publish it
May 12, 2023
968a61d
restore adapter to only building if run-full
May 12, 2023
19858dd
change adapter to be part of root workspace
May 15, 2023
a59ed4e
rm deps.lock, toml: wit-deps integration is not implemented
May 15, 2023
1a2e833
use latest wit-bindgen, add wildcard audits for wit-bindgen and wasm-…
May 15, 2023
7bd2d76
cargo-vet all remaining dependency bumps
May 15, 2023
c2dea4c
cargo deny: allow the Unicode-DFS-2016 license
May 15, 2023
e2e9aba
run-tests: exclude the adapter, which doesnt build for native
May 15, 2023
0259833
adapter: compile_error when not wasm32-unknown-unknown, and note this…
May 15, 2023
9c61c74
exclude adapter from tests build with manifest instead of run-tests.sh
May 15, 2023
aeef73c
adapter ci step requires submodules checkout now
May 15, 2023
1b5f416
adapter and byte-array-literals are publish = false
May 15, 2023
651dab1
delete adatper Cargo.lock
May 15, 2023
44b9d6c
cfg static assertion in adapter so it builds for native
May 15, 2023
22ccf87
still need test = false because adapter cant link on native
May 15, 2023
21def76
remove version constraint from adapter and bytearray in workspace dep…
May 15, 2023
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
37 changes: 37 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,43 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}

build-preview1-component-adapter:
name: Build wasi-preview1-component-adapter
needs: determine
if: needs.determine.outputs.run-full
runs-on: ubuntu-latest
permissions:
deployments: write
contents: write
steps:
- uses: actions/checkout@v3
with:
submodules: true
- run: rustup update stable && rustup default stable
- run: rustup target add wasm32-wasi wasm32-unknown-unknown

- name: Install wasm-tools
run: |
curl -L https://github.com/bytecodealliance/wasm-tools/releases/download/wasm-tools-1.0.27/wasm-tools-1.0.27-x86_64-linux.tar.gz | tar xfz -
echo `pwd`/wasm-tools-1.0.27-x86_64-linux >> $GITHUB_PATH

- run: ./ci/build-wasi-preview1-component-adapter.sh
env:
VERSION: ${{ github.sha }}

- uses: actions/upload-artifact@v3
with:
name: bins-wasi-preview1-component-adapter
path: target/wasm32-unknown-unknown/release/wasi_preview1_component_adapter.*.wasm


# common logic to cancel the entire run if this job fails
- run: gh run cancel ${{ github.run_id }}
if: failure() && github.event_name != 'pull_request'
env:
GH_TOKEN: ${{ github.token }}


bench:
needs: determine
if: needs.determine.outputs.run-full
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- run: |
mkdir dist
mv -t dist bins-*/*.tar.*
mv -t dist bins-*/*.{zip,msi}
mv -t dist bins-*/*.{zip,msi,wasm}
- name: Publish Release
uses: ./.github/actions/github-release
with:
Expand Down
Loading