Support Bazel builds on Apple silicon (#978)

* Support Bazel builds on Apple silicon

* Add sha_mac_arm64 hash for 3.1.3

* Configure node_repositories in emscripten_deps.bzl

* Add mac arm64 to bazel workspace update script

Co-authored-by: Matthew Soulanille <matthew@guppy.home>
This commit is contained in:
Matthew Soulanille
2022-02-11 11:18:16 -08:00
committed by GitHub
parent c33c7be17f
commit bc6209b6dc
5 changed files with 49 additions and 10 deletions

View File

@@ -34,16 +34,16 @@ if [[ $ERR = 1 ]]; then
fi
URL1=https://storage.googleapis.com/webassembly/emscripten-releases-builds/
URL2=/wasm-binaries.
URL2=/wasm-binaries
# Get commit hash for $1 version
get_hash () {
echo $(grep "$1" emscripten-releases-tags.json | grep -v latest | cut -f4 -d\")
echo $(grep "$1" emscripten-releases-tags.json | grep -v latest | grep -v asserts | cut -f4 -d\")
}
# Get sha256 for $1 os $2 extname $3 hash
# Get sha256 for $1 os $2 extname $3 hash $4 architecture
get_sha () {
echo $(curl "${URL1}$1/$3${URL2}$2" 2>/dev/null | sha256sum | awk '{print $1}')
echo $(curl "${URL1}$1/$3${URL2}$4.$2" 2>/dev/null | sha256sum | awk '{print $1}')
}
# Assemble dictionary line
@@ -54,6 +54,7 @@ revisions_item () {
"\ hash = \"$(get_hash ${hash})\",\n" \
"\ sha_linux = \"$(get_sha linux tbz2 ${hash})\",\n" \
"\ sha_mac = \"$(get_sha mac tbz2 ${hash})\",\n" \
"\ sha_mac_arm64 = \"$(get_sha mac tbz2 ${hash} -arm64)\",\n" \
"\ sha_win = \"$(get_sha win zip ${hash})\",\n" \
"\ ),"
}