Skip to content

Commit 009d9a2

Browse files
authored
Merge all runfiles of @bazel_tools//tools/bash/runfiles (#3292)
As `@bazel_tools//tools/bash/runfiles` is now an alias to `@rules_shell//shell/runfiles` with Bazel@HEAD, consumers must properly merge all its runfiles rather than assuming that the `sh_library` target just consists of a single file. Work towards bazelbuild/examples#557 (comment)
1 parent 09472f7 commit 009d9a2

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

crate_universe/private/crates_vendor.bzl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -469,15 +469,13 @@ def _crates_vendor_impl(ctx):
469469
is_executable = True,
470470
)
471471

472+
runfiles = ctx.runfiles(files = cargo_bazel_runfiles, transitive_files = toolchain.all_files)
472473
if runner.basename.endswith(".sh"):
473-
cargo_bazel_runfiles.append(ctx.file._bash_runfiles)
474+
runfiles = runfiles.merge(ctx.attr._bash_runfiles[DefaultInfo].default_runfiles)
474475

475476
return DefaultInfo(
476477
files = depset([runner]),
477-
runfiles = ctx.runfiles(
478-
files = cargo_bazel_runfiles,
479-
transitive_files = toolchain.all_files,
480-
),
478+
runfiles = runfiles,
481479
executable = runner,
482480
)
483481

@@ -579,7 +577,6 @@ CRATES_VENDOR_ATTRS = {
579577
"_bash_runfiles": attr.label(
580578
doc = "The runfiles library for bash.",
581579
cfg = "target",
582-
allow_single_file = True,
583580
default = Label("@bazel_tools//tools/bash/runfiles"),
584581
),
585582
}

0 commit comments

Comments
 (0)