Skip to content

Commit

Permalink
Merge branch 'master' into docs/better-runtime-docs
Browse files Browse the repository at this point in the history
# Conflicts:
#	lib/runtime-core/src/vm.rs
  • Loading branch information
syrusakbary committed May 13, 2019
2 parents 3eaf552 + 9aac20e commit 5a6cb96
Show file tree
Hide file tree
Showing 268 changed files with 19,756 additions and 4,935 deletions.
169 changes: 123 additions & 46 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,74 +1,85 @@
run_with_build_env_vars: &run_with_build_env_vars
environment:
LLVM_SYS_70_PREFIX: /home/circleci/project/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04/

run_install_dependencies: &run_install_dependencies
run:
name: install dependencies
command: |
sudo apt-get install -y cmake
curl -O https://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
tar xf clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
version: 2
jobs:
changelog:
docker:
- image: docker:stable-git
steps:
- checkout
- run:
command: ! git diff --exit-code CHANGELOG.md

# Job used for testing
lint:
docker:
- image: circleci/rust:latest
<<: *run_with_build_env_vars
steps:
- checkout
- restore_cache:
keys:
- v6-lint-{{ arch }}-{{ checksum "Cargo.lock" }}
- run:
name: Install dependencies
command: |
sudo apt-get install -y cmake
curl -O https://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
tar xf clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
- v8-lint-{{ arch }}-{{ checksum "Cargo.lock" }}
- v8-lint-{{ arch }}
- <<: *run_install_dependencies
- run:
name: Install lint deps
command: |
git config --global --unset url."ssh://git@github.com".insteadOf || true
rustup toolchain install nightly-2019-02-27
rustup component add rustfmt
rustup component add clippy
rustup component add clippy --toolchain=nightly-2019-02-27 || cargo +nightly-2019-02-27 install --git https://github.com/rust-lang/rust-clippy/ --force clippy
- run:
name: Execute lints
command: |
export LLVM_SYS_70_PREFIX="`pwd`/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04/"
make lint
- save_cache:
paths:
- /usr/local/cargo/registry
- target/debug/.fingerprint
- target/debug/build
- target/debug/deps
key: v6-lint-{{ arch }}-{{ checksum "Cargo.lock" }}
key: v8-lint-{{ arch }}-{{ checksum "Cargo.lock" }}

test:
docker:
- image: circleci/rust:latest
<<: *run_with_build_env_vars
steps:
- checkout
- restore_cache:
keys:
- v6-test-cargo-cache-linux-{{ arch }}-{{ checksum "Cargo.lock" }}
- run:
name: Install dependencies
command: |
sudo apt-get install -y cmake
curl -O https://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
tar xf clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
- v8-test-cargo-cache-linux-stable-{{ arch }}-{{ checksum "Cargo.lock" }}
- v8-test-cargo-cache-linux-stable-{{ arch }}
- <<: *run_install_dependencies
- run:
name: Tests
command: |
export LLVM_SYS_70_PREFIX="`pwd`/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04/"
make test
command: make test
- run:
name: Emscripten Tests
command: |
export LLVM_SYS_70_PREFIX="`pwd`/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04/"
make test-emscripten
make test-emscripten-clif
make test-emscripten-llvm
- run:
name: Integration Tests
command: |
export LLVM_SYS_70_PREFIX="`pwd`/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04/"
make integration-tests
command: make integration-tests
- save_cache:
paths:
- /usr/local/cargo/registry
- target/debug/.fingerprint
- target/debug/build
- target/debug/deps
key: v6-test-cargo-cache-linux-{{ arch }}-{{ checksum "Cargo.lock" }}
key: v8-test-cargo-cache-linux-stable-{{ arch }}-{{ checksum "Cargo.lock" }}

