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:
Tim Talashok
2021-03-25 00:50:44 +01:00
committed by GitHub
parent fdda8524ce
commit c1589b5564
21 changed files with 333 additions and 100 deletions

View File

@@ -1,25 +1,7 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
workspace(name = "emsdk")
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "0f2de53628e848c1691e5729b515022f5a77369c76a09fbe55611e12731c90e3",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/2.0.1/rules_nodejs-2.0.1.tar.gz"],
)
load(":deps.bzl", "deps")
deps()
load("@build_bazel_rules_nodejs//:index.bzl", "npm_install")
# emscripten 2.0.15
http_archive(
name = "emscripten",
sha256 = "7ff49fc63adf29970f6e7af1df445d7f554bdbbb2606db1cb5d3567ce69df1db",
strip_prefix = "install",
url = "https://storage.googleapis.com/webassembly/emscripten-releases-builds/linux/89202930a98fe7f9ed59b574469a9471b0bda7dd/wasm-binaries.tbz2",
build_file = "//emscripten_toolchain:emscripten.BUILD",
type = "tar.bz2",
)
npm_install(
name = "npm",
package_json = "@emscripten//:emscripten/package.json",
package_lock_json = "@emscripten//:emscripten/package-lock.json",
)
load(":emscripten_deps.bzl", "emscripten_deps")
emscripten_deps()