Skip to content

Commit d8a1f6c

Browse files
authored
[bazel] Set CLOSURE_COMPILER to workaround RBE+symlinks issue (#1037)
* [bazel] Set CLOSURE_COMPILER to workaround RBE+symlinks issue * space * specify node_js
1 parent e34773a commit d8a1f6c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

bazel/emscripten_toolchain/emscripten_config

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,21 @@ import platform
33

44
ROOT_DIR = os.environ["ROOT_DIR"]
55
EMSCRIPTEN_ROOT = os.environ["EMSCRIPTEN"]
6-
BINARYEN_ROOT = ROOT_DIR + "/" + os.environ["EM_BIN_PATH"]
7-
LLVM_ROOT = BINARYEN_ROOT + "/bin"
6+
BINARYEN_ROOT = os.path.join(ROOT_DIR, os.environ["EM_BIN_PATH"])
7+
LLVM_ROOT = os.path.join(BINARYEN_ROOT, "bin")
88
FROZEN_CACHE = True
99

1010
system = platform.system()
1111

1212
machine = "arm64" if platform.machine() == "arm64" else "amd64"
1313
nodejs_binary = "bin/nodejs/node.exe" if(system =="Windows") else "bin/node"
1414
NODE_JS = ROOT_DIR + "/external/nodejs_{}_{}/{}".format(system.lower(), machine, nodejs_binary)
15+
16+
17+
# This works around an issue with Bazel RBE where the symlinks in node_modules/.bin
18+
# are uploaded as the linked files, which means the cli.js cannot load its
19+
# dependencies from the expected locations.
20+
# See https://github.com/emscripten-core/emscripten/pull/16640 for more
21+
if system != "Windows":
22+
CLOSURE_COMPILER = [NODE_JS, os.path.join(EMSCRIPTEN_ROOT, "node_modules",
23+
"google-closure-compiler", "cli.js")]

0 commit comments

Comments
 (0)