test-macos:
macos:
Expand All @@ -77,7 +88,8 @@ jobs:
- checkout
- restore_cache:
keys:
- v6-cargo-cache-darwin-{{ arch }}-{{ checksum "Cargo.lock" }}
- v8-cargo-cache-darwin-stable-{{ arch }}-{{ checksum "Cargo.lock" }}
- v8-cargo-cache-darwin-stable-{{ arch }}
- run:
name: Install crate dependencies
command: |
Expand All @@ -91,7 +103,7 @@ jobs:
- run:
name: Install Rust
command: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
curl -sSf https://sh.rustup.rs | sh -s -- -y
export PATH="$HOME/.cargo/bin:$PATH"
cargo --version
- run:
Expand All @@ -113,7 +125,8 @@ jobs:
# We increase the ulimit for fixing cargo unclosed files in mac
ulimit -n 8000
sudo sysctl -w kern.maxfiles=655360 kern.maxfilesperproc=327680
make test-emscripten
make test-emscripten-clif
make test-emscripten-llvm
- run:
name: Integration Tests
command: |
Expand All @@ -130,22 +143,30 @@ jobs:
- target/release/.fingerprint
- target/release/build
- target/release/deps
key: v6-cargo-cache-darwin-{{ arch }}-{{ checksum "Cargo.lock" }}
key: v8-cargo-cache-darwin-stable-{{ arch }}-{{ checksum "Cargo.lock" }}

test-and-build:
docker:
- image: circleci/rust:latest
steps:
- checkout
- run:
name: "Pull dependencies"
command: |
git submodule init
git submodule update --remote
- restore_cache:
keys:
- v6-cargo-cache-linux-{{ arch }}-{{ checksum "Cargo.lock" }}
- run:
- v8-cargo-cache-linux-nightly-{{ arch }}-{{ checksum "Cargo.lock" }}
- v8-cargo-cache-linux-nightly-{{ arch }}
- run:
name: Install dependencies
command: |
sudo apt-get install -y cmake
curl -O https://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
tar xf clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
# Use rust nightly (for singlepass, for now)
- run: rustup default nightly-2019-04-11
- run:
name: Tests
command: |
Expand All @@ -155,18 +176,25 @@ jobs:
name: Emscripten Tests
command: |
export LLVM_SYS_70_PREFIX="`pwd`/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04/"
make test-emscripten
make test-emscripten-clif
make test-emscripten-llvm
- run:
name: Release Build
command: |
export LLVM_SYS_70_PREFIX="`pwd`/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04/"
make release
make production-release
cargo build --release --manifest-path wapm-cli/Cargo.toml --features telemetry
mkdir -p artifacts
VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
# GIT_VERSION=$(git describe --exact-match --tags)
echo "${VERSION}" >> artifacts/version
echo "${CIRCLE_TAG}" >> artifacts/git_version
cp ./target/release/wasmer ./artifacts/$(./binary-name.sh)
make build-install
cp ./wasmer.tar.gz ./artifacts/$(./binary-name.sh)
- run:
name: Debug flag checked
command: |
cargo check --features "debug"
- persist_to_workspace:
root: .
paths:
Expand All @@ -180,16 +208,25 @@ jobs:
- target/release/.fingerprint
- target/release/build
- target/release/deps
key: v6-cargo-cache-linux-{{ arch }}-{{ checksum "Cargo.lock" }}
- wapm-cli/target/release/.fingerprint
- wapm-cli/target/release/build
- wapm-cli/target/release/deps
key: v8-cargo-cache-linux-nightly-{{ arch }}-{{ checksum "Cargo.lock" }}

