Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

Commit

Permalink
Last bits to make Lucet publishable on crates.io (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
jedisct1 committed Jun 28, 2019
1 parent 5428edf commit 3693c0f
Show file tree
Hide file tree
Showing 19 changed files with 1,229 additions and 152 deletions.
181 changes: 90 additions & 91 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Lucet version 0.1.0
# Lucet version 0.1.1

[workspace]
members = [
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/lucet-benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "lucet-benchmarks"
version = "0.1.0"
version = "0.1.1"
description = "Benchmarks for the Lucet runtime"
homepage = "https://github.com/fastly/lucet"
repository = "https://github.com/fastly/lucet"
license = "Apache-2.0 WITH LLVM-exception"
categories = ["wasm"]
authors = ["Adam C. Foltzer <acfoltzer@fastly.com>"]
authors = ["Lucet team <lucet@fastly.com>"]
edition = "2018"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion cranelift
2 changes: 1 addition & 1 deletion helpers/bump-global-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ VERSION=$(grep '#*Lucet version ' Cargo.toml | sed 's/^ *# Lucet version *//')
dry_run() {
echo "Checking if the package can be published (dry run)..."
echo
find lucetc lucet-* benchmarks/lucet-* -type f -maxdepth 1 -name 'Cargo.toml' -print | while read -r file; do
find lucetc lucet-* benchmarks/lucet-* lucet-runtime/lucet-* lucet-idl/lucet-* -type f -maxdepth 1 -name 'Cargo.toml' -print | while read -r file; do
dir="$(dirname $file)"
echo "* Checking [$dir]"
(cd "$dir" && cargo publish --allow-dirty --dry-run >/dev/null) || exit 1
Expand Down
6 changes: 3 additions & 3 deletions lucet-analyze/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[package]
name = "lucet-analyze"
version = "0.1.0"
version = "0.1.1"
description = "Analyze object files emitted by the Lucet compiler"
homepage = "https://github.com/fastly/lucet"
repository = "https://github.com/fastly/lucet"
license = "Apache-2.0 WITH LLVM-exception"
categories = ["wasm"]
authors = ["tyler <tyler@fastly.com>"]
authors = ["Lucet team <lucet@fastly.com>"]
edition = "2018"

[dependencies]
goblin="0.0.21"
byteorder="1.2.1"
colored="1.6.1"
lucet-module-data = { path = "../lucet-module-data" }
lucet-module-data = { path = "../lucet-module-data", version = "0.1.1" }
4 changes: 2 additions & 2 deletions lucet-idl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "lucet-idl"
version = "0.1.0"
version = "0.1.1"
description = "Describe interfaces between WebAssembly guest programs and lucet-runtime hosts"
homepage = "https://github.com/fastly/lucet"
repository = "https://github.com/fastly/lucet"
license = "Apache-2.0 WITH LLVM-exception"
categories = ["wasm"]
authors = ["Pat Hickey <phickey@fastly.com>", "Frank Denis <fdenis@fastly.com>"]
authors = ["Lucet team <lucet@fastly.com>"]
edition = "2018"

[lib]
Expand Down
6 changes: 3 additions & 3 deletions lucet-module-data/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[package]
name = "lucet-module-data"
version = "0.1.0"
version = "0.1.1"
description = "A structured interface for Lucet module data and metadata"
homepage = "https://github.com/fastly/lucet"
repository = "https://github.com/fastly/lucet"
license = "Apache-2.0 WITH LLVM-exception"
categories = ["wasm"]
authors = ["Pat Hickey <phickey@fastly.com>"]
authors = ["Lucet team <lucet@fastly.com>"]
edition = "2018"

[dependencies]
cranelift-codegen = { path = "../cranelift/cranelift-codegen" }
cranelift-codegen = { path = "../cranelift/cranelift-codegen", version = "0.31.0" }
failure = "0.1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand Down
10 changes: 5 additions & 5 deletions lucet-runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
[package]
name = "lucet-runtime"
version = "0.1.0"
version = "0.1.1"
description = "Pure Rust runtime for Lucet WebAssembly toolchain"
homepage = "https://github.com/fastly/lucet"
repository = "https://github.com/fastly/lucet"
license = "Apache-2.0 WITH LLVM-exception"
categories = ["wasm"]
authors = ["Adam C. Foltzer <acfoltzer@fastly.com>", "Pat Hickey <phickey@fastly.com>", "Frank Denis <fdenis@fastly.com>", "Tyler McMullen <tyler@fastly.com>"]
authors = ["Lucet team <lucet@fastly.com>"]
edition = "2018"

[dependencies]
libc = "0.2.48"
lucet-runtime-internals = { path = "lucet-runtime-internals" }
lucet-module-data = { path = "../lucet-module-data" }
lucet-runtime-internals = { path = "lucet-runtime-internals", version = "0.1.1" }
lucet-module-data = { path = "../lucet-module-data", version = "0.1.1" }
num-traits = "0.2"
num-derive = "0.2"

[dev-dependencies]
byteorder = "1.2"
failure = "0.1"
lazy_static = "1.1"
lucet-runtime-tests = { path = "lucet-runtime-tests" }
lucet-runtime-tests = { path = "lucet-runtime-tests", version = "0.1.1" }
nix = "0.13"

[lib]
Expand Down
13 changes: 9 additions & 4 deletions lucet-runtime/lucet-runtime-internals/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
[package]
name = "lucet-runtime-internals"
version = "0.1.0"
authors = ["Adam C. Foltzer <acfoltzer@fastly.com>"]
version = "0.1.1"
description = "Pure Rust runtime for Lucet WebAssembly toolchain (internals)"
homepage = "https://github.com/fastly/lucet"
repository = "https://github.com/fastly/lucet"
license = "Apache-2.0 WITH LLVM-exception"
categories = ["wasm"]
authors = ["Lucet team <lucet@fastly.com>"]
edition = "2018"

[dependencies]
lucet-module-data = { path = "../../lucet-module-data" }
lucet-module-data = { path = "../../lucet-module-data", version = "0.1.1" }

bitflags = "1.0"
bincode = "~1.0.1"
byteorder = "1.3"
cranelift-codegen = { path = "../../cranelift/cranelift-codegen" }
cranelift-codegen = { path = "../../cranelift/cranelift-codegen", version = "0.31.0" }
failure = "0.1"
lazy_static = "1.1"
libc = "0.2.47"
Expand Down
17 changes: 11 additions & 6 deletions lucet-runtime/lucet-runtime-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
[package]
name = "lucet-runtime-tests"
version = "0.1.0"
authors = ["Adam C. Foltzer <acfoltzer@fastly.com>"]
version = "0.1.1"
description = "Pure Rust runtime for Lucet WebAssembly toolchain (tests)"
homepage = "https://github.com/fastly/lucet"
repository = "https://github.com/fastly/lucet"
license = "Apache-2.0 WITH LLVM-exception"
categories = ["wasm"]
authors = ["Lucet team <lucet@fastly.com>"]
edition = "2018"

[lib]
Expand All @@ -13,10 +18,10 @@ test = false
failure = "0.1"
lazy_static = "1.1"
tempfile = "3.0"
lucet-module-data = { path = "../../lucet-module-data" }
lucet-runtime-internals = { path = "../lucet-runtime-internals" }
lucet-wasi-sdk = { path = "../../lucet-wasi-sdk" }
lucetc = { path = "../../lucetc" }
lucet-module-data = { path = "../../lucet-module-data", version = "0.1.1" }
lucet-runtime-internals = { path = "../lucet-runtime-internals", version = "0.1.1" }
lucet-wasi-sdk = { path = "../../lucet-wasi-sdk", version = "0.1.1" }
lucetc = { path = "../../lucetc", version = "0.1.1" }

[build-dependencies]
cc = "1.0"
10 changes: 5 additions & 5 deletions lucet-spectest/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "lucet-spectest"
version = "0.1.0"
version = "0.1.1"
description = "Test harness to run WebAssembly spec tests (.wast) against the Lucet toolchain"
homepage = "https://github.com/fastly/lucet"
repository = "https://github.com/fastly/lucet"
license = "Apache-2.0 WITH LLVM-exception"
authors = ["Pat Hickey <phickey@fastly.com>"]
authors = ["Lucet team <lucet@fastly.com>"]
categories = ["wasm"]
edition = "2018"

Expand All @@ -17,9 +17,9 @@ name = "spec-test"
path = "src/main.rs"

[dependencies]
lucetc = { path = "../lucetc" }
lucet-module-data = { path = "../lucet-module-data" }
lucet-runtime = { path = "../lucet-runtime" }
lucetc = { path = "../lucetc", version = "0.1.1" }
lucet-module-data = { path = "../lucet-module-data", version = "0.1.1" }
lucet-runtime = { path = "../lucet-runtime", version = "0.1.1" }
wabt = "0.7"
serde = "1.0"
serde_json = "1.0"
Expand Down
4 changes: 2 additions & 2 deletions lucet-wasi-fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "lucet-wasi-fuzz"
version = "0.1.0"
version = "0.1.1"
description = "Test the Lucet toolchain against native code execution using Csmith"
homepage = "https://github.com/fastly/lucet"
repository = "https://github.com/fastly/lucet"
license = "Apache-2.0 WITH LLVM-exception"
categories = ["wasm"]
authors = ["Adam C. Foltzer <acfoltzer@fastly.com>"]
authors = ["Lucet team <lucet@fastly.com>"]
edition = "2018"

[dependencies]
Expand Down
8 changes: 4 additions & 4 deletions lucet-wasi-sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[package]
name = "lucet-wasi-sdk"
version = "0.1.0"
version = "0.1.1"
description = "A Rust interface to the wasi-sdk compiler and linker"
homepage = "https://github.com/fastly/lucet"
repository = "https://github.com/fastly/lucet"
license = "Apache-2.0 WITH LLVM-exception"
categories = ["wasm"]
authors = ["Pat Hickey <phickey@fastly.com>"]
authors = ["Lucet team <lucet@fastly.com>"]
edition = "2018"

[dependencies]
failure = "0.1"
lucetc = { path = "../lucetc" }
lucet-module-data = { path = "../lucet-module-data" }
lucetc = { path = "../lucetc", version = "0.1.1" }
lucet-module-data = { path = "../lucet-module-data", version = "0.1.1" }
tempfile = "3.0"
33 changes: 24 additions & 9 deletions lucet-wasi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,33 +1,48 @@
[package]
name = "lucet-wasi"
version = "0.1.0"
version = "0.1.1"
description = "Fastly's runtime for the WebAssembly System Interface (WASI)"
homepage = "https://github.com/fastly/lucet"
repository = "https://github.com/fastly/lucet"
license = "Apache-2.0 WITH LLVM-exception"
categories = ["wasm"]
authors = ["Adam C. Foltzer <acfoltzer@fastly.com>"]
authors = ["Lucet team <lucet@fastly.com>"]
edition = "2018"

# `src/wasi_host.rs` is automatically generated using clang and
# wasi-libc headers. This requires these to be present, and installed
# at specific paths, which is not something we can rely on outside
# of our environment.
# So, we follow what most other tools using `bindgen` do, and provide
# a pre-generated version of the file, along with a way to update it.
# This is what the `update-bindings` feature do. It requires the WASI SDK
# to be either installed in `/opt/wasi-sdk`, or at a location defined by
# a `WASI_SDK` environment variable, as well as `clang` headers either
# being part of `WASI_SDK`, or found in a path defined by a
# `CLANG_ROOT` environment variable.
[features]
update-bindings = ["bindgen"]

[dependencies]
cast = "0.2"
clap = "2.23"
failure = "0.1"
human-size = "0.4"
libc = "0.2"
lucet-runtime = { path = "../lucet-runtime" }
lucet-runtime-internals = { path = "../lucet-runtime/lucet-runtime-internals" }
lucet-module-data = { path = "../lucet-module-data" }
lucet-runtime = { path = "../lucet-runtime", version = "0.1.1" }
lucet-runtime-internals = { path = "../lucet-runtime/lucet-runtime-internals", version = "0.1.1" }
lucet-module-data = { path = "../lucet-module-data", version = "0.1.1" }
nix = "0.13"
rand = "0.6"

[dev-dependencies]
lucet-wasi-sdk = { path = "../lucet-wasi-sdk" }
lucetc = { path = "../lucetc" }
lucet-wasi-sdk = { path = "../lucet-wasi-sdk", version = "0.1.1" }
lucetc = { path = "../lucetc", version = "0.1.1" }
tempfile = "3.0"

[build-dependencies]
bindgen = "0.47"
[build-dependencies.bindgen]
version = "0.47"
optional = true

[lib]
name = "lucet_wasi"
Expand Down
20 changes: 19 additions & 1 deletion lucet-wasi/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(unused)]

use std::env;
use std::fs::File;
use std::path::{Path, PathBuf};
Expand Down Expand Up @@ -32,6 +34,21 @@ fn wasm_clang_root() -> PathBuf {
}
}

// `src/wasi_host.rs` is automatically generated using clang and
// wasi-libc headers. This requires these to be present, and installed
// at specific paths, which is not something we can rely on outside
// of our environment.
// So, we follow what most other tools using `bindgen` do, and provide
// a pre-generated version of the file, along with a way to update it.
// This is what the `update-bindings` feature do. It requires the WASI SDK
// to be either installed in `/opt/wasi-sdk`, or at a location defined by
// a `WASI_SDK` environment variable, as well as `clang` headers either
// being part of `WASI_SDK`, or found in a path defined by a
// `CLANG_ROOT` environment variable.
#[cfg(not(feature = "update-bindings"))]
fn main() {}

#[cfg(feature = "update-bindings")]
fn main() {
let wasi_sysroot = wasi_sysroot();
let wasm_clang_root = wasm_clang_root();
Expand Down Expand Up @@ -88,9 +105,10 @@ fn main() {
.whitelist_type("__wasi_.*")
.whitelist_var("__WASI_.*");

let src_path = Path::new("src");
host_builder
.generate()
.expect("can generate host bindings")
.write_to_file(out_path.join("wasi_host.rs"))
.write_to_file(src_path.join("wasi_host.rs"))
.expect("can write host bindings");
}
2 changes: 1 addition & 1 deletion lucet-wasi/src/host.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]

include!(concat!(env!("OUT_DIR"), "/wasi_host.rs"));
include!("wasi_host.rs");

pub type void = ::std::os::raw::c_void;

Expand Down
Loading

0 comments on commit 3693c0f

Please sign in to comment.