Use cpu and os constraints from Bazel platforms repository

https://github.com/bazelbuild/bazel/issues/6516
https://github.com/bazelbuild/bazel/issues/6521

RELNOTES: None.
PiperOrigin-RevId: 253828017
Change-Id: I15f0295e8759357f481984d361977de2deebac13
diff --git a/cpu/BUILD b/cpu/BUILD
index 9cc6547..8b76bff 100644
--- a/cpu/BUILD
+++ b/cpu/BUILD
@@ -10,7 +10,7 @@
     srcs = glob(["**"]),
 )
 
-# These match values in https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/util/CPU.java
+# To add a new constraint_value see https://github.com/bazelbuild/platforms.
 constraint_setting(name = "cpu")
 
 constraint_value(
diff --git a/os/BUILD b/os/BUILD
index 8ea0168..7c40476 100644
--- a/os/BUILD
+++ b/os/BUILD
@@ -10,8 +10,11 @@
     srcs = glob(["**"]),
 )
 
-# These match values in https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/util/OS.java
-constraint_setting(name = "os")
+# To add a new constraint_value see https://github.com/bazelbuild/platforms.
+constraint_setting(
+    name = "os",
+    visibility = ["//visibility:private"],
+)
 
 constraint_value(
     name = "osx",