Move platform and toolchain definition out of experimental. (#59)

* Move platform and toolchain definition out of experimental.
* Add constraints for sanitizers.
diff --git a/configs/debian8_clang/0.3.0/BUILD b/configs/debian8_clang/0.3.0/BUILD
index 66a5d84..f782e83 100644
--- a/configs/debian8_clang/0.3.0/BUILD
+++ b/configs/debian8_clang/0.3.0/BUILD
@@ -24,3 +24,28 @@
     srcs = [],
     java_home = "/usr/lib/jvm/java-8-openjdk-amd64",
 )
+
+# Latest RBE Debian8 container.
+# Update every time when a new container is released.
+alias(
+    name = "rbe_debian8",
+    actual = ":rbe_debian8_r328903",
+)
+
+# RBE Debian8 r328903
+platform(
+    name = "rbe_debian8_r328903",
+    constraint_values = [
+        "@bazel_tools//platforms:x86_64",
+        "@bazel_tools//platforms:linux",
+        "@bazel_tools//tools/cpp:clang",
+        "//constraints/sanitizers:support_msan",
+        "//constraints:jessie",
+    ],
+    remote_execution_properties = """
+          properties: {
+            name: "container-image"
+            value:"docker://gcr.io/cloud-marketplace/google/rbe-debian8@sha256:0d5db936f8fa04638ca31e4fc117415068dca43dc343d605c0db2a15f433a327"
+         }
+         """,
+)
diff --git a/toolchains/experimental/cpp/BUILD b/configs/debian8_clang/0.3.0/bazel_0.13.0/cpp/BUILD
similarity index 63%
rename from toolchains/experimental/cpp/BUILD
rename to configs/debian8_clang/0.3.0/bazel_0.13.0/cpp/BUILD
index 6a4804b..d63f7e1 100644
--- a/toolchains/experimental/cpp/BUILD
+++ b/configs/debian8_clang/0.3.0/bazel_0.13.0/cpp/BUILD
@@ -17,11 +17,12 @@
 package(default_visibility = ["//visibility:public"])
 
 toolchain(
-    name = "cc-toolchain-clang-x86_64",
+    name = "cc-toolchain-clang-x86_64-default",
     exec_compatible_with = [
         "@bazel_tools//platforms:linux",
         "@bazel_tools//platforms:x86_64",
         "@bazel_tools//tools/cpp:clang",
+        "//constraints:jessie",
     ],
     target_compatible_with = [
         "@bazel_tools//platforms:linux",
@@ -30,3 +31,20 @@
     toolchain = "//configs/debian8_clang/0.3.0/bazel_0.13.0/default:cc-compiler-k8",
     toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
 )
+
+toolchain(
+    name = "cc-toolchain-clang-x86_64-msan",
+    exec_compatible_with = [
+        "@bazel_tools//platforms:linux",
+        "@bazel_tools//platforms:x86_64",
+        "@bazel_tools//tools/cpp:clang",
+        "//constraints:jessie",
+        "//constraints/sanitizers:support_msan",
+    ],
+    target_compatible_with = [
+        "@bazel_tools//platforms:linux",
+        "@bazel_tools//platforms:x86_64",
+    ],
+    toolchain = "//configs/debian8_clang/0.3.0/bazel_0.13.0/msan:cc-compiler-k8",
+    toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
+)
diff --git a/configs/ubuntu16_04_clang/1.0/BUILD b/configs/ubuntu16_04_clang/1.0/BUILD
index 66a5d84..15d751b 100644
--- a/configs/ubuntu16_04_clang/1.0/BUILD
+++ b/configs/ubuntu16_04_clang/1.0/BUILD
@@ -24,3 +24,28 @@
     srcs = [],
     java_home = "/usr/lib/jvm/java-8-openjdk-amd64",
 )
