Skip to content

Commit abfa9ce

Browse files
committed
Use BUILD.bazel to get the root directory of repositories
1 parent d5e2795 commit abfa9ce

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

bazel/emscripten_cache.bzl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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//:emscripten_config")).dirname
26+
return repository_ctx.path(Label("@emscripten_bin_linux//:BUILD.bazel")).dirname
2727
elif 'aarch64' in repository_ctx.os.arch:
28-
return repository_ctx.path(Label("@emscripten_bin_linux_arm64//:emscripten_config")).dirname
28+
return repository_ctx.path(Label("@emscripten_bin_linux_arm64//:BUILD.bazel")).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//:emscripten_config")).dirname
33+
return repository_ctx.path(Label("@emscripten_bin_mac//:BUILD.bazel")).dirname
3434
elif 'aarch64' in repository_ctx.os.arch:
35-
return repository_ctx.path(Label("@emscripten_bin_mac_arm64//:emscripten_config")).dirname
35+
return repository_ctx.path(Label("@emscripten_bin_mac_arm64//:BUILD.bazel")).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//:emscripten_config")).dirname
39+
return repository_ctx.path(Label("@emscripten_bin_win//:BUILD.bazel")).dirname
4040
else:
4141
fail('Unsupported operating system')
4242

@@ -54,7 +54,7 @@ def _emscripten_cache_impl(repository_ctx):
5454
emscripten_root = binaryen_root.get_child("emscripten")
5555
embuilder_path = emscripten_root.get_child("embuilder")
5656
cache_path = repository_ctx.path('cache')
57-
nodejs = repository_ctx.path(Label("@nodejs//:node_files")).dirname.get_child("bin/node")
57+
nodejs = repository_ctx.path(Label("@nodejs//:BUILD.bazel")).dirname.get_child("bin").get_child("node")
5858
# Create configuration file
5959
embuilder_config_content = "NODE_JS = '{}'\n".format(nodejs)
6060
embuilder_config_content += "LLVM_ROOT = '{}'\n".format(llvm_root)

0 commit comments

Comments
 (0)