From 4f8676f6ca296416ea68c157ee02d775539698ea Mon Sep 17 00:00:00 2001 From: Marcel Hlopko Date: Fri, 1 Nov 2019 16:36:34 +0100 Subject: [PATCH] Add rules_cc_toolchains to repositories.bzl This is the new entry point for registering C++ toolchains (replacing implicit cc_configure()). While at it, fix one misnamed function. --- WORKSPACE | 3 +++ cc/private/toolchain/unix_cc_configure.bzl | 2 +- cc/repositories.bzl | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/WORKSPACE b/WORKSPACE index 87a57de..c7c274b 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -54,3 +54,6 @@ load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_ rules_proto_dependencies() rules_proto_toolchains() + +load("//cc:repositories.bzl", "rules_cc_toolchains") +rules_proto_toolchains() diff --git a/cc/private/toolchain/unix_cc_configure.bzl b/cc/private/toolchain/unix_cc_configure.bzl index 856486e..707104e 100644 --- a/cc/private/toolchain/unix_cc_configure.bzl +++ b/cc/private/toolchain/unix_cc_configure.bzl @@ -252,7 +252,7 @@ def _get_no_canonical_prefixes_opt(repository_ctx, cc): ) return opt -def _get_env(repository_ctx): +def get_env(repository_ctx): """Convert the environment in a list of export if in Homebrew. Doesn't %-escape the result! Args: diff --git a/cc/repositories.bzl b/cc/repositories.bzl index bb41c86..4e1dd8f 100644 --- a/cc/repositories.bzl +++ b/cc/repositories.bzl @@ -9,6 +9,7 @@ # Ideally we'd delete this entire file. load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("//cc/private/toolchain:cc_configure.bzl", "cc_configure") def rules_cc_dependencies(): _maybe( @@ -22,6 +23,9 @@ def rules_cc_dependencies(): ], ) +def rules_cc_toolchains(*args): + cc_configure(*args) + def _maybe(repo_rule, name, **kwargs): if not native.existing_rule(name): repo_rule(name = name, **kwargs)