From 9e59ac7c3822ec0c920dd9832197f71edc0abbb3 Mon Sep 17 00:00:00 2001 From: Marcel Hlopko Date: Tue, 14 May 2019 15:58:15 +0200 Subject: [PATCH] Update rules_swift for --incompatible_enable_cc_toolchain_resolution bazelbuild/bazel#7260 --- swift/internal/swift_toolchain.bzl | 3 ++- swift/internal/xcode_swift_toolchain.bzl | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/swift/internal/swift_toolchain.bzl b/swift/internal/swift_toolchain.bzl index ec25ce666..d8fe2b91e 100644 --- a/swift/internal/swift_toolchain.bzl +++ b/swift/internal/swift_toolchain.bzl @@ -176,7 +176,7 @@ def _run_swift_action(toolchain_tools, swift_wrapper, actions, **kwargs): def _swift_toolchain_impl(ctx): toolchain_root = ctx.attr.root cc_toolchain = find_cpp_toolchain(ctx) - cc_toolchain_files = ctx.attr._cc_toolchain.files + cc_toolchain_files = cc_toolchain.all_files linker_opts_producer = partial.make( _default_linker_opts, @@ -274,5 +274,6 @@ The C++ toolchain from which other tools needed by the Swift toolchain (such as }), doc = "Represents a Swift compiler toolchain.", fragments = ["swift"], + toolchains = ["@bazel_tools//tools/cpp:toolchain_type"], implementation = _swift_toolchain_impl, ) diff --git a/swift/internal/xcode_swift_toolchain.bzl b/swift/internal/xcode_swift_toolchain.bzl index 65a6c66c6..4a1763415 100644 --- a/swift/internal/xcode_swift_toolchain.bzl +++ b/swift/internal/xcode_swift_toolchain.bzl @@ -506,7 +506,7 @@ def _xcode_swift_toolchain_impl(ctx): ) cc_toolchain = find_cpp_toolchain(ctx) - cc_toolchain_files = ctx.attr._cc_toolchain.files + cc_toolchain_files = cc_toolchain.all_files # Compute the default requested features and conditional ones based on Xcode version. requested_features = features_for_build_modes(ctx, objc_fragment = ctx.fragments.objc) @@ -587,5 +587,6 @@ The C++ toolchain from which linking flags and other tools needed by the Swift t "objc", "swift", ], + toolchains = ["@bazel_tools//tools/cpp:toolchain_type"], implementation = _xcode_swift_toolchain_impl, )