2021-03-25 00:50:44 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
|
|
echo "test bazel"
|
|
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
set -e
|
|
|
|
|
|
2021-08-25 17:21:40 -07:00
|
|
|
# Get the latest version number from emscripten-releases-tag.json.
|
2024-06-20 16:16:05 -07:00
|
|
|
VER=$(scripts/get_release_info.py emscripten-releases-tags.json latest)
|
|
|
|
|
|
2021-03-25 00:50:44 +01:00
|
|
|
# Based on the latest version number, get the commit hash for that version.
|
2024-06-20 16:16:05 -07:00
|
|
|
HASH=$(scripts/get_release_info.py emscripten-releases-tags.json hash ${VER})
|
2021-03-25 00:50:44 +01:00
|
|
|
|
2023-08-24 10:10:29 -07:00
|
|
|
FAILMSG="!!! scripts/update_bazel_workspace.py needs to be run !!!"
|
2021-03-25 00:50:44 +01:00
|
|
|
|
|
|
|
|
# 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)
|
2025-04-09 23:38:12 +02:00
|
|
|
grep ${VER} bazel/MODULE.bazel || (echo ${FAILMSG} && false)
|
2021-03-25 00:50:44 +01:00
|
|
|
|
|
|
|
|
cd bazel
|
|
|
|
|
bazel build //hello-world:hello-world-wasm
|
|
|
|
|
bazel build //hello-world:hello-world-wasm-simd
|
|
|
|
|
|
|
|
|
|
cd test_external
|
2024-04-22 11:19:11 -07:00
|
|
|
bazel build //long_command_line:long_command_line_wasm
|
2021-03-25 00:50:44 +01:00
|
|
|
bazel build //:hello-world-wasm
|
[Bazel] Support generating a secondary cache (#1405)
This is a working solution for generating a separate Emscripten cache.
Note that this requires an additional entry in the workspace as follows:
```starlark
load("@emsdk//:emscripten_cache.bzl", emsdk_emscripten_cache = "emscripten_cache")
emsdk_emscripten_cache()
```
When used like this, the default Emscripten cache will be used. However,
if the entry is as follows:
```starlark
load("@emsdk//:emscripten_cache.bzl", emsdk_emscripten_cache = "emscripten_cache")
emsdk_emscripten_cache(flags = ["--lto"])
```
Then embuilder will be called to build all system libraries and ports
(i.e., the `ALL` option to embuilder) with the LTO option enabled. This
can take awhile, so I have also made possible to specify which libraries
you want to build explicitly:
```starlark
load("@emsdk//:emscripten_cache.bzl", emsdk_emscripten_cache = "emscripten_cache")
emsdk_emscripten_cache(
flags = ["--lto"],
libraries = [
"crtbegin",
"libprintf_long_double-debug",
"libstubs-debug",
"libnoexit",
"libc-debug",
"libdlmalloc",
"libcompiler_rt",
"libc++-noexcept",
"libc++abi-debug-noexcept",
"libsockets"
]
)
```
Resolves #807, resolves #971, resolves #1099, resolves #1362, resolves
#1401
2024-07-01 18:23:07 +02:00
|
|
|
|
|
|
|
|
cd ../test_secondary_lto_cache
|
|
|
|
|
bazel build //:hello-world-wasm
|
|
|
|
|
|