about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYannic <contact@yannic-bonenberger.com>2019-08-16T14·38+0000
committerDerek Mauro <761129+derekmauro@users.noreply.github.com>2019-08-16T14·38-0400
commit36910d3d7e9fccadd6603f232d0c4f54dcd47c7e (patch)
tree477a5d0a416e35eb922c5a0679db0ff2624e0aaa
parentaae8143cf9aa611f70d7ea9b95b8b8b383b2271a (diff)
[bazel] Add fixes for --incompatible_load_cc_rules_from_bzl (#351)
* [bazel] Add fixes for --incompatible_load_cc_rules_from_bzl

Starting with Bazel 1.0 (September 2019), C++ rules will need to be
loaded from the @rules_cc repository. This change adds the required
loads for that. For full compatibility, we will need versions of
googletest and google-benchmark that also includes these loads.

* Run buildifier again after merge
-rw-r--r--WORKSPACE11
-rw-r--r--absl/algorithm/BUILD.bazel1
-rw-r--r--absl/base/BUILD.bazel1
-rw-r--r--absl/container/BUILD.bazel1
-rw-r--r--absl/debugging/BUILD.bazel1
-rw-r--r--absl/flags/BUILD.bazel1
-rw-r--r--absl/hash/BUILD.bazel1
-rw-r--r--absl/memory/BUILD.bazel3
-rw-r--r--absl/meta/BUILD.bazel1
-rw-r--r--absl/numeric/BUILD.bazel1
-rw-r--r--absl/random/BUILD.bazel1
-rw-r--r--absl/random/internal/BUILD.bazel2
-rw-r--r--absl/strings/BUILD.bazel1
-rw-r--r--absl/synchronization/BUILD.bazel1
-rw-r--r--absl/time/BUILD.bazel1
-rw-r--r--absl/time/internal/cctz/BUILD.bazel6
-rw-r--r--absl/types/BUILD.bazel1
-rw-r--r--absl/utility/BUILD.bazel1
18 files changed, 33 insertions, 3 deletions
diff --git a/WORKSPACE b/WORKSPACE
index 49e2d3cb6e31..376464ef4104 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -27,3 +27,14 @@ http_archive(
     strip_prefix = "benchmark-16703ff83c1ae6d53e5155df3bb3ab0bc96083be",
     sha256 = "59f918c8ccd4d74b6ac43484467b500f1d64b40cc1010daa055375b322a43ba3",
 )
+
+# C++ rules for Bazel.
+http_archive(
+    name = "rules_cc",
+    sha256 = "67412176974bfce3f4cf8bdaff39784a72ed709fc58def599d1f68710b58d68b",
+    strip_prefix = "rules_cc-b7fe9697c0c76ab2fd431a891dbb9a6a32ed7c3e",
+    urls = [
+        "https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/b7fe9697c0c76ab2fd431a891dbb9a6a32ed7c3e.zip",
+        "https://github.com/bazelbuild/rules_cc/archive/b7fe9697c0c76ab2fd431a891dbb9a6a32ed7c3e.zip",
+    ],
+)
diff --git a/absl/algorithm/BUILD.bazel b/absl/algorithm/BUILD.bazel
index c506f3b9fe8d..2ee8c09e6268 100644
--- a/absl/algorithm/BUILD.bazel
+++ b/absl/algorithm/BUILD.bazel
@@ -14,6 +14,7 @@
 # limitations under the License.
 #
 
+load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
 load(
     "//absl:copts/configure_copts.bzl",
     "ABSL_DEFAULT_COPTS",
diff --git a/absl/base/BUILD.bazel b/absl/base/BUILD.bazel
index bfdc7ab5ce73..cd5dd74f6025 100644
--- a/absl/base/BUILD.bazel
+++ b/absl/base/BUILD.bazel
@@ -14,6 +14,7 @@
 # limitations under the License.
 #
 
+load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
 load(
     "//absl:copts/configure_copts.bzl",
     "ABSL_DEFAULT_COPTS",
diff --git a/absl/container/BUILD.bazel b/absl/container/BUILD.bazel
index 90f4d0b7e0b4..45c90528cd97 100644
--- a/absl/container/BUILD.bazel
+++ b/absl/container/BUILD.bazel
@@ -14,6 +14,7 @@
 # limitations under the License.
 #
 
+load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
 load(
     "//absl:copts/configure_copts.bzl",
     "ABSL_DEFAULT_COPTS",
diff --git a/absl/debugging/BUILD.bazel b/absl/debugging/BUILD.bazel
index 760c481f5bda..b87c55a54f61 100644
--- a/absl/debugging/BUILD.bazel
+++ b/absl/debugging/BUILD.bazel
@@ -14,6 +14,7 @@
 # limitations under the License.
 #
 
+load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
 load(
     "//absl:copts/configure_copts.bzl",
     "ABSL_DEFAULT_COPTS",
diff --git a/absl/flags/BUILD.bazel b/absl/flags/BUILD.bazel
index 4720791a8d8d..c338dbeef4a2 100644
--- a/absl/flags/BUILD.bazel
+++ b/absl/flags/BUILD.bazel
@@ -14,6 +14,7 @@
 # limitations under the License.
 #
 
+load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
 load(
     "//absl:copts/configure_copts.bzl",
     "ABSL_DEFAULT_COPTS",
diff --git a/absl/hash/BUILD.bazel b/absl/hash/BUILD.bazel
index 8c2daf703bcd..d6d8dabc89b1 100644
--- a/absl/hash/BUILD.bazel
+++ b/absl/hash/BUILD.bazel
@@ -14,6 +14,7 @@
 # limitations under the License.
 #
 
+load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
 load(
     "//absl:copts/configure_copts.bzl",
     "ABSL_DEFAULT_COPTS",
diff --git a/absl/memory/BUILD.bazel b/absl/memory/BUILD.bazel
index 4dba6366147f..00f60657f0a6 100644
--- a/absl/memory/BUILD.bazel
+++ b/absl/memory/BUILD.bazel
@@ -14,13 +14,14 @@
 # limitations under the License.
 #
 
+load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
 load(
     "//absl:copts/configure_copts.bzl",
     "ABSL_DEFAULT_COPTS",
     "ABSL_DEFAULT_LINKOPTS",
-    "ABSL_TEST_COPTS",
     "ABSL_EXCEPTIONS_FLAG",
     "ABSL_EXCEPTIONS_FLAG_LINKOPTS",
+    "ABSL_TEST_COPTS",
 )
 
 package(default_visibility = ["//visibility:public"])
diff --git a/absl/meta/BUILD.bazel b/absl/meta/BUILD.bazel
index e004b509f27e..8db8dd6b1581 100644
--- a/absl/meta/BUILD.bazel
+++ b/absl/meta/BUILD.bazel
@@ -1,3 +1,4 @@
+load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
 load(
     "//absl:copts/configure_copts.bzl",
     "ABSL_DEFAULT_COPTS",
diff --git a/absl/numeric/BUILD.bazel b/absl/numeric/BUILD.bazel
index d9b561dfeca2..e09e52d21fe6 100644
--- a/absl/numeric/BUILD.bazel
+++ b/absl/numeric/BUILD.bazel
@@ -12,6 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
 load(
     "//absl:copts/configure_copts.bzl",
     "ABSL_DEFAULT_COPTS",
diff --git a/absl/random/BUILD.bazel b/absl/random/BUILD.bazel
index d09f0cb399ee..4e210e71d6c8 100644
--- a/absl/random/BUILD.bazel
+++ b/absl/random/BUILD.bazel
@@ -1,5 +1,6 @@
 # ABSL random-number generation libraries.
 
+load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
 load(
     "//absl:copts/configure_copts.bzl",
     "ABSL_DEFAULT_COPTS",
diff --git a/absl/random/internal/BUILD.bazel b/absl/random/internal/BUILD.bazel
index d9581d00e587..5e7c16f322a2 100644
--- a/absl/random/internal/BUILD.bazel
+++ b/absl/random/internal/BUILD.bazel
@@ -1,3 +1,5 @@
+load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
+
 # Internal-only implementation classes for Abseil Random
 load(
     "//absl:copts/configure_copts.bzl",
diff --git a/absl/strings/BUILD.bazel b/absl/strings/BUILD.bazel
index 9679dc3076b0..cb80841694eb 100644
--- a/absl/strings/BUILD.bazel
+++ b/absl/strings/BUILD.bazel
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
 load(
     "//absl:copts/configure_copts.bzl",
     "ABSL_DEFAULT_COPTS",
diff --git a/absl/synchronization/BUILD.bazel b/absl/synchronization/BUILD.bazel
index d40d861fe11f..b48133883c7f 100644
--- a/absl/synchronization/BUILD.bazel
+++ b/absl/synchronization/BUILD.bazel
@@ -14,6 +14,7 @@
 # limitations under the License.
 #
 
+load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
 load(
     "//absl:copts/configure_copts.bzl",
     "ABSL_DEFAULT_COPTS",
diff --git a/absl/time/BUILD.bazel b/absl/time/BUILD.bazel
index 1c387e462047..a615152f01ba 100644
--- a/absl/time/BUILD.bazel
+++ b/absl/time/BUILD.bazel
@@ -14,6 +14,7 @@
 # limitations under the License.
 #
 
+load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
 load(
     "//absl:copts/configure_copts.bzl",
     "ABSL_DEFAULT_COPTS",
diff --git a/absl/time/internal/cctz/BUILD.bazel b/absl/time/internal/cctz/BUILD.bazel
index b05c234714e4..c7cb6b9d2546 100644
--- a/absl/time/internal/cctz/BUILD.bazel
+++ b/absl/time/internal/cctz/BUILD.bazel
@@ -12,6 +12,8 @@
 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 
+load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
+
 package(features = ["-parse_headers"])
 
 licenses(["notice"])  # Apache License
@@ -77,10 +79,10 @@ cc_library(
         "include/cctz/zone_info_source.h",
     ],
     linkopts = select({
-        ":osx": [
+        ":ios": [
             "-framework Foundation",
         ],
-        ":ios": [
+        ":osx": [
             "-framework Foundation",
         ],
         "//conditions:default": [],
diff --git a/absl/types/BUILD.bazel b/absl/types/BUILD.bazel
index 6e287ce08221..6dd4e142ce9d 100644
--- a/absl/types/BUILD.bazel
+++ b/absl/types/BUILD.bazel
@@ -14,6 +14,7 @@
 # limitations under the License.
 #
 
+load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
 load(
     "//absl:copts/configure_copts.bzl",
     "ABSL_DEFAULT_COPTS",
diff --git a/absl/utility/BUILD.bazel b/absl/utility/BUILD.bazel
index d41317e3507e..280a7dd56241 100644
--- a/absl/utility/BUILD.bazel
+++ b/absl/utility/BUILD.bazel
@@ -1,3 +1,4 @@
+load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
 load(
     "//absl:copts/configure_copts.bzl",
     "ABSL_DEFAULT_COPTS",