From 13ba4434f18a0bf3bdc2e05542729da3b13eb29d Mon Sep 17 00:00:00 2001 From: William Izzo Date: Tue, 11 Jun 2024 14:09:50 +0200 Subject: [PATCH 1/2] Allows generation of audio worklet bootstrap js file In order to allow users to generate the file, the allowed extension list in `link_wrapper.py` has been updated accordingly. --- bazel/emscripten_toolchain/link_wrapper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bazel/emscripten_toolchain/link_wrapper.py b/bazel/emscripten_toolchain/link_wrapper.py index ca6ca48fd8..ce7b25c83e 100644 --- a/bazel/emscripten_toolchain/link_wrapper.py +++ b/bazel/emscripten_toolchain/link_wrapper.py @@ -90,7 +90,8 @@ '.data', '.js.symbols', '.wasm.debug.wasm', - '.html' + '.html', + '.aw.js' ] for ext in extensions: From 8d680006bd678140ebd4e12484621a853773458a Mon Sep 17 00:00:00 2001 From: William Izzo Date: Wed, 12 Jun 2024 09:15:45 +0200 Subject: [PATCH 2/2] adds audio worklet js to wasm_cc_binary too --- bazel/emscripten_toolchain/wasm_cc_binary.bzl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bazel/emscripten_toolchain/wasm_cc_binary.bzl b/bazel/emscripten_toolchain/wasm_cc_binary.bzl index 23749ed835..6ea4f127f0 100644 --- a/bazel/emscripten_toolchain/wasm_cc_binary.bzl +++ b/bazel/emscripten_toolchain/wasm_cc_binary.bzl @@ -70,6 +70,7 @@ _ALLOW_OUTPUT_EXTNAMES = [ ".js.symbols", ".wasm.debug.wasm", ".html", + ".aw.js", ] _WASM_BINARY_COMMON_ATTRS = { @@ -151,6 +152,7 @@ def _wasm_cc_binary_legacy_impl(ctx): ctx.outputs.symbols, ctx.outputs.dwarf, ctx.outputs.html, + ctx.outputs.audio_worklet, ] args = ctx.actions.args() @@ -201,6 +203,7 @@ def _wasm_binary_legacy_outputs(name, cc_target): "symbols": "{}/{}.js.symbols".format(name, basename), "dwarf": "{}/{}.wasm.debug.wasm".format(name, basename), "html": "{}/{}.html".format(name, basename), + "audio_worklet": "{}/{}.aw.js".format(name, basename) } return outputs