diff options
author | Ben Smith <binji@chromium.org> | 2016-05-05 17:20:03 -0700 |
---|---|---|
committer | Ben Smith <binji@chromium.org> | 2016-05-05 17:37:31 -0700 |
commit | f9f344cc486795a058f474a6e7eca669cf01864c (patch) | |
tree | 04d7eb040c277001df9813bf6f6771e313c83c90 /scripts | |
parent | 8447d7bda7cd80f0a5d44bfb8a6824dff3af9e47 (diff) | |
download | wabt-f9f344cc486795a058f474a6e7eca669cf01864c.tar.gz wabt-f9f344cc486795a058f474a6e7eca669cf01864c.tar.bz2 wabt-f9f344cc486795a058f474a6e7eca669cf01864c.zip |
{download,upload}-d8.sh scripts support MacOSX
Also, remove uses of readlink -f because they don't work on OSX.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build-d8.sh | 2 | ||||
-rw-r--r-- | scripts/d8-common.sh | 32 | ||||
-rwxr-xr-x | scripts/download-d8.sh | 10 | ||||
-rwxr-xr-x | scripts/travis-build.sh | 4 | ||||
-rw-r--r-- | scripts/travis-common.sh | 2 | ||||
-rwxr-xr-x | scripts/travis-test.sh | 4 | ||||
-rwxr-xr-x | scripts/upload-d8.sh | 13 |
7 files changed, 46 insertions, 21 deletions
diff --git a/scripts/build-d8.sh b/scripts/build-d8.sh index 1a892b33..ce7524d1 100755 --- a/scripts/build-d8.sh +++ b/scripts/build-d8.sh @@ -33,7 +33,7 @@ while [[ $# > 0 ]]; do shift done -SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" +SCRIPT_DIR="$(cd "$(dirname "$0")"; pwd -P)" ROOT_DIR="$(dirname "${SCRIPT_DIR}")" cd ${ROOT_DIR}/third_party/v8 diff --git a/scripts/d8-common.sh b/scripts/d8-common.sh new file mode 100644 index 00000000..8b10c50c --- /dev/null +++ b/scripts/d8-common.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# +# Copyright 2016 WebAssembly Community Group participants +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +OS=$(uname -s) +SCRIPT_DIR="$(cd "$(dirname "$0")"; pwd -P)" +ROOT_DIR="$(dirname "${SCRIPT_DIR}")" +V8_DIR="${ROOT_DIR}/third_party/v8/v8" +V8_OUT_DIR="${V8_DIR}/out/Release" +V8_SHA=$(cd "${V8_DIR}" && git rev-parse HEAD) +# TODO(binji): other architectures +V8_HOST_ARCH=x86_64 +V8_TARGET_ARCH=x86_64 +V8_BASE_BUCKET_HTTPS_URL=https://storage.googleapis.com/webassembly/v8 +V8_BASE_BUCKET_GS_URL=gs://webassembly/v8 +V8_BUCKET_PATH=${V8_SHA}/${OS}/${V8_HOST_ARCH}-${V8_TARGET_ARCH} +V8_BUCKET_GS_URL=${V8_BASE_BUCKET_GS_URL}/${V8_BUCKET_PATH} +V8_BUCKET_HTTPS_URL=${V8_BASE_BUCKET_HTTPS_URL}/${V8_BUCKET_PATH} +D8_FILES="d8 natives_blob.bin snapshot_blob.bin" diff --git a/scripts/download-d8.sh b/scripts/download-d8.sh index bb9be513..cbd12ecb 100755 --- a/scripts/download-d8.sh +++ b/scripts/download-d8.sh @@ -18,13 +18,11 @@ set -o nounset set -o errexit -SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" +SCRIPT_DIR="$(cd "$(dirname "$0")"; pwd -P)" ROOT_DIR="$(dirname "${SCRIPT_DIR}")" -V8_DIR="${ROOT_DIR}/third_party/v8/v8" OUT_DIR="${ROOT_DIR}/out" -V8_SHA=$(cd ${V8_DIR} && git rev-parse HEAD) -BUCKET_URL=https://storage.googleapis.com/webassembly/v8-native-prototype/${V8_SHA} +source "${SCRIPT_DIR}/d8-common.sh" Download() { local URL=$1 @@ -49,8 +47,8 @@ Download() { mkdir -p "${OUT_DIR}" -for file in d8 natives_blob.bin snapshot_blob.bin; do - Download ${BUCKET_URL}/${file} "${OUT_DIR}/${file}" +for file in ${D8_FILES}; do + Download ${V8_BUCKET_HTTPS_URL}/${file} "${OUT_DIR}/${file}" done # Make d8 executable diff --git a/scripts/travis-build.sh b/scripts/travis-build.sh index 866274cc..3f4d46b9 100755 --- a/scripts/travis-build.sh +++ b/scripts/travis-build.sh @@ -18,8 +18,8 @@ set -o nounset set -o errexit -SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" -source ${SCRIPT_DIR}/travis-common.sh +SCRIPT_DIR="$(cd "$(dirname "$0")"; pwd -P)" +source "${SCRIPT_DIR}/travis-common.sh" if [[ ${COMPILER} = "gcc" ]]; then # Build without re2c/bison to test prebuilt C sources diff --git a/scripts/travis-common.sh b/scripts/travis-common.sh index ceaab976..4d482df6 100644 --- a/scripts/travis-common.sh +++ b/scripts/travis-common.sh @@ -15,7 +15,7 @@ # limitations under the License. # -SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" +SCRIPT_DIR="$(cd "$(dirname "$0")"; pwd -P)" ROOT_DIR="$(dirname "${SCRIPT_DIR}")" BUILD_TYPES="debug release" BUILD_TYPES_UPPER="Debug Release" diff --git a/scripts/travis-test.sh b/scripts/travis-test.sh index da085544..07b334ac 100755 --- a/scripts/travis-test.sh +++ b/scripts/travis-test.sh @@ -18,8 +18,8 @@ set -o nounset set -o errexit -SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" -source ${SCRIPT_DIR}/travis-common.sh +SCRIPT_DIR="$(cd "$(dirname "$0")"; pwd -P)" +source "${SCRIPT_DIR}/travis-common.sh" log_and_run() { echo $* diff --git a/scripts/upload-d8.sh b/scripts/upload-d8.sh index a964835a..392ae1f8 100755 --- a/scripts/upload-d8.sh +++ b/scripts/upload-d8.sh @@ -18,15 +18,10 @@ set -o nounset set -o errexit -SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" -ROOT_DIR="$(dirname "${SCRIPT_DIR}")" -V8_DIR="${ROOT_DIR}/third_party/v8/v8" -V8_OUT_DIR="${V8_DIR}/out/Release" +SCRIPT_DIR="$(cd "$(dirname "$0")"; pwd -P)" -V8_SHA=$(cd ${V8_DIR} && git rev-parse HEAD) -BUCKET_URL=gs://webassembly/v8-native-prototype/${V8_SHA}/ -FILES="d8 natives_blob.bin snapshot_blob.bin" +source ${SCRIPT_DIR}/d8-common.sh -for file in ${FILES}; do - gsutil cp -a public-read ${V8_OUT_DIR}/${file} ${BUCKET_URL} +for file in ${D8_FILES}; do + gsutil cp -a public-read ${V8_OUT_DIR}/${file} ${V8_BUCKET_GS_URL}/${file} done |