Skip to content

Commit 2e828a4

Browse files
authored
fix: propagate Ruby toolchain files as inputs to rb_gem_build (#94)
This fixes gem building in RBE.
1 parent 9877fa6 commit 2e828a4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

ruby/private/gem_build.bzl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@ load(
1313
load("//ruby/private:utils.bzl", _is_windows = "is_windows")
1414

1515
def _rb_gem_build_impl(ctx):
16-
tools = depset([])
17-
1816
gem_builder = ctx.actions.declare_file("{}_gem_builder.rb".format(ctx.label.name))
1917
transitive_data = get_transitive_data(ctx.files.data, ctx.attr.deps).to_list()
2018
transitive_deps = get_transitive_deps(ctx.attr.deps).to_list()
2119
transitive_srcs = get_transitive_srcs(ctx.files.srcs, ctx.attr.deps).to_list()
2220
bundle_env = get_bundle_env({}, ctx.attr.deps)
2321
java_toolchain = ctx.toolchains["@bazel_tools//tools/jdk:runtime_toolchain_type"]
2422
ruby_toolchain = ctx.toolchains["@rules_ruby//ruby:toolchain_type"]
23+
tools = []
24+
tools.extend(ruby_toolchain.files)
2525

2626
env = {}
2727
env.update(ruby_toolchain.env)
2828

2929
if ruby_toolchain.version.startswith("jruby"):
3030
env["JAVA_HOME"] = java_toolchain.java_runtime.java_home
31-
tools = java_toolchain.java_runtime.files
31+
tools.extend(java_toolchain.java_runtime.files.to_list())
3232
if _is_windows(ctx):
3333
env["PATH"] = ruby_toolchain.ruby.dirname
3434

@@ -66,8 +66,7 @@ def _rb_gem_build_impl(ctx):
6666
arguments = [args],
6767
env = env,
6868
mnemonic = "GemBuild",
69-
tools = tools,
70-
use_default_shell_env = not _is_windows(ctx),
69+
tools = depset(tools),
7170
)
7271

7372
providers = []

0 commit comments

Comments
 (0)