test-and-build-macos:
macos:
xcode: "9.0"
steps:
- checkout
- run:
name: "Pull dependencies"
command: |
git submodule init
git submodule update --remote
- restore_cache:
keys:
- v6-cargo-cache-darwin-{{ arch }}-{{ checksum "Cargo.lock" }}
- v8-cargo-cache-darwin-nightly-{{ arch }}-{{ checksum "Cargo.lock" }}
- v8-cargo-cache-darwin-nightly-{{ arch }}
- run:
name: Install crate dependencies
command: |
Expand All @@ -203,9 +240,15 @@ jobs:
- run:
name: Install Rust
command: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly
export PATH="$HOME/.cargo/bin:$PATH"
cargo --version
# Use rust nightly (for singlepass, for now)
# - run:
# name: Install Rust nightly
# command: |
# export PATH="$HOME/.rustup/bin:$PATH"
# rustup default nightly-2019-04-11
- run:
name: Tests
command: |
Expand All @@ -225,18 +268,21 @@ jobs:
# We increase the ulimit for fixing cargo unclosed files in mac
ulimit -n 8000
sudo sysctl -w kern.maxfiles=655360 kern.maxfilesperproc=327680
make test-emscripten
make test-emscripten-clif
make test-emscripten-singlepass
- run:
name: Release Build
command: |
export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH"
export LLVM_SYS_70_PREFIX="`pwd`/clang+llvm-7.0.0-x86_64-apple-darwin/"
make release
make production-release
cargo build --release --manifest-path wapm-cli/Cargo.toml --features telemetry
mkdir -p artifacts
make build-install
cp ./wasmer.tar.gz ./artifacts/$(./binary-name.sh)
# VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
# echo "${VERSION}" >> artifacts/version
cp ./target/release/wasmer ./artifacts/$(./binary-name.sh)
- persist_to_workspace:
root: .
paths:
Expand All @@ -250,7 +296,10 @@ jobs:
- target/release/.fingerprint
- target/release/build
- target/release/deps
key: v6-cargo-cache-darwin-{{ arch }}-{{ checksum "Cargo.lock" }}
- wapm-cli/target/release/.fingerprint
- wapm-cli/target/release/build
- wapm-cli/target/release/deps
key: v8-cargo-cache-darwin-nightly-{ arch }}-{{ checksum "Cargo.lock" }}

test-rust-nightly:
docker:
Expand All @@ -259,24 +308,28 @@ jobs:
- checkout
- restore_cache:
keys:
- v6-test-cargo-cache-linux-{{ arch }}-{{ checksum "Cargo.lock" }}-nightly
- run:
- v8-cargo-cache-linux-nightly-{{ arch }}-{{ checksum "Cargo.lock" }}
- v8-cargo-cache-linux-nightly-{{ arch }}
- run:
name: Install dependencies
command: |
sudo apt-get install -y cmake
curl -O https://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
tar xf clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
- run: rustup default nightly
- run: rustup default nightly-2019-04-11
- run: |
export LLVM_SYS_70_PREFIX="`pwd`/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04/"
make test
make test-singlepass
make test-emscripten-clif
make test-emscripten-singlepass
- save_cache:
paths:
- /usr/local/cargo/registry
- target/debug/.fingerprint
- target/debug/build
- target/debug/deps
key: v6-test-cargo-cache-linux-{{ arch }}-{{ checksum "Cargo.lock" }}-nightly
key: v8-cargo-cache-linux-nightly-{{ arch }}-{{ checksum "Cargo.lock" }}-nightly

publish-github-release:
docker:
Expand All @@ -303,11 +356,28 @@ jobs:
# echo "Versions don't match. Wasmer output version (wasmer --version) is ${VERSION} while Git tag is ${VERSION_TAG}"
# exit 1
#fi
trigger-benchmark-build:
docker:
- image: circleci/rust:latest
steps:
- run:
name: "Trigger Benchmark Build"
command: |
if [[ -z "${CIRCLE_API_USER_TOKEN}" ]]; then
echo "CIRCLE_API_USER_TOKEN environment variable not set"
exit 1
else
echo "Triggering benchmark build"
curl -u ${CIRCLE_API_USER_TOKEN} \
-d build_parameters[CIRCLE_JOB]=bench \
https://circleci.com/api/v1.1/project/github/wasmerio/wasmer-bench/tree/master
fi
workflows:
version: 2
main:
jobs:
- changelog
- lint
- test:
filters:
Expand Down Expand Up @@ -345,3 +415,10 @@ workflows:
filters:
branches:
only: master
- trigger-benchmark-build:
requires:
- test-and-build
- lint
filters:
branches:
only: master
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Ignore everything
**
!lib/**
!src/**
!Cargo.toml
!Cargo.lock
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
.DS_Store
.idea
**/.vscode
install/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "wapm-cli"]
path = wapm-cli
url = https://github.com/wasmerio/wapm-cli.git

0 comments on commit 5a6cb96

Please sign in to comment.