Skip to content

Commit 50b9ef3

Browse files
Prepare rust rules for Starlark CcToolchainInfo. (#2424)
#2425
1 parent 9a6f5c8 commit 50b9ef3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

rust/private/rustc.bzl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,15 @@ def collect_inputs(
671671
"""
672672
linker_script = getattr(file, "linker_script") if hasattr(file, "linker_script") else None
673673

674-
linker_depset = cc_toolchain.linker_files()
674+
# TODO: As of writing this comment Bazel used Java CcToolchainInfo.
675+
# However there is ongoing work to rewrite provider in Starlark.
676+
# rules_rust is not coupled with Bazel release. Remove conditional and change to
677+
# _linker_files once Starlark CcToolchainInfo is visible to Bazel.
678+
# https://github.com/bazelbuild/rules_rust/issues/2425
679+
if hasattr(cc_toolchain, "_linker_files"):
680+
linker_depset = cc_toolchain._linker_files
681+
else:
682+
linker_depset = cc_toolchain.linker_files()
675683
compilation_mode = ctx.var["COMPILATION_MODE"]
676684

677685
use_pic = _should_use_pic(cc_toolchain, feature_configuration, crate_info.type, compilation_mode)

0 commit comments

Comments
 (0)