Skip to content

Commit 75656b1

Browse files
committed
Multiple fixes
1. Use a real file in get_binaryen_root so that dirname works under Windows 2. Enable embuilders output for debugging purposes
1 parent f3f2c7e commit 75656b1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

bazel/emscripten_cache.bzl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ def get_binaryen_root(repository_ctx):
88
Retrieve the path to the Emscripten binary directory
99
1010
This function determines the correct Emscripten binary directory path by
11-
examining the operating system (OS) and architecture (arch) of the
12-
environment. It supports Linux, macOS, and Windows operating systems with
13-
specific architectures.
11+
examining the operating system and architecture of the environment. It
12+
supports Linux, macOS, and Windows operating systems with specific
13+
architectures.
1414
1515
Args:
1616
repository_ctx: The repository context object which provides information
@@ -23,20 +23,20 @@ def get_binaryen_root(repository_ctx):
2323
"""
2424
if repository_ctx.os.name.startswith('linux'):
2525
if 'amd64' in repository_ctx.os.arch or 'x86_64' in repository_ctx.os.arch:
26-
return repository_ctx.path(Label("@emscripten_bin_linux//:all")).dirname
26+
return repository_ctx.path(Label("@emscripten_bin_linux//:emscripten_config")).dirname
2727
elif 'aarch64' in repository_ctx.os.arch:
28-
return repository_ctx.path(Label("@emscripten_bin_linux_arm64//:all")).dirname
28+
return repository_ctx.path(Label("@emscripten_bin_linux_arm64//:emscripten_config")).dirname
2929
else:
3030
fail('Unsupported architecture for Linux')
3131
elif repository_ctx.os.name.startswith('mac'):
3232
if 'amd64' in repository_ctx.os.arch or 'x86_64' in repository_ctx.os.arch:
33-
return repository_ctx.path(Label("@emscripten_bin_mac//:all")).dirname
33+
return repository_ctx.path(Label("@emscripten_bin_mac//:emscripten_config")).dirname
3434
elif 'aarch64' in repository_ctx.os.arch:
35-
return repository_ctx.path(Label("@emscripten_bin_mac_arm64//:all")).dirname
35+
return repository_ctx.path(Label("@emscripten_bin_mac_arm64//:emscripten_config")).dirname
3636
else:
3737
fail('Unsupported architecture for MacOS')
3838
elif repository_ctx.os.name.startswith('windows'):
39-
return repository_ctx.path(Label("@emscripten_bin_win//:all")).dirname
39+
return repository_ctx.path(Label("@emscripten_bin_win//:emscripten_config")).dirname
4040
else:
4141
fail('Unsupported operating system')
4242

@@ -73,7 +73,7 @@ def _emscripten_cache_impl(repository_ctx):
7373
embuilder_args = [embuilder_path] + flags + ["build"] + libraries
7474
# Run embuilder
7575
repository_ctx.report_progress("Building secondary cache")
76-
result = repository_ctx.execute(embuilder_args, quiet=True)
76+
result = repository_ctx.execute(embuilder_args, quiet=False)
7777
if result.return_code != 0:
7878
fail("Embuilder exited with a non-zero return code")
7979
# Override Emscripten's cache with the secondary cache

0 commit comments

Comments
 (0)