Use emsdk as external bazel dependency (#766)
* Makes provided bazel rules look up @emsdk workspace instead of local workspace * Uses system-specific emscripten binaries instead of defaulting to linux * Provides macros for loading emsdk dependencies (nodejs and emscripten binaries) * Unhardcodes paths in bazel rules and .sh wrappers * `update_bazel_workspace.sh` now updates `revisions.bzl` * `emscripten_deps()` can be fed with specific emscripten version * Adds external usage test Addresses #650 and #696
This commit is contained in:
28
test/test_bazel_mac.sh
Executable file
28
test/test_bazel_mac.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "test bazel"
|
||||
|
||||
set -x
|
||||
set -e
|
||||
|
||||
# Get the latest version number from emscripten-releases-tag.txt.
|
||||
VER=$(ggrep -oP '(?<=latest\": \")([\d\.]+)(?=\")' \
|
||||
emscripten-releases-tags.txt \
|
||||
| sed "s/\./\\\./g")
|
||||
# Based on the latest version number, get the commit hash for that version.
|
||||
HASH=$(grep "${VER}" emscripten-releases-tags.txt \
|
||||
| grep -v latest \
|
||||
| cut -f4 -d\")
|
||||
|
||||
FAILMSG="!!! scripts/update_bazel_toolchain.sh needs to be run !!!"
|
||||
|
||||
# Ensure the WORKSPACE file is up to date with the latest version.
|
||||
grep ${VER} bazel/revisions.bzl || (echo ${FAILMSG} && false)
|
||||
grep ${HASH} bazel/revisions.bzl || (echo ${FAILMSG} && false)
|
||||
|
||||
cd bazel
|
||||
bazel build //hello-world:hello-world-wasm
|
||||
bazel build //hello-world:hello-world-wasm-simd
|
||||
|
||||
cd test_external
|
||||
bazel build //:hello-world-wasm
|
||||
Reference in New Issue
Block a user