+
+# Latest RBE Ubuntu16_04 container
+# Update every time when a new container is released.
+alias(
+    name = "rbe_ubuntu1604",
+    actual = ":rbe_ubuntu1604_r328903",
+)
+
+# RBE Ubuntu16_04 r328903
+platform(
+    name = "rbe_ubuntu1604_r328903",
+    constraint_values = [
+        "@bazel_tools//platforms:x86_64",
+        "@bazel_tools//platforms:linux",
+        "@bazel_tools//tools/cpp:clang",
+        "//constraints:xenial",
+        "//constraints/sanitizers:support_msan",
+    ],
+    remote_execution_properties = """
+          properties: {
+            name: "container-image"
+            value:"docker://gcr.io/cloud-marketplace/google/rbe-debian8@sha256:59bf0e191a6b5cc1ab62c2224c810681d1326bad5a27b1d36c9f40113e79da7f"
+         }
+         """,
+)
diff --git a/configs/ubuntu16_04_clang/1.0/bazel_0.13.0/cpp/BUILD b/configs/ubuntu16_04_clang/1.0/bazel_0.13.0/cpp/BUILD
new file mode 100644
index 0000000..259a890
--- /dev/null
+++ b/configs/ubuntu16_04_clang/1.0/bazel_0.13.0/cpp/BUILD
@@ -0,0 +1,51 @@
+# Copyright 2017 The Bazel Authors. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+licenses(["notice"])  # Apache 2.0
+
+package(default_visibility = ["//visibility:public"])
+
+toolchain(
+    name = "cc-toolchain-clang-x86_64-default",
+    exec_compatible_with = [
+        "@bazel_tools//platforms:linux",
+        "@bazel_tools//platforms:x86_64",
+        "@bazel_tools//tools/cpp:clang",
+        "//constraints:xenial",
+    ],
+    target_compatible_with = [
+        "@bazel_tools//platforms:linux",
+        "@bazel_tools//platforms:x86_64",
+    ],
+    toolchain = "//configs/ubuntu16_04_clang/1.0/bazel_0.13.0/default:cc-compiler-k8",
+    toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
+)
+
+
+toolchain(
+    name = "cc-toolchain-clang-x86_64-msan",
+    exec_compatible_with = [
+        "@bazel_tools//platforms:linux",
+        "@bazel_tools//platforms:x86_64",
+        "@bazel_tools//tools/cpp:clang",
+        "//constraints:xenial",
+        "//constraints/sanitizers:support_msan",
+    ],
+    target_compatible_with = [
+        "@bazel_tools//platforms:linux",
+        "@bazel_tools//platforms:x86_64",
+    ],
+    toolchain = "//configs/ubuntu16_04_clang/1.0/bazel_0.13.0/msan:cc-compiler-k8",
+    toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
+)
diff --git a/platforms/experimental/BUILD b/constraints/BUILD
similarity index 64%
rename from platforms/experimental/BUILD
rename to constraints/BUILD
index a286535..5df2572 100644
--- a/platforms/experimental/BUILD
+++ b/constraints/BUILD
@@ -24,19 +24,7 @@
     constraint_setting = ":linux_distribution",
 )
 
-# RBE Debian8
-platform(
-    name = "rbe_debian8",
-    constraint_values = [
-        "@bazel_tools//platforms:x86_64",
-        "@bazel_tools//platforms:linux",
-        "@bazel_tools//tools/cpp:clang",
-        ":jessie",
-    ],
-    remote_execution_properties = """
-          properties: {
-            name: "container-image"
-            value:"docker://gcr.io/cloud-marketplace/google/rbe-debian8@sha256:d84a7de5175a22505209f56b02f1da20ccec64880da09ee38eaef3670fbd2a56"
-         }
-         """,
+constraint_value(
+    name = "xenial",
+    constraint_setting = ":linux_distribution",
 )
diff --git a/constraints/sanitizers/BUILD b/constraints/sanitizers/BUILD
new file mode 100644
index 0000000..bf53292
--- /dev/null
+++ b/constraints/sanitizers/BUILD
@@ -0,0 +1,26 @@
+# Copyright 2017 The Bazel Authors. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+licenses(["notice"])  # Apache 2.0
+
+package(default_visibility = ["//visibility:public"])
+
+# Constraints used to configure sanitizers.
+
+constraint_setting(name = "msan")
+
+constraint_value(
+    name = "support_msan",
+    constraint_setting = ":msan",
+)