Merge pull request #512 from sunfishcode/reorg

Reorganize the codebase
This commit is contained in:
Dan Gohman
2019-11-08 11:42:43 -08:00
committed by GitHub
377 changed files with 150 additions and 210 deletions

View File

@@ -46,8 +46,8 @@ jobs:
with:
submodules: true
- uses: ./.github/actions/install-rust
- run: cargo doc --no-deps -p wasmtime-cli
- run: cargo doc --no-deps -p wasmtime
- run: cargo doc --no-deps -p wasmtime-api
- run: cargo doc --no-deps -p wasmtime-debug
- run: cargo doc --no-deps -p wasmtime-environ
- run: cargo doc --no-deps -p wasmtime-interface-types
@@ -134,7 +134,7 @@ jobs:
with:
toolchain: nightly-2019-08-15
- uses: ./.github/actions/binary-compatible-builds
- run: mkdir misc/wasmtime-py/wheelhouse
- run: mkdir crates/misc/py/wheelhouse
shell: bash
# Install Python & dependencies needed for our `setup.py` scripts
@@ -145,13 +145,13 @@ jobs:
architecture: x64
- run: $CENTOS pip3 install setuptools wheel==0.31.1 setuptools-rust
shell: bash
- run: (cd misc/wasmtime-py && $CENTOS $python setup.py bdist_wheel)
- run: (cd crates/misc/py && $CENTOS $python setup.py bdist_wheel)
shell: bash
# Clear the build directory between building different wheels for different
# Python versions to ensure that we don't package dynamic libraries twice by
# accident.
- run: $CENTOS rm -rf misc/wasmtime-py/build
- run: $CENTOS rm -rf crates/misc/py/build
shell: bash
# Set up Python 3.7 (and build it on Linux), reinstall dependencies, then
@@ -167,18 +167,18 @@ jobs:
if: matrix.os == 'ubuntu-latest'
- run: $CENTOS pip3 install setuptools wheel==0.31.1 setuptools-rust auditwheel
shell: bash
- run: (cd misc/wasmtime-py && $CENTOS $python setup.py bdist_wheel)
- run: (cd crates/misc/py && $CENTOS $python setup.py bdist_wheel)
shell: bash
# Move `dist/*.whl` into `wheelhouse/` so we can deploy them, but on Linux we
# need to run an `auditwheel` command as well to turn these into "manylinux"
# wheels to run across a number of distributions.
- run: cp misc/wasmtime-py/dist/*.whl misc/wasmtime-py/wheelhouse/
- run: cp crates/misc/py/dist/*.whl crates/misc/py/wheelhouse/
shell: bash
if: matrix.os != 'ubuntu-latest'
- run: |
set -e
cd misc/wasmtime-py
cd crates/misc/py
for whl in dist/*.whl; do
$CENTOS auditwheel repair "$whl" -w wheelhouse/
done
@@ -189,7 +189,7 @@ jobs:
- uses: actions/upload-artifact@v1
with:
name: wheels-${{ matrix.os }}
path: misc/wasmtime-py/wheelhouse
path: crates/misc/py/wheelhouse
# Perform release builds of `wasmtime` and `libwasmtime_api.so`. Builds on
# Windows/Mac/Linux, and artifacts are uploaded after the build is finished.
@@ -216,10 +216,10 @@ jobs:
- run: $CENTOS cargo build --release --bin wasmtime --bin wasm2obj
shell: bash
# Build `libwasmtime_api.so`
- run: $CENTOS cargo build --release --manifest-path wasmtime-api/Cargo.toml
- run: $CENTOS cargo build --release --manifest-path crates/api/Cargo.toml
shell: bash
# Test what we just built
- run: $CENTOS cargo test --features wasi-common/wasm_tests --release --all --exclude lightbeam --exclude wasmtime-wasi-c --exclude wasmtime-py --exclude wasmtime-api
- run: $CENTOS cargo test --features wasi-common/wasm_tests --release --all --exclude lightbeam --exclude wasmtime-wasi-c --exclude wasmtime-py --exclude wasmtime
shell: bash
env:
RUST_BACKTRACE: 1

10
.gitmodules vendored
View File

@@ -1,9 +1,9 @@
[submodule "spec_testsuite"]
path = spec_testsuite
path = tests/spec_testsuite
url = https://github.com/WebAssembly/testsuite
[submodule "wasmtime-api/c-examples/wasm-c-api"]
path = wasmtime-api/c-examples/wasm-c-api
[submodule "crates/api/c-examples/wasm-c-api"]
path = crates/api/c-examples/wasm-c-api
url = https://github.com/WebAssembly/wasm-c-api
[submodule "wasi-common/WASI"]
path = wasi-common/WASI
[submodule "crates/wasi-common/WASI"]
path = crates/wasi-common/WASI
url = https://github.com/WebAssembly/WASI

View File

@@ -1,5 +1,5 @@
[package]
name = "wasmtime"
name = "wasmtime-cli"
authors = ["The Wasmtime Project Developers"]
version = "0.2.0"
description = "Command-line interface for Wasmtime"
@@ -15,17 +15,17 @@ cranelift-codegen = { version = "0.49", features = ["enable-serde"] }
cranelift-entity = { version = "0.49", features = ["enable-serde"] }
cranelift-wasm = { version = "0.49", features = ["enable-serde"] }
cranelift-native = { version = "0.49" }
wasmtime-api = { path = "wasmtime-api" }
wasmtime-debug = { path = "wasmtime-debug" }
wasmtime-environ = { path = "wasmtime-environ" }
wasmtime-interface-types = { path = "wasmtime-interface-types" }
wasmtime-runtime = { path = "wasmtime-runtime" }
wasmtime-jit = { path = "wasmtime-jit" }
wasmtime-obj = { path = "wasmtime-obj" }
wasmtime-wast = { path = "wasmtime-wast" }
wasmtime-wasi = { path = "wasmtime-wasi" }
wasmtime-wasi-c = { path = "wasmtime-wasi-c", optional = true }
wasi-common = { path = "wasi-common" }
wasmtime = { path = "crates/api" }
wasmtime-debug = { path = "crates/debug" }
wasmtime-environ = { path = "crates/environ" }
wasmtime-interface-types = { path = "crates/interface-types" }
wasmtime-runtime = { path = "crates/runtime" }
wasmtime-jit = { path = "crates/jit" }
wasmtime-obj = { path = "crates/obj" }
wasmtime-wast = { path = "crates/wast" }
wasmtime-wasi = { path = "crates/wasi" }
wasmtime-wasi-c = { path = "crates/wasi-c", optional = true }
wasi-common = { path = "crates/wasi-common" }
docopt = "1.0.1"
serde = { "version" = "1.0.94", features = ["derive"] }
faerie = "0.12.0"
@@ -43,11 +43,11 @@ anyhow = "1.0.19"
[workspace]
members = [
"misc/wasmtime-rust",
"misc/wasmtime-py",
"crates/misc/rust",
"crates/misc/py",
]
exclude = ["wasi-common/wasi-misc-tests"]
exclude = ["crates/wasi-common/wasi-misc-tests"]
[features]
# Enable all supported architectures by default.

View File

@@ -25,8 +25,8 @@ for a tutorial on compiling and running programs using WASI and wasmtime, as
well as an overview of the filesystem sandboxing system.
Wasmtime passes the [WebAssembly spec testsuite]. To run it, update the
`spec_testsuite` submodule with `git submodule update --remote`, and it will
be run as part of `cargo test`.
`tests/spec_testsuite` submodule with `git submodule update --remote`, and it
will be run as part of `cargo test`.
Wasmtime does not yet implement Spectre mitigations, however this is a subject
of ongoing research.
@@ -50,13 +50,13 @@ Additional goals for Wasmtime include:
#### Including Wasmtime in your project
Wasmtime exposes an API for embedding as a library through the `wasmtime-api` subcrate,
Wasmtime exposes an API for embedding as a library through the `wasmtime` subcrate,
which contains both a [high-level and safe Rust API], as well as a C-compatible API
compatible with the [proposed WebAssembly C API].
For more information, see the [Rust API embedding chapter] of the Wasmtime documentation.
[high-level and safe Rust API]: https://docs.rs/wasmtime-api/
[high-level and safe Rust API]: https://docs.rs/wasmtime/
[proposed WebAssembly C API]: https://github.com/WebAssembly/wasm-c-api
[Rust API embedding chapter]: https://cranestation.github.io/wasmtime/embed-rust.html

View File

@@ -25,33 +25,37 @@ fn main() -> anyhow::Result<()> {
writeln!(out, "#[allow(non_snake_case)]")?;
writeln!(out, "mod {} {{", strategy)?;
test_directory(&mut out, "misc_testsuite", strategy)?;
let spec_tests = test_directory(&mut out, "spec_testsuite", strategy)?;
test_directory(&mut out, "tests/misc_testsuite", strategy)?;
let spec_tests = test_directory(&mut out, "tests/spec_testsuite", strategy)?;
// Skip running spec_testsuite tests if the submodule isn't checked
// out.
if spec_tests > 0 {
start_test_module(&mut out, "simd")?;
write_testsuite_tests(
&mut out,
"spec_testsuite/proposals/simd/simd_address.wast",
"tests/spec_testsuite/proposals/simd/simd_address.wast",
"simd",
strategy,
)?;
write_testsuite_tests(
&mut out,
"spec_testsuite/proposals/simd/simd_align.wast",
"tests/spec_testsuite/proposals/simd/simd_align.wast",
"simd",
strategy,
)?;
write_testsuite_tests(
&mut out,
"spec_testsuite/proposals/simd/simd_const.wast",
"tests/spec_testsuite/proposals/simd/simd_const.wast",
"simd",
strategy,
)?;
finish_test_module(&mut out)?;
test_directory(&mut out, "spec_testsuite/proposals/multi-value", strategy)
test_directory(
&mut out,
"tests/spec_testsuite/proposals/multi-value",
strategy,
)
.expect("generating tests");
} else {
println!("cargo:warning=The spec testsuite is disabled. To enable, run `git submodule update --remote`.");

View File

@@ -32,7 +32,7 @@ mktarball() {
# Create the main tarball of binaries
bin_pkgname=wasmtime-$TAG-$platform
mkdir tmp/$bin_pkgname
cp LICENSE README.md CACHE_CONFIGURATION.md tmp/$bin_pkgname
cp LICENSE README.md docs/CACHE_CONFIGURATION.md tmp/$bin_pkgname
mv bins-$src/{wasmtime,wasm2obj}$exe tmp/$bin_pkgname
chmod +x tmp/$bin_pkgname/{wasmtime,wasm2obj}$exe
mktarball $bin_pkgname
@@ -48,7 +48,7 @@ mkdir tmp/$api_pkgname/lib
mkdir tmp/$api_pkgname/include
cp LICENSE README.md tmp/$api_pkgname
mv bins-$src/* tmp/$api_pkgname/lib
cp wasmtime-api/c-examples/wasm-c-api/include/wasm.h tmp/$api_pkgname/include
cp crates/api/c-examples/wasm-c-api/include/wasm.h tmp/$api_pkgname/include
mktarball $api_pkgname
# Move wheels to dist folder

View File

@@ -1,5 +1,5 @@
[package]
name = "wasmtime-api"
name = "wasmtime"
authors = ["The Wasmtime Project Developers"]
version = "0.1.0"
description = "High-level API to expose the Wasmtime runtime"
@@ -17,9 +17,9 @@ cranelift-native = { version = "0.49" }
cranelift-entity = { version = "0.49", features = ["enable-serde"] }
cranelift-wasm = { version = "0.49", features = ["enable-serde"] }
cranelift-frontend = { version = "0.49" }
wasmtime-runtime = { path="../wasmtime-runtime" }
wasmtime-environ = { path="../wasmtime-environ" }
wasmtime-jit = { path="../wasmtime-jit" }
wasmtime-runtime = { path="../runtime" }
wasmtime-environ = { path="../environ" }
wasmtime-jit = { path="../jit" }
wasmparser = { version = "0.39.2", default-features = false }
target-lexicon = { version = "0.9.0", default-features = false }
anyhow = "1.0.19"
@@ -38,7 +38,7 @@ wasi-common = { path = "../wasi-common" }
docopt = "1.0.1"
serde = { "version" = "1.0.94", features = ["derive"] }
pretty_env_logger = "0.3.0"
wasmtime-wast = { path="../wasmtime-wast" }
wasmtime-wasi = { path="../wasmtime-wasi" }
wasmtime-wast = { path="../wast" }
wasmtime-wasi = { path="../wasi" }
rayon = "1.1"
file-per-thread-logger = "0.1.1"

View File

@@ -18,7 +18,7 @@ cranelift-codegen = { version = "0.49", features = ["enable-serde"] }
cranelift-entity = { version = "0.49", features = ["enable-serde"] }
cranelift-wasm = { version = "0.49", features = ["enable-serde"] }
faerie = "0.12.0"
wasmtime-environ = { path = "../wasmtime-environ", default-features = false }
wasmtime-environ = { path = "../environ", default-features = false }
target-lexicon = { version = "0.9.0", default-features = false }
failure = { version = "0.1.3", default-features = false }
hashbrown = { version = "0.6.0", optional = true }

View File

@@ -17,18 +17,18 @@ cranelift-entity = { version = "0.49", features = ["enable-serde"] }
cranelift-wasm = { version = "0.49", features = ["enable-serde"] }
lightbeam = { path = "../lightbeam", optional = true }
indexmap = "1.0.2"
rayon = "1.1"
rayon = "1.2"
thiserror = "1.0.4"
directories = "2.0.1"
sha2 = "0.8.0"
base64 = "0.10.1"
base64 = "0.11.0"
serde = { version = "1.0.94", features = ["derive"] }
bincode = "1.1.4"
lazy_static = "1.3.0"
spin = "0.5.0"
log = { version = "0.4.8", default-features = false }
zstd = "0.4"
toml = "0.5"
zstd = "0.5"
toml = "0.5.5"
file-per-thread-logger = "0.1.1"
[target.'cfg(target_os = "windows")'.dependencies]

View File

@@ -171,7 +171,7 @@ pub fn create_new_config<P: AsRef<Path> + Debug>(
let content = "\
# Comment out certain settings to use default values.
# For more settings, please refer to the documentation:
# https://github.com/CraneStation/wasmtime/blob/master/CACHE_CONFIGURATION.md
# https://github.com/CraneStation/wasmtime/blob/master/docs/CACHE_CONFIGURATION.md
[cache]
enabled = true

View File

@@ -16,5 +16,5 @@ cranelift-codegen = { version = "0.49", default-features = false }
walrus = "0.13"
wasmparser = { version = "0.39.2", default-features = false }
wasm-webidl-bindings = "0.6"
wasmtime-jit = { path = '../wasmtime-jit', default-features = false }
wasmtime-runtime = { path = '../wasmtime-runtime', default-features = false }
wasmtime-jit = { path = '../jit', default-features = false }
wasmtime-runtime = { path = '../runtime', default-features = false }

View File

@@ -15,9 +15,9 @@ cranelift-codegen = { version = "0.49", features = ["enable-serde"] }
cranelift-entity = { version = "0.49", features = ["enable-serde"] }
cranelift-wasm = { version = "0.49", features = ["enable-serde"] }
cranelift-frontend = { version = "0.49" }
wasmtime-environ = { path = "../wasmtime-environ", default-features = false }
wasmtime-runtime = { path = "../wasmtime-runtime", default-features = false }
wasmtime-debug = { path = "../wasmtime-debug", default-features = false }
wasmtime-environ = { path = "../environ", default-features = false }
wasmtime-runtime = { path = "../runtime", default-features = false }
wasmtime-debug = { path = "../debug", default-features = false }
region = "2.0.0"
failure = { version = "0.1.3", default-features = false }
thiserror = "1.0.4"

Some files were not shown because too many files have changed in this diff Show More