Skip to content
This repository was archived by the owner on Nov 9, 2019. It is now read-only.

Clean up docs; specify minimum Rust version #11

Merged
merged 1 commit into from
May 13, 2019
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ os:
- osx
language: rust
rust:
- stable
- 1.34.0
- beta
- nightly
matrix:
Expand Down
220 changes: 0 additions & 220 deletions LICENSE.wasmtime

This file was deleted.

42 changes: 27 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
# wasi-common
[![build-status]][travis] [![rustc-1.34]][rustc]

This repo strips away those bits of [lucet-wasi](https://github.com/fastly/lucet/tree/5d3efb6005391a7c71d585732a5507b00db6bb1e/lucet-wasi)
which can potentially be encapsulated in a separated crate with potential plug'n'play use in both
[Lucet](https://github.com/fastly/lucet)
and [Wasmtime](https://github.com/CraneStation/wasmtime) projects.
[build-status]: https://travis-ci.org/CraneStation/wasi-common.svg?branch=master
[travis]: https://travis-ci.org/CraneStation/wasi-common
[rustc-1.34]: https://img.shields.io/badge/rustc-1.34+-lightgray.svg
[rustc]: https://blog.rust-lang.org/2019/04/11/Rust-1.34.0.html
[Wasmtime]: https://github.com/CraneStation/wasmtime
[Lucet]: https://github.com/fastly/lucet
[lucet-wasi]: https://github.com/fastly/lucet/tree/master/lucet-wasi
[lucet-wasi-tracker]: https://github.com/fastly/lucet/commit/5d3efb6005391a7c71d585732a5507b00db6bb1e
[WASI API]: https://github.com/CraneStation/wasmtime/blob/master/docs/WASI-api.md

This repo is strictly experimental, and based on [5d3efb6005](https://github.com/fastly/lucet/commit/5d3efb6005391a7c71d585732a5507b00db6bb1e) git revision.
This repo will ultimately serve as a library providing a common implementation of
WASI hostcalls for re-use in any WASI (and potentially non-WASI) runtimes
such as [Wasmtime] and [Lucet].

The library is an adaption of [lucet-wasi] crate from the [Lucet] project, and it is
currently based on [5d3efb6005][lucet-wasi-tracker] git revision.

Please note that the library requires Rust compiler version at least 1.34.0.

## Supported syscalls

We support a subset of the [WASI
API](https://github.com/CraneStation/wasmtime/blob/master/docs/WASI-api.md), though we are adding
new syscalls on a regular basis. We currently implement:
We support a subset of the [WASI API], though we are working on new hostcalls
on a regular basis. We currently implement:

- `__wasi_args_get`
- `__wasi_args_sizes_get`
Expand All @@ -22,23 +34,23 @@ new syscalls on a regular basis. We currently implement:
- `__wasi_fd_close`
- `__wasi_fd_fdstat_get`
- `__wasi_fd_fdstat_set_flags`
- `__wasi_fd_filestat_get`
- `__wasi_fd_prestat_dir_name`
- `__wasi_fd_prestat_get`
- `__wasi_fd_read`
- `__wasi_fd_seek`
- `__wasi_fd_write`
- `__wasi_path_open`
- `__wasi_path_filestat_get`
- `__wasi_path_create_directory`
- `__wasi_path_unlink_file`
- `__wasi_poll_oneoff`
- `__wasi_proc_exit`
- `__wasi_random_get`

This is enough to run basic C and Rust programs, including those that use command-line arguments,
environment variables, stdio, and basic file operations.

## Third-Party Code

`src/wasm32.rs` is copied from
[wasmtime](https://github.com/CraneStation/wasmtime/blob/master/wasmtime-wasi/src/wasm32.rs), along
with the associated `LICENSE.wasmtime` file.

Significant parts of our syscall implementations are derived from the C implementations in
`cloudabi-utils`. See `LICENSE.cloudabi-utils` for license information.
Significant parts of our hostcall implementations are derived from the C implementations in
`cloudabi-utils`. See [LICENSE.cloudabi-utils](LICENSE.cloudabi-utils) for license information.