Skip to content

Commit 433e86c

Browse files
authored
Add extra_tools to mojo_toolchain (#11)
This fixes issues with remote execution where the shared libraries used by the mojo executable were not available. Ideally we could write a rule to re-export mojo with its shared libraries but that doesn't work.
1 parent efd192b commit 433e86c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

mojo/private/toolchain.BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ mojo_import(
3939

4040
mojo_toolchain(
4141
name = "mojo_toolchain",
42+
extra_tools = [lib[1] for lib in _INTERNAL_LIBRARIES],
4243
implicit_deps = [
4344
name
4445
for name, _ in _INTERNAL_LIBRARIES

mojo/toolchain.bzl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ load("//mojo:providers.bzl", "MojoInfo", "MojoToolchainInfo")
44

55
def _mojo_toolchain_impl(ctx):
66
tool_files = [ctx.attr.mojo[DefaultInfo].files]
7-
for dep in ctx.attr.implicit_deps + [ctx.attr.lld]:
7+
for dep in ctx.attr.implicit_deps + ctx.attr.extra_tools + [ctx.attr.lld]:
88
tool_files.append(dep[DefaultInfo].default_runfiles.files)
99
tool_files.append(dep[DefaultInfo].files_to_run)
1010

@@ -27,6 +27,13 @@ mojo_toolchain = rule(
2727
mandatory = False,
2828
doc = "Additional compiler options to pass to the Mojo compiler.",
2929
),
30+
"extra_tools": attr.label_list(
31+
providers = [DefaultInfo],
32+
allow_files = True,
33+
mandatory = False,
34+
cfg = "exec",
35+
doc = "Additional tools to make available to every Mojo action.",
36+
),
3037
"lld": attr.label(
3138
allow_files = True,
3239
mandatory = True,

0 commit comments

Comments
 (0)