From fe85a5660ab966e8e29d43c539a8e4398f13d1a1 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Wed, 22 Mar 2023 12:14:53 -0700 Subject: [PATCH] Add warning for SWIFT_CUSTOM_TOOLCHAIN usage --- swift/internal/xcode_swift_toolchain.bzl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/swift/internal/xcode_swift_toolchain.bzl b/swift/internal/xcode_swift_toolchain.bzl index 1cd6d27ff..cc8273a3c 100644 --- a/swift/internal/xcode_swift_toolchain.bzl +++ b/swift/internal/xcode_swift_toolchain.bzl @@ -601,8 +601,10 @@ def _xcode_swift_toolchain_impl(ctx): # TODO: Remove SWIFT_CUSTOM_TOOLCHAIN for the next major release custom_toolchain = ctx.var.get("SWIFT_CUSTOM_TOOLCHAIN") or ctx.configuration.default_shell_env.get("TOOLCHAINS") custom_xcode_toolchain_root = None + if ctx.var.get("SWIFT_CUSTOM_TOOLCHAIN"): + print("WARNING: SWIFT_CUSTOM_TOOLCHAIN is deprecated. Use --action_env=TOOLCHAINS= instead.") # buildifier: disable=print if toolchain_root and custom_toolchain: - fail("Do not use SWIFT_USE_TOOLCHAIN_ROOT and SWIFT_CUSTOM_TOOLCHAIN" + + fail("Do not use SWIFT_USE_TOOLCHAIN_ROOT and TOOLCHAINS" + "in the same build.") elif custom_toolchain: custom_xcode_toolchain_root = "__BAZEL_CUSTOM_XCODE_TOOLCHAIN_PATH__"