From e5d0b377c102a2f5a3e55352f6089047a7fb1d8f Mon Sep 17 00:00:00 2001 From: Syrus Date: Thu, 11 Apr 2019 15:00:02 -0700 Subject: [PATCH 1/4] Improved install script --- .circleci/config.yml | 22 ++++++++++++++++++++-- .gitignore | 1 + Makefile | 10 ++++++++++ binary-name.sh | 14 +++++++------- install.sh | 17 ++++++++--------- 5 files changed, 46 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 67309e903..15f493a09 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -142,6 +142,10 @@ jobs: - image: circleci/rust:latest steps: - checkout + # - run: + # name: "Pull dependencies" + # command: | + # git clone git@github.com:wasmerio/wapm-cli.git - restore_cache: keys: - v8-cargo-cache-linux-nightly-{{ arch }}-{{ checksum "Cargo.lock" }} @@ -170,12 +174,14 @@ jobs: command: | export LLVM_SYS_70_PREFIX="`pwd`/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04/" make release + # cargo build --release --manifest-path wapm-cli/Cargo.toml 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: | @@ -193,6 +199,9 @@ jobs: - target/release/.fingerprint - target/release/build - target/release/deps + # - 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: @@ -200,6 +209,10 @@ jobs: xcode: "9.0" steps: - checkout + # - run: + # name: "Pull dependencies" + # command: | + # git clone git@github.com:wasmerio/wapm-cli.git - restore_cache: keys: - v8-cargo-cache-darwin-nightly-{{ arch }}-{{ checksum "Cargo.lock" }} @@ -250,10 +263,12 @@ jobs: export PATH="$HOME/.cargo/bin:$PATH" export LLVM_SYS_70_PREFIX="`pwd`/clang+llvm-7.0.0-x86_64-apple-darwin/" make release + # cargo build --release --manifest-path wapm-cli/Cargo.toml 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: @@ -267,6 +282,9 @@ jobs: - target/release/.fingerprint - target/release/build - target/release/deps + # - 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: diff --git a/.gitignore b/.gitignore index 141efbf78..d1122a798 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ .DS_Store .idea **/.vscode +install/ diff --git a/Makefile b/Makefile index 2b87dd7e7..4349b256e 100644 --- a/Makefile +++ b/Makefile @@ -32,6 +32,16 @@ lint: precommit: lint test +build-install: + mkdir -p ./install/bin + # cp ./wapm-cli/target/release/wapm ./install/bin/ + cp ./target/release/wasmer ./install/bin/ + tar -C ./install -zcvf wasmer.tar.gz bin/wapm bin/wasmer + +# For installing the contents locally +do-install: + tar -C ~/.wasmer -zxvf wasmer.tar.gz + test: # We use one thread so the emscripten stdouts doesn't collide cargo test --all --exclude wasmer-runtime-c-api --exclude wasmer-emscripten --exclude wasmer-spectests --exclude wasmer-singlepass-backend -- $(runargs) diff --git a/binary-name.sh b/binary-name.sh index 98a3a8497..4ac8ef8e3 100755 --- a/binary-name.sh +++ b/binary-name.sh @@ -23,8 +23,8 @@ initOS() { darwin) OS='darwin';; linux) OS='linux';; freebsd) OS='freebsd';; - mingw*) OS='windows';; - msys*) OS='windows';; + # mingw*) OS='windows';; + # msys*) OS='windows';; *) echo "OS ${OS} is not supported by this installation script"; exit 1;; esac } @@ -34,11 +34,11 @@ initArch initOS # determine install directory if required -BINARY="wasmer-${OS}-${ARCH}" - +BINARY="wasmer-${OS}-${ARCH}.tar.gz" + # add .exe if on windows -if [ "$OS" = "windows" ]; then - BINARY="$BINARY.exe" -fi +# if [ "$OS" = "windows" ]; then +# BINARY="$BINARY.exe" +# fi echo "${BINARY}" diff --git a/install.sh b/install.sh index 0b7da4ca2..e9e43d445 100755 --- a/install.sh +++ b/install.sh @@ -32,6 +32,7 @@ white="\033[37m" bold="\e[1m" dim="\e[2m" +# Warning: Remove this on the public repo RELEASES_URL="https://github.com/wasmerio/wasmer/releases" wasmer_download_json() { @@ -369,12 +370,12 @@ wasmer_download() { WASMER=INSTALL_DIRECTORY # assemble expected release artifact name - BINARY="wasmer-${OS}-${ARCH}" + BINARY="wasmer-${OS}-${ARCH}.tar.gz" # add .exe if on windows - if [ "$OS" = "windows" ]; then - BINARY="$BINARY.exe" - fi + # if [ "$OS" = "windows" ]; then + # BINARY="$BINARY.exe" + # fi # if WASMER_RELEASE_TAG was not provided, assume latest if [ -z "$WASMER_RELEASE_TAG" ]; then @@ -417,9 +418,6 @@ wasmer_download() { printf "\033[K\n\033[1A" # printf "\033[1A$cyan> Downloaded$reset\033[K\n" # echo "Setting executable permissions." - chmod +x "$DOWNLOAD_FILE" - - INSTALL_NAME="wasmer" # windows not supported yet # if [ "$OS" = "windows" ]; then @@ -428,8 +426,9 @@ wasmer_download() { # echo "Moving executable to $INSTALL_DIRECTORY/$INSTALL_NAME" - mkdir -p $INSTALL_DIRECTORY/bin - mv "$DOWNLOAD_FILE" "$INSTALL_DIRECTORY/bin/$INSTALL_NAME" + mkdir -p $INSTALL_DIRECTORY + # Untar the wasmer contents in the install directory + tar -C $INSTALL_DIRECTORY -zxvf $DOWNLOAD_FILE } wasmer_verify_or_quit() { From 0cbb6de552eaed4f419112a863d4dedbab646063 Mon Sep 17 00:00:00 2001 From: Syrus Date: Thu, 11 Apr 2019 16:24:14 -0700 Subject: [PATCH 2/4] Improved Rustup installer in mac --- .circleci/config.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 37fd8e223..9fbaad147 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -222,7 +222,11 @@ jobs: export PATH="$HOME/.cargo/bin:$PATH" cargo --version # Use rust nightly (for singlepass, for now) - - run: rustup default nightly-2019-04-11 + - run: + name: Install Rust nightly + command: | + export PATH="$HOME/.rustup/bin:$PATH" + rustup default nightly-2019-04-11 - run: name: Tests command: | From 2d01ff0a6d689bacefd409bab4d5691cdbf2b601 Mon Sep 17 00:00:00 2001 From: Syrus Date: Thu, 11 Apr 2019 16:54:49 -0700 Subject: [PATCH 3/4] Install rust nightly by default in mac --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9fbaad147..b1d76a212 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -218,15 +218,15 @@ jobs: - run: name: Install Rust command: | - curl https://sh.rustup.rs -sSf | sh -s -- -y + curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly-2019-04-11 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: Install Rust nightly + # command: | + # export PATH="$HOME/.rustup/bin:$PATH" + # rustup default nightly-2019-04-11 - run: name: Tests command: | From 94fac3dd8bd1012a5307fd7627996d4316ea0a0a Mon Sep 17 00:00:00 2001 From: Syrus Date: Thu, 11 Apr 2019 17:19:39 -0700 Subject: [PATCH 4/4] =?UTF-8?q?Updated=20version=20to=200.3.0=20?= =?UTF-8?q?=F0=9F=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bcd7f4790..71c131da9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2222,7 +2222,7 @@ dependencies = [ [[package]] name = "wasmer" -version = "0.2.1" +version = "0.3.0" dependencies = [ "errno 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index de45b1ab7..2fbe15ccd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wasmer" -version = "0.2.1" +version = "0.3.0" authors = ["The Wasmer Engineering Team "] edition = "2018" repository = "https://github.com/wasmerio/wasmer"