Merge "Move platform constraints to bazel_common_rules." into main
diff --git a/bazel/configurability.go b/bazel/configurability.go
index a28432c..2c9a536 100644
--- a/bazel/configurability.go
+++ b/bazel/configurability.go
@@ -133,7 +133,7 @@
 	}
 	result := make(map[string]string)
 	for arch, allFeatures := range archFeatures {
-		result[arch] = "//build/bazel/platforms/arch:" + arch
+		result[arch] = "//build/bazel_common_rules/platforms/arch:" + arch
 		// Sometimes we want to select on multiple features being active, so
 		// add the power set of all possible features to the map. More details
 		// in android.ModuleBase.GetArchVariantProperties
@@ -160,33 +160,33 @@
 	// A map of target operating systems to the Bazel label of the
 	// constraint_value for the @platforms//os:os constraint_setting
 	platformOsMap = map[string]string{
-		OsAndroid:                  "//build/bazel/platforms/os:android",
-		OsDarwin:                   "//build/bazel/platforms/os:darwin",
-		OsLinux:                    "//build/bazel/platforms/os:linux_glibc",
-		osLinuxMusl:                "//build/bazel/platforms/os:linux_musl",
-		osLinuxBionic:              "//build/bazel/platforms/os:linux_bionic",
-		OsWindows:                  "//build/bazel/platforms/os:windows",
+		OsAndroid:                  "//build/bazel_common_rules/platforms/os:android",
+		OsDarwin:                   "//build/bazel_common_rules/platforms/os:darwin",
+		OsLinux:                    "//build/bazel_common_rules/platforms/os:linux_glibc",
+		osLinuxMusl:                "//build/bazel_common_rules/platforms/os:linux_musl",
+		osLinuxBionic:              "//build/bazel_common_rules/platforms/os:linux_bionic",
+		OsWindows:                  "//build/bazel_common_rules/platforms/os:windows",
 		ConditionsDefaultConfigKey: ConditionsDefaultSelectKey, // The default condition of an os select map.
 	}
 
 	platformOsArchMap = map[string]string{
-		osArchAndroidArm:           "//build/bazel/platforms/os_arch:android_arm",
-		OsArchAndroidArm64:         "//build/bazel/platforms/os_arch:android_arm64",
-		osArchAndroidRiscv64:       "//build/bazel/platforms/os_arch:android_riscv64",
-		osArchAndroidX86:           "//build/bazel/platforms/os_arch:android_x86",
-		osArchAndroidX86_64:        "//build/bazel/platforms/os_arch:android_x86_64",
-		osArchDarwinArm64:          "//build/bazel/platforms/os_arch:darwin_arm64",
-		osArchDarwinX86_64:         "//build/bazel/platforms/os_arch:darwin_x86_64",
-		osArchLinuxX86:             "//build/bazel/platforms/os_arch:linux_glibc_x86",
-		osArchLinuxX86_64:          "//build/bazel/platforms/os_arch:linux_glibc_x86_64",
-		osArchLinuxMuslArm:         "//build/bazel/platforms/os_arch:linux_musl_arm",
-		osArchLinuxMuslArm64:       "//build/bazel/platforms/os_arch:linux_musl_arm64",
-		osArchLinuxMuslX86:         "//build/bazel/platforms/os_arch:linux_musl_x86",
-		osArchLinuxMuslX86_64:      "//build/bazel/platforms/os_arch:linux_musl_x86_64",
-		osArchLinuxBionicArm64:     "//build/bazel/platforms/os_arch:linux_bionic_arm64",
-		osArchLinuxBionicX86_64:    "//build/bazel/platforms/os_arch:linux_bionic_x86_64",
-		osArchWindowsX86:           "//build/bazel/platforms/os_arch:windows_x86",
-		osArchWindowsX86_64:        "//build/bazel/platforms/os_arch:windows_x86_64",
+		osArchAndroidArm:           "//build/bazel_common_rules/platforms/os_arch:android_arm",
+		OsArchAndroidArm64:         "//build/bazel_common_rules/platforms/os_arch:android_arm64",
+		osArchAndroidRiscv64:       "//build/bazel_common_rules/platforms/os_arch:android_riscv64",
+		osArchAndroidX86:           "//build/bazel_common_rules/platforms/os_arch:android_x86",
+		osArchAndroidX86_64:        "//build/bazel_common_rules/platforms/os_arch:android_x86_64",
+		osArchDarwinArm64:          "//build/bazel_common_rules/platforms/os_arch:darwin_arm64",
+		osArchDarwinX86_64:         "//build/bazel_common_rules/platforms/os_arch:darwin_x86_64",
+		osArchLinuxX86:             "//build/bazel_common_rules/platforms/os_arch:linux_glibc_x86",
+		osArchLinuxX86_64:          "//build/bazel_common_rules/platforms/os_arch:linux_glibc_x86_64",
+		osArchLinuxMuslArm:         "//build/bazel_common_rules/platforms/os_arch:linux_musl_arm",
+		osArchLinuxMuslArm64:       "//build/bazel_common_rules/platforms/os_arch:linux_musl_arm64",
+		osArchLinuxMuslX86:         "//build/bazel_common_rules/platforms/os_arch:linux_musl_x86",
+		osArchLinuxMuslX86_64:      "//build/bazel_common_rules/platforms/os_arch:linux_musl_x86_64",
+		osArchLinuxBionicArm64:     "//build/bazel_common_rules/platforms/os_arch:linux_bionic_arm64",
+		osArchLinuxBionicX86_64:    "//build/bazel_common_rules/platforms/os_arch:linux_bionic_x86_64",
+		osArchWindowsX86:           "//build/bazel_common_rules/platforms/os_arch:windows_x86",
+		osArchWindowsX86_64:        "//build/bazel_common_rules/platforms/os_arch:windows_x86_64",
 		ConditionsDefaultConfigKey: ConditionsDefaultSelectKey, // The default condition of an os select map.
 	}
 
@@ -209,11 +209,11 @@
 		AndroidAndInApex:           "//build/bazel/rules/apex:android-in_apex",
 		AndroidPlatform:            "//build/bazel/rules/apex:system",
 		Unbundled_app:              "//build/bazel/rules/apex:unbundled_app",
-		OsDarwin:                   "//build/bazel/platforms/os:darwin",
-		OsLinux:                    "//build/bazel/platforms/os:linux_glibc",
-		osLinuxMusl:                "//build/bazel/platforms/os:linux_musl",
-		osLinuxBionic:              "//build/bazel/platforms/os:linux_bionic",
-		OsWindows:                  "//build/bazel/platforms/os:windows",
+		OsDarwin:                   "//build/bazel_common_rules/platforms/os:darwin",
+		OsLinux:                    "//build/bazel_common_rules/platforms/os:linux_glibc",
+		osLinuxMusl:                "//build/bazel_common_rules/platforms/os:linux_musl",
+		osLinuxBionic:              "//build/bazel_common_rules/platforms/os:linux_bionic",
+		OsWindows:                  "//build/bazel_common_rules/platforms/os:windows",
 		ConditionsDefaultConfigKey: ConditionsDefaultSelectKey,
 	}
 
diff --git a/bp2build/aar_conversion_test.go b/bp2build/aar_conversion_test.go
index 475c2d6..bdad1f4 100644
--- a/bp2build/aar_conversion_test.go
+++ b/bp2build/aar_conversion_test.go
@@ -69,8 +69,8 @@
 				"TestLib",
 				AttrNameToString{
 					"srcs": `["lib.java"] + select({
-        "//build/bazel/platforms/arch:arm": ["arm.java"],
-        "//build/bazel/platforms/arch:x86": ["x86.java"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["arm.java"],
+        "//build/bazel_common_rules/platforms/arch:x86": ["x86.java"],
         "//conditions:default": [],
     })`,
 					"manifest":       `"manifest/AndroidManifest.xml"`,
diff --git a/bp2build/aconfig_conversion_test.go b/bp2build/aconfig_conversion_test.go
index 9d73ec0..be9a33d 100644
--- a/bp2build/aconfig_conversion_test.go
+++ b/bp2build/aconfig_conversion_test.go
@@ -128,7 +128,7 @@
 			AttrNameToString{
 				"aconfig_declarations":   `":foo_aconfig_declarations"`,
 				"dynamic_deps":           `[":server_configurable_flags"]`,
-				"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 			},
 		)}
 	RunBp2BuildTestCase(t, registerAconfigModuleTypes, Bp2buildTestCase{
@@ -169,7 +169,7 @@
 				"aconfig_declarations":   `":foo_aconfig_declarations"`,
 				"test":                   `True`,
 				"sdk_version":            `"system_current"`,
-				"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 			},
 		)}
 	RunBp2BuildTestCase(t, registerAconfigModuleTypes, Bp2buildTestCase{
@@ -215,7 +215,7 @@
 				"aconfig_declarations":   `":foo_aconfig_declarations"`,
 				"test":                   `True`,
 				"sdk_version":            `"system_current"`,
-				"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 			},
 		),
 		MakeBazelTargetNoRestrictions(
@@ -224,7 +224,7 @@
 			AttrNameToString{
 				"srcs":                   `[":foo_aconfig_library.generated_srcjars"]`,
 				"sdk_version":            `"current"`,
-				"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 			},
 		),
 		MakeNeverlinkDuplicateTarget("java_library", "foo_library"),
diff --git a/bp2build/android_app_conversion_test.go b/bp2build/android_app_conversion_test.go
index afe6dcd..33d1a04 100644
--- a/bp2build/android_app_conversion_test.go
+++ b/bp2build/android_app_conversion_test.go
@@ -167,8 +167,8 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("android_binary", "TestApp", AttrNameToString{
 				"srcs": `select({
-        "//build/bazel/platforms/arch:arm": ["arm.java"],
-        "//build/bazel/platforms/arch:x86": ["x86.java"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["arm.java"],
+        "//build/bazel_common_rules/platforms/arch:x86": ["x86.java"],
         "//conditions:default": [],
     })`,
 				"manifest":       `"AndroidManifest.xml"`,
@@ -508,7 +508,7 @@
 				"manifest":               `"AndroidManifest.xml"`,
 				"resource_files":         `["res/values/attrs.xml"]`,
 				"resource_zips":          `["resource_zip.zip"]`,
-				"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 			}),
 			MakeBazelTargetNoRestrictions("filegroup", "framework-res-package-jar", AttrNameToString{
 				"srcs": `[":framework-res.export-package.apk"]`,
diff --git a/bp2build/apex_conversion_test.go b/bp2build/apex_conversion_test.go
index 5871d59..bdb655b 100644
--- a/bp2build/apex_conversion_test.go
+++ b/bp2build/apex_conversion_test.go
@@ -158,22 +158,22 @@
 				"manifest":        `"apogee_manifest.json"`,
 				"min_sdk_version": `"29"`,
 				"native_shared_libs_32": `select({
-        "//build/bazel/platforms/arch:arm": [
+        "//build/bazel_common_rules/platforms/arch:arm": [
             ":native_shared_lib_1",
             ":native_shared_lib_2",
         ],
-        "//build/bazel/platforms/arch:x86": [
+        "//build/bazel_common_rules/platforms/arch:x86": [
             ":native_shared_lib_1",
             ":native_shared_lib_2",
         ],
         "//conditions:default": [],
     })`,
 				"native_shared_libs_64": `select({
-        "//build/bazel/platforms/arch:arm64": [
+        "//build/bazel_common_rules/platforms/arch:arm64": [
             ":native_shared_lib_1",
             ":native_shared_lib_2",
         ],
-        "//build/bazel/platforms/arch:x86_64": [
+        "//build/bazel_common_rules/platforms/arch:x86_64": [
             ":native_shared_lib_1",
             ":native_shared_lib_2",
         ],
@@ -293,18 +293,18 @@
         ":native_shared_lib_for_both",
         ":native_shared_lib_for_lib32",
     ] + select({
-        "//build/bazel/platforms/arch:arm": [":native_shared_lib_for_first"],
-        "//build/bazel/platforms/arch:x86": [":native_shared_lib_for_first"],
+        "//build/bazel_common_rules/platforms/arch:arm": [":native_shared_lib_for_first"],
+        "//build/bazel_common_rules/platforms/arch:x86": [":native_shared_lib_for_first"],
         "//conditions:default": [],
     })`,
 				"native_shared_libs_64": `select({
-        "//build/bazel/platforms/arch:arm64": [
+        "//build/bazel_common_rules/platforms/arch:arm64": [
             ":unnested_native_shared_lib",
             ":native_shared_lib_for_both",
             ":native_shared_lib_for_lib64",
             ":native_shared_lib_for_first",
         ],
-        "//build/bazel/platforms/arch:x86_64": [
+        "//build/bazel_common_rules/platforms/arch:x86_64": [
             ":unnested_native_shared_lib",
             ":native_shared_lib_for_both",
             ":native_shared_lib_for_lib64",
@@ -322,13 +322,13 @@
 	expectedBazelTargets := []string{
 		MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
 			"native_shared_libs_32": `select({
-        "//build/bazel/platforms/arch:arm": [
+        "//build/bazel_common_rules/platforms/arch:arm": [
             ":unnested_native_shared_lib",
             ":native_shared_lib_for_both",
             ":native_shared_lib_for_lib32",
             ":native_shared_lib_for_first",
         ],
-        "//build/bazel/platforms/arch:x86": [
+        "//build/bazel_common_rules/platforms/arch:x86": [
             ":unnested_native_shared_lib",
             ":native_shared_lib_for_both",
             ":native_shared_lib_for_lib32",
@@ -337,13 +337,13 @@
         "//conditions:default": [],
     })`,
 			"native_shared_libs_64": `select({
-        "//build/bazel/platforms/arch:arm64": [
+        "//build/bazel_common_rules/platforms/arch:arm64": [
             ":unnested_native_shared_lib",
             ":native_shared_lib_for_both",
             ":native_shared_lib_for_lib64",
             ":native_shared_lib_for_first",
         ],
-        "//build/bazel/platforms/arch:x86_64": [
+        "//build/bazel_common_rules/platforms/arch:x86_64": [
             ":unnested_native_shared_lib",
             ":native_shared_lib_for_both",
             ":native_shared_lib_for_lib64",
@@ -405,8 +405,8 @@
         ":native_shared_lib_for_both",
         ":native_shared_lib_for_lib32",
     ] + select({
-        "//build/bazel/platforms/arch:arm": [":native_shared_lib_for_first"],
-        "//build/bazel/platforms/arch:x86": [":native_shared_lib_for_first"],
+        "//build/bazel_common_rules/platforms/arch:arm": [":native_shared_lib_for_first"],
+        "//build/bazel_common_rules/platforms/arch:x86": [":native_shared_lib_for_first"],
         "//conditions:default": [],
     })`,
 				"file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
@@ -433,13 +433,13 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
 				"native_shared_libs_64": `select({
-        "//build/bazel/platforms/arch:arm64": [
+        "//build/bazel_common_rules/platforms/arch:arm64": [
             ":unnested_native_shared_lib",
             ":native_shared_lib_for_both",
             ":native_shared_lib_for_lib64",
             ":native_shared_lib_for_first",
         ],
-        "//build/bazel/platforms/arch:x86_64": [
+        "//build/bazel_common_rules/platforms/arch:x86_64": [
             ":unnested_native_shared_lib",
             ":native_shared_lib_for_both",
             ":native_shared_lib_for_lib64",
@@ -671,22 +671,22 @@
 				"manifest":        `"apogee_manifest.json"`,
 				"min_sdk_version": `"29"`,
 				"native_shared_libs_32": `select({
-        "//build/bazel/platforms/arch:arm": [
+        "//build/bazel_common_rules/platforms/arch:arm": [
             ":native_shared_lib_1",
             ":native_shared_lib_2",
         ],
-        "//build/bazel/platforms/arch:x86": [
+        "//build/bazel_common_rules/platforms/arch:x86": [
             ":native_shared_lib_1",
             ":native_shared_lib_2",
         ],
         "//conditions:default": [],
     })`,
 				"native_shared_libs_64": `select({
-        "//build/bazel/platforms/arch:arm64": [
+        "//build/bazel_common_rules/platforms/arch:arm64": [
             ":native_shared_lib_1",
             ":native_shared_lib_2",
         ],
-        "//build/bazel/platforms/arch:x86_64": [
+        "//build/bazel_common_rules/platforms/arch:x86_64": [
             ":native_shared_lib_1",
             ":native_shared_lib_2",
         ],
@@ -796,13 +796,13 @@
 				"manifest":        `"apogee_manifest.json"`,
 				"min_sdk_version": `"29"`,
 				"native_shared_libs_32": `select({
-        "//build/bazel/platforms/arch:arm": [":native_shared_lib_1"],
-        "//build/bazel/platforms/arch:x86": [":native_shared_lib_1"],
+        "//build/bazel_common_rules/platforms/arch:arm": [":native_shared_lib_1"],
+        "//build/bazel_common_rules/platforms/arch:x86": [":native_shared_lib_1"],
         "//conditions:default": [],
     })`,
 				"native_shared_libs_64": `select({
-        "//build/bazel/platforms/arch:arm64": [":native_shared_lib_1"],
-        "//build/bazel/platforms/arch:x86_64": [":native_shared_lib_1"],
+        "//build/bazel_common_rules/platforms/arch:arm64": [":native_shared_lib_1"],
+        "//build/bazel_common_rules/platforms/arch:x86_64": [":native_shared_lib_1"],
         "//conditions:default": [],
     })`,
 				"testonly":     "True",
@@ -1298,13 +1298,13 @@
 				"manifest":      `"myapex_manifest.json"`,
 				"binaries":      `[":bar"]`,
 				"native_shared_libs_32": `select({
-        "//build/bazel/platforms/arch:arm": [":foo"],
-        "//build/bazel/platforms/arch:x86": [":foo"],
+        "//build/bazel_common_rules/platforms/arch:arm": [":foo"],
+        "//build/bazel_common_rules/platforms/arch:x86": [":foo"],
         "//conditions:default": [],
     })`,
 				"native_shared_libs_64": `select({
-        "//build/bazel/platforms/arch:arm64": [":foo"],
-        "//build/bazel/platforms/arch:x86_64": [":foo"],
+        "//build/bazel_common_rules/platforms/arch:arm64": [":foo"],
+        "//build/bazel_common_rules/platforms/arch:x86_64": [":foo"],
         "//conditions:default": [],
     })`,
 			}),
diff --git a/bp2build/apex_key_conversion_test.go b/bp2build/apex_key_conversion_test.go
index 140afb7..05e2f25 100644
--- a/bp2build/apex_key_conversion_test.go
+++ b/bp2build/apex_key_conversion_test.go
@@ -49,7 +49,7 @@
 		ExpectedBazelTargets: []string{MakeBazelTargetNoRestrictions("apex_key", "com.android.apogee.key", AttrNameToString{
 			"private_key":            `"com.android.apogee.pem"`,
 			"public_key":             `"com.android.apogee.avbpubkey"`,
-			"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+			"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 		}),
 		}})
 }
@@ -72,7 +72,7 @@
 		ExpectedBazelTargets: []string{MakeBazelTargetNoRestrictions("apex_key", "com.android.apogee.key", AttrNameToString{
 			"private_key_name":       `"com.android.apogee.pem"`,
 			"public_key_name":        `"com.android.apogee.avbpubkey"`,
-			"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+			"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 		}),
 		}})
 }
@@ -95,7 +95,7 @@
 		ExpectedBazelTargets: []string{MakeBazelTargetNoRestrictions("apex_key", "com.android.apogee.key", AttrNameToString{
 			"private_key":            `":com.android.apogee.pem"`,
 			"public_key":             `":com.android.apogee.avbpubkey"`,
-			"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+			"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 		}),
 		}})
 }
diff --git a/bp2build/bpf_conversion_test.go b/bp2build/bpf_conversion_test.go
index 1259f9e..26b0bf4 100644
--- a/bp2build/bpf_conversion_test.go
+++ b/bp2build/bpf_conversion_test.go
@@ -58,7 +58,7 @@
         "bpfTestSrcOne.c",
         "bpfTestSrcTwo.c",
     ]`,
-				"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 			}),
 		},
 	})
diff --git a/bp2build/build_conversion_test.go b/bp2build/build_conversion_test.go
index 0a4d749..f809bcc 100644
--- a/bp2build/build_conversion_test.go
+++ b/bp2build/build_conversion_test.go
@@ -270,8 +270,8 @@
 			ExpectedBazelTargets: []string{
 				MakeBazelTarget("custom", "foo", AttrNameToString{
 					"string_literal_prop": `select({
-        "//build/bazel/platforms/arch:arm": "ARM",
-        "//build/bazel/platforms/arch:arm64": "ARM64",
+        "//build/bazel_common_rules/platforms/arch:arm": "ARM",
+        "//build/bazel_common_rules/platforms/arch:arm64": "ARM64",
         "//conditions:default": None,
     })`,
 				}),
@@ -382,60 +382,60 @@
 			ExpectedBazelTargets: []string{
 				MakeBazelTarget("custom", "arch_paths", AttrNameToString{
 					"arch_paths": `select({
-        "//build/bazel/platforms/arch:arm": [
+        "//build/bazel_common_rules/platforms/arch:arm": [
             "arm.txt",
             "lib32.txt",
         ],
-        "//build/bazel/platforms/arch:arm64": [
+        "//build/bazel_common_rules/platforms/arch:arm64": [
             "arm64.txt",
             "lib64.txt",
         ],
-        "//build/bazel/platforms/arch:riscv64": [
+        "//build/bazel_common_rules/platforms/arch:riscv64": [
             "riscv64.txt",
             "lib64.txt",
         ],
-        "//build/bazel/platforms/arch:x86": [
+        "//build/bazel_common_rules/platforms/arch:x86": [
             "x86.txt",
             "lib32.txt",
         ],
-        "//build/bazel/platforms/arch:x86_64": [
+        "//build/bazel_common_rules/platforms/arch:x86_64": [
             "x86_64.txt",
             "lib64.txt",
         ],
         "//conditions:default": [],
     }) + select({
-        "//build/bazel/platforms/os:android": [
+        "//build/bazel_common_rules/platforms/os:android": [
             "linux.txt",
             "bionic.txt",
             "android.txt",
         ],
-        "//build/bazel/platforms/os:darwin": [
+        "//build/bazel_common_rules/platforms/os:darwin": [
             "host.txt",
             "darwin.txt",
             "not_windows.txt",
         ],
-        "//build/bazel/platforms/os:linux_bionic": [
+        "//build/bazel_common_rules/platforms/os:linux_bionic": [
             "host.txt",
             "linux.txt",
             "bionic.txt",
             "linux_bionic.txt",
             "not_windows.txt",
         ],
-        "//build/bazel/platforms/os:linux_glibc": [
+        "//build/bazel_common_rules/platforms/os:linux_glibc": [
             "host.txt",
             "linux.txt",
             "glibc.txt",
             "linux_glibc.txt",
             "not_windows.txt",
         ],
-        "//build/bazel/platforms/os:linux_musl": [
+        "//build/bazel_common_rules/platforms/os:linux_musl": [
             "host.txt",
             "linux.txt",
             "musl.txt",
             "linux_musl.txt",
             "not_windows.txt",
         ],
-        "//build/bazel/platforms/os:windows": [
+        "//build/bazel_common_rules/platforms/os:windows": [
             "host.txt",
             "windows.txt",
         ],
@@ -467,7 +467,7 @@
 				}),
 				MakeBazelTarget("custom", "has_dep", AttrNameToString{
 					"arch_paths": `select({
-        "//build/bazel/platforms/arch:x86": [":dep"],
+        "//build/bazel_common_rules/platforms/arch:x86": [":dep"],
         "//conditions:default": [],
     })`,
 				}),
@@ -1768,8 +1768,8 @@
 			ExpectedBazelTargets: []string{
 				MakeBazelTarget("py_library", "fg_foo", map[string]string{
 					"data": `select({
-        "//build/bazel/platforms/arch:arm": [":reqdarm"],
-        "//build/bazel/platforms/arch:x86": [":reqdx86"],
+        "//build/bazel_common_rules/platforms/arch:arm": [":reqdarm"],
+        "//build/bazel_common_rules/platforms/arch:x86": [":reqdx86"],
         "//conditions:default": [],
     })`,
 					"srcs_version": `"PY3"`,
diff --git a/bp2build/cc_binary_conversion_test.go b/bp2build/cc_binary_conversion_test.go
index c679703..2857a91 100644
--- a/bp2build/cc_binary_conversion_test.go
+++ b/bp2build/cc_binary_conversion_test.go
@@ -618,13 +618,13 @@
 			{"cc_library_static", "bar_bp2build_cc_library_static", AttrNameToString{
 				"local_includes":         `["."]`,
 				"srcs":                   `["b.cc"]`,
-				"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 			},
 			},
 			{"cc_library_shared", "bar", AttrNameToString{
 				"local_includes":         `["."]`,
 				"srcs":                   `["b.cc"]`,
-				"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 			},
 			},
 			{"cc_binary", "foo", AttrNameToString{
@@ -653,7 +653,7 @@
 		targets: []testBazelTarget{
 			{"cc_binary", "foo", AttrNameToString{
 				"features": `select({
-        "//build/bazel/platforms/arch:arm": ["arm_isa_arm"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["arm_isa_arm"],
         "//conditions:default": [],
     })`,
 				"local_includes": `["."]`,
@@ -713,8 +713,8 @@
 			{"cc_binary", "foo", AttrNameToString{
 				"local_includes": `["."]`,
 				"suffix": `select({
-        "//build/bazel/platforms/arch:arm": "-32",
-        "//build/bazel/platforms/arch:arm64": "-64",
+        "//build/bazel_common_rules/platforms/arch:arm": "-32",
+        "//build/bazel_common_rules/platforms/arch:arm64": "-64",
         "//conditions:default": None,
     })`,
 			}},
@@ -775,7 +775,7 @@
 		targets: []testBazelTarget{
 			{"sysprop_library", "foo_sysprop_library", AttrNameToString{
 				"srcs": `select({
-        "//build/bazel/platforms/os:android": ["bar.sysprop"],
+        "//build/bazel_common_rules/platforms/os:android": ["bar.sysprop"],
         "//conditions:default": [],
     })`,
 			}},
@@ -788,7 +788,7 @@
 				"local_includes":  `["."]`,
 				"min_sdk_version": `"5"`,
 				"whole_archive_deps": `select({
-        "//build/bazel/platforms/os:android": [":foo_cc_sysprop_library_static"],
+        "//build/bazel_common_rules/platforms/os:android": [":foo_cc_sysprop_library_static"],
         "//conditions:default": [],
     })`,
 			}},
@@ -866,8 +866,8 @@
         "ubsan_undefined",
         "ubsan_nullability",
     ] + select({
-        "//build/bazel/platforms/os:android": ["ubsan_alignment"],
-        "//build/bazel/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
+        "//build/bazel_common_rules/platforms/os:android": ["ubsan_alignment"],
+        "//build/bazel_common_rules/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
         "//conditions:default": [],
     })`,
 			}},
@@ -964,11 +964,11 @@
 			{"cc_binary", "foo", AttrNameToString{
 				"local_includes": `["."]`,
 				"features": `select({
-        "//build/bazel/platforms/os_arch:android_arm": ["android_thin_lto"],
-        "//build/bazel/platforms/os_arch:android_arm64": ["android_thin_lto"],
-        "//build/bazel/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
-        "//build/bazel/platforms/os_arch:android_x86": ["android_thin_lto"],
-        "//build/bazel/platforms/os_arch:android_x86_64": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_arm": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_x86": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_x86_64": ["android_thin_lto"],
         "//conditions:default": [],
     })`,
 			}},
@@ -998,7 +998,7 @@
 			{"cc_binary", "foo", AttrNameToString{
 				"local_includes": `["."]`,
 				"features": `select({
-        "//build/bazel/platforms/os:android": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os:android": ["android_thin_lto"],
         "//conditions:default": ["-android_thin_lto"],
     })`,
 			}},
@@ -1062,7 +1062,7 @@
 			{"cc_binary", "foo", AttrNameToString{
 				"local_includes": `["."]`,
 				"features": `select({
-        "//build/bazel/platforms/os:android": ["visibility_hidden"],
+        "//build/bazel_common_rules/platforms/os:android": ["visibility_hidden"],
         "//conditions:default": [],
     })`,
 			}},
@@ -1106,7 +1106,7 @@
 		targets: []testBazelTarget{
 			{"cc_binary", "foo", AttrNameToString{
 				"features": `select({
-        "//build/bazel/platforms/os:android": ["android_cfi"],
+        "//build/bazel_common_rules/platforms/os:android": ["android_cfi"],
         "//conditions:default": [],
     })`,
 				"local_includes": `["."]`,
@@ -1187,8 +1187,8 @@
 			}},
 			{"cc_binary", "foo_with_arch_variant_stem", AttrNameToString{
 				"stem": `select({
-        "//build/bazel/platforms/arch:arm": "foo-arm",
-        "//build/bazel/platforms/arch:arm64": "foo-arm64",
+        "//build/bazel_common_rules/platforms/arch:arm": "foo-arm",
+        "//build/bazel_common_rules/platforms/arch:arm64": "foo-arm64",
         "//conditions:default": None,
     })`,
 				"local_includes": `["."]`,
diff --git a/bp2build/cc_library_conversion_test.go b/bp2build/cc_library_conversion_test.go
index d198596..188c81b 100644
--- a/bp2build/cc_library_conversion_test.go
+++ b/bp2build/cc_library_conversion_test.go
@@ -137,22 +137,22 @@
 			"export_includes":     `["foo-dir"]`,
 			"implementation_deps": `[":some-headers"]`,
 			"linkopts": `["-Wl,--exclude-libs=bar.a"] + select({
-        "//build/bazel/platforms/arch:x86": ["-Wl,--exclude-libs=baz.a"],
-        "//build/bazel/platforms/arch:x86_64": ["-Wl,--exclude-libs=qux.a"],
+        "//build/bazel_common_rules/platforms/arch:x86": ["-Wl,--exclude-libs=baz.a"],
+        "//build/bazel_common_rules/platforms/arch:x86_64": ["-Wl,--exclude-libs=qux.a"],
         "//conditions:default": [],
     })`,
 			"srcs": `["impl.cpp"] + select({
-        "//build/bazel/platforms/arch:x86": ["x86.cpp"],
-        "//build/bazel/platforms/arch:x86_64": ["x86_64.cpp"],
+        "//build/bazel_common_rules/platforms/arch:x86": ["x86.cpp"],
+        "//build/bazel_common_rules/platforms/arch:x86_64": ["x86_64.cpp"],
         "//conditions:default": [],
     }) + select({
-        "//build/bazel/platforms/os:android": [
+        "//build/bazel_common_rules/platforms/os:android": [
             "bionic.cpp",
             "android.cpp",
         ],
-        "//build/bazel/platforms/os:darwin": ["darwin.cpp"],
-        "//build/bazel/platforms/os:linux_bionic": ["bionic.cpp"],
-        "//build/bazel/platforms/os:linux_glibc": ["linux.cpp"],
+        "//build/bazel_common_rules/platforms/os:darwin": ["darwin.cpp"],
+        "//build/bazel_common_rules/platforms/os:linux_bionic": ["bionic.cpp"],
+        "//build/bazel_common_rules/platforms/os:linux_glibc": ["linux.cpp"],
         "//conditions:default": [],
     })`,
 			"sdk_version":        `"current"`,
@@ -228,8 +228,8 @@
         "-Wl,--exclude-libs=libclang_rt.builtins-i686-android.a",
         "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
     ] + select({
-        "//build/bazel/platforms/arch:x86": ["-Wl,--exclude-libs=libgcc_eh.a"],
-        "//build/bazel/platforms/arch:x86_64": ["-Wl,--exclude-libs=libgcc_eh.a"],
+        "//build/bazel_common_rules/platforms/arch:x86": ["-Wl,--exclude-libs=libgcc_eh.a"],
+        "//build/bazel_common_rules/platforms/arch:x86_64": ["-Wl,--exclude-libs=libgcc_eh.a"],
         "//conditions:default": [],
     })`,
 		}),
@@ -278,7 +278,7 @@
 		Blueprint: soongCcLibraryPreamble,
 		ExpectedBazelTargets: makeCcLibraryTargets("fake-libarm-optimized-routines-math", AttrNameToString{
 			"copts": `select({
-        "//build/bazel/platforms/arch:arm64": ["-DHAVE_FAST_FMA=1"],
+        "//build/bazel_common_rules/platforms/arch:arm64": ["-DHAVE_FAST_FMA=1"],
         "//conditions:default": [],
     })`,
 			"local_includes": `["."]`,
@@ -688,14 +688,14 @@
         "bothflag",
         "staticflag",
     ] + select({
-        "//build/bazel/platforms/arch:x86": ["-DX86_STATIC"],
+        "//build/bazel_common_rules/platforms/arch:x86": ["-DX86_STATIC"],
         "//conditions:default": [],
     })`,
 				"implementation_deps": `[
         ":static_dep_for_both",
         ":static_dep_for_static",
     ] + select({
-        "//build/bazel/platforms/arch:x86": [":x86_dep_for_static"],
+        "//build/bazel_common_rules/platforms/arch:x86": [":x86_dep_for_static"],
         "//conditions:default": [],
     })`,
 				"local_includes": `["."]`,
@@ -703,7 +703,7 @@
         "both.cpp",
         "staticonly.cpp",
     ] + select({
-        "//build/bazel/platforms/arch:x86": ["x86_static.cpp"],
+        "//build/bazel_common_rules/platforms/arch:x86": ["x86_static.cpp"],
         "//conditions:default": [],
     })`,
 			}),
@@ -712,27 +712,27 @@
         "bothflag",
         "sharedflag",
     ] + select({
-        "//build/bazel/platforms/arch:arm": ["-DARM_SHARED"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["-DARM_SHARED"],
         "//conditions:default": [],
     }) + select({
-        "//build/bazel/platforms/os:android": ["-DANDROID_SHARED"],
+        "//build/bazel_common_rules/platforms/os:android": ["-DANDROID_SHARED"],
         "//conditions:default": [],
     }) + select({
-        "//build/bazel/platforms/os_arch:android_arm": ["-DANDROID_ARM_SHARED"],
+        "//build/bazel_common_rules/platforms/os_arch:android_arm": ["-DANDROID_ARM_SHARED"],
         "//conditions:default": [],
     })`,
 				"implementation_deps": `[
         ":static_dep_for_both",
         ":static_dep_for_shared",
     ] + select({
-        "//build/bazel/platforms/arch:arm": [":arm_static_dep_for_shared"],
+        "//build/bazel_common_rules/platforms/arch:arm": [":arm_static_dep_for_shared"],
         "//conditions:default": [],
     }) + select({
-        "//build/bazel/platforms/os:android": [":android_dep_for_shared"],
+        "//build/bazel_common_rules/platforms/os:android": [":android_dep_for_shared"],
         "//conditions:default": [],
     })`,
 				"implementation_dynamic_deps": `select({
-        "//build/bazel/platforms/arch:arm": [":arm_shared_dep_for_shared"],
+        "//build/bazel_common_rules/platforms/arch:arm": [":arm_shared_dep_for_shared"],
         "//conditions:default": [],
     })`,
 				"local_includes": `["."]`,
@@ -740,14 +740,14 @@
         "both.cpp",
         "sharedonly.cpp",
     ] + select({
-        "//build/bazel/platforms/arch:arm": ["arm_shared.cpp"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["arm_shared.cpp"],
         "//conditions:default": [],
     }) + select({
-        "//build/bazel/platforms/os:android": ["android_shared.cpp"],
+        "//build/bazel_common_rules/platforms/os:android": ["android_shared.cpp"],
         "//conditions:default": [],
     })`,
 				"whole_archive_deps": `select({
-        "//build/bazel/platforms/arch:arm": [":arm_whole_static_dep_for_shared"],
+        "//build/bazel_common_rules/platforms/arch:arm": [":arm_whole_static_dep_for_shared"],
         "//conditions:default": [],
     })`,
 			}),
@@ -954,22 +954,22 @@
 		Blueprint: soongCcLibraryPreamble,
 		ExpectedBazelTargets: makeCcLibraryTargets("a", AttrNameToString{
 			"additional_linker_inputs": `select({
-        "//build/bazel/platforms/arch:arm": [
+        "//build/bazel_common_rules/platforms/arch:arm": [
             "arm.map",
             "dynamic_arm.list",
         ],
-        "//build/bazel/platforms/arch:arm64": [
+        "//build/bazel_common_rules/platforms/arch:arm64": [
             "arm64.map",
             "dynamic_arm64.list",
         ],
         "//conditions:default": [],
     })`,
 			"linkopts": `select({
-        "//build/bazel/platforms/arch:arm": [
+        "//build/bazel_common_rules/platforms/arch:arm": [
             "-Wl,--version-script,$(location arm.map)",
             "-Wl,--dynamic-list,$(location dynamic_arm.list)",
         ],
-        "//build/bazel/platforms/arch:arm64": [
+        "//build/bazel_common_rules/platforms/arch:arm64": [
             "-Wl,--version-script,$(location arm64.map)",
             "-Wl,--dynamic-list,$(location dynamic_arm64.list)",
         ],
@@ -977,8 +977,8 @@
     })`,
 			"srcs": `["a.cpp"]`,
 			"features": `select({
-        "//build/bazel/platforms/arch:arm": ["android_cfi_exports_map"],
-        "//build/bazel/platforms/arch:arm64": ["android_cfi_exports_map"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["android_cfi_exports_map"],
+        "//build/bazel_common_rules/platforms/arch:arm64": ["android_cfi_exports_map"],
         "//conditions:default": [],
     })`,
 		}),
@@ -1065,7 +1065,7 @@
 	})...)
 	expected_targets = append(expected_targets, makeCcLibraryTargets("b", AttrNameToString{
 		"features": `select({
-        "//build/bazel/platforms/arch:x86_64": [
+        "//build/bazel_common_rules/platforms/arch:x86_64": [
             "disable_pack_relocations",
             "-no_undefined_symbols",
         ],
@@ -1076,7 +1076,7 @@
 	})...)
 	expected_targets = append(expected_targets, makeCcLibraryTargets("c", AttrNameToString{
 		"features": `select({
-        "//build/bazel/platforms/os:darwin": [
+        "//build/bazel_common_rules/platforms/os:darwin": [
             "disable_pack_relocations",
             "-no_undefined_symbols",
         ],
@@ -1181,10 +1181,10 @@
         "-fsigned-char",
         "-pedantic",
     ] + select({
-        "//build/bazel/platforms/arch:arm64": ["-DARM64=1"],
+        "//build/bazel_common_rules/platforms/arch:arm64": ["-DARM64=1"],
         "//conditions:default": [],
     }) + select({
-        "//build/bazel/platforms/os:android": ["-DANDROID=1"],
+        "//build/bazel_common_rules/platforms/os:android": ["-DANDROID=1"],
         "//conditions:default": [],
     })`,
 			"srcs": `["a.cpp"]`,
@@ -1271,14 +1271,14 @@
 `,
 		ExpectedBazelTargets: makeCcLibraryTargets("foo_static", AttrNameToString{
 			"implementation_deps": `select({
-        "//build/bazel/platforms/arch:arm": [],
+        "//build/bazel_common_rules/platforms/arch:arm": [],
         "//conditions:default": [":arm_static_lib_excludes_bp2build_cc_library_static"],
     }) + select({
         "//build/bazel/product_config/config_settings:malloc_not_svelte": [],
         "//conditions:default": [":malloc_not_svelte_static_lib_excludes_bp2build_cc_library_static"],
     })`,
 			"implementation_dynamic_deps": `select({
-        "//build/bazel/platforms/arch:arm": [],
+        "//build/bazel_common_rules/platforms/arch:arm": [],
         "//conditions:default": [":arm_shared_lib_excludes"],
     }) + select({
         "//build/bazel/product_config/config_settings:malloc_not_svelte": [":malloc_not_svelte_shared_lib"],
@@ -1286,7 +1286,7 @@
     })`,
 			"srcs_c": `["common.c"]`,
 			"whole_archive_deps": `select({
-        "//build/bazel/platforms/arch:arm": [],
+        "//build/bazel_common_rules/platforms/arch:arm": [],
         "//conditions:default": [":arm_whole_static_lib_excludes_bp2build_cc_library_static"],
     }) + select({
         "//build/bazel/product_config/config_settings:malloc_not_svelte": [":malloc_not_svelte_whole_static_lib_bp2build_cc_library_static"],
@@ -1325,7 +1325,7 @@
         "//conditions:default": [],
     })`,
 			"srcs_c":                 `["common.c"]`,
-			"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+			"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 		}),
 	},
 	)
@@ -1402,7 +1402,7 @@
 `,
 		ExpectedBazelTargets: makeCcLibraryTargets("foo-lib", AttrNameToString{
 			"features": `select({
-        "//build/bazel/platforms/arch:arm": ["-link_crt"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["-link_crt"],
         "//conditions:default": [],
     })`,
 			"srcs": `["impl.cpp"]`,
@@ -1506,8 +1506,8 @@
 		ExpectedBazelTargets: makeCcLibraryTargets("foo-lib", AttrNameToString{
 			"srcs": `["impl.cpp"]`,
 			"features": `select({
-        "//build/bazel/platforms/arch:arm": ["-use_libcrt"],
-        "//build/bazel/platforms/arch:x86": ["-use_libcrt"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["-use_libcrt"],
+        "//build/bazel_common_rules/platforms/arch:x86": ["-use_libcrt"],
         "//conditions:default": [],
     })`,
 		}),
@@ -1543,11 +1543,11 @@
 `,
 		ExpectedBazelTargets: makeCcLibraryTargets("foo-lib", AttrNameToString{
 			"features": `select({
-        "//build/bazel/platforms/arch:arm": ["-use_libcrt"],
-        "//build/bazel/platforms/arch:x86": ["-use_libcrt"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["-use_libcrt"],
+        "//build/bazel_common_rules/platforms/arch:x86": ["-use_libcrt"],
         "//conditions:default": [],
     }) + select({
-        "//build/bazel/platforms/os:darwin": ["-use_libcrt"],
+        "//build/bazel_common_rules/platforms/os:darwin": ["-use_libcrt"],
         "//conditions:default": [],
     })`,
 			"srcs": `["impl.cpp"]`,
@@ -1586,8 +1586,8 @@
 		ExpectedBazelTargets: makeCcLibraryTargets("foo-lib", AttrNameToString{
 			"srcs": `["impl.cpp"]`,
 			"features": `select({
-        "//build/bazel/platforms/arch:arm": ["-use_libcrt"],
-        "//build/bazel/platforms/arch:x86_64": ["-use_libcrt"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["-use_libcrt"],
+        "//build/bazel_common_rules/platforms/arch:x86_64": ["-use_libcrt"],
         "//conditions:default": [],
     })`,
 		}),
@@ -1705,15 +1705,15 @@
 		ExpectedBazelTargets: makeCcLibraryTargets("multi-arch", AttrNameToString{
 			"strip": `{
         "keep_symbols": select({
-            "//build/bazel/platforms/arch:arm64": True,
+            "//build/bazel_common_rules/platforms/arch:arm64": True,
             "//conditions:default": None,
         }),
         "keep_symbols_and_debug_frame": select({
-            "//build/bazel/platforms/arch:arm": True,
+            "//build/bazel_common_rules/platforms/arch:arm": True,
             "//conditions:default": None,
         }),
         "keep_symbols_list": select({
-            "//build/bazel/platforms/os:darwin": [
+            "//build/bazel_common_rules/platforms/os:darwin": [
                 "foo",
                 "bar",
             ],
@@ -1844,7 +1844,7 @@
 `,
 		ExpectedBazelTargets: makeCcLibraryTargets("target_linux_bionic_empty", AttrNameToString{
 			"system_dynamic_deps": `select({
-        "//build/bazel/platforms/os:linux_musl": [":libc_musl"],
+        "//build/bazel_common_rules/platforms/os:linux_musl": [":libc_musl"],
         "//conditions:default": [],
     })`,
 		}),
@@ -1875,7 +1875,7 @@
 `,
 		ExpectedBazelTargets: makeCcLibraryTargets("target_bionic_empty", AttrNameToString{
 			"system_dynamic_deps": `select({
-        "//build/bazel/platforms/os:linux_musl": [":libc_musl"],
+        "//build/bazel_common_rules/platforms/os:linux_musl": [":libc_musl"],
         "//conditions:default": [],
     })`,
 		}),
@@ -2011,25 +2011,25 @@
 `,
 		ExpectedBazelTargets: makeCcLibraryTargets("foo-lib", AttrNameToString{
 			"srcs": `["base.cpp"] + select({
-        "//build/bazel/platforms/os:android": [
+        "//build/bazel_common_rules/platforms/os:android": [
             "linux.cpp",
             "bionic.cpp",
             "android.cpp",
         ],
-        "//build/bazel/platforms/os:darwin": ["darwin.cpp"],
-        "//build/bazel/platforms/os:linux_bionic": [
+        "//build/bazel_common_rules/platforms/os:darwin": ["darwin.cpp"],
+        "//build/bazel_common_rules/platforms/os:linux_bionic": [
             "linux.cpp",
             "bionic.cpp",
         ],
-        "//build/bazel/platforms/os:linux_glibc": [
+        "//build/bazel_common_rules/platforms/os:linux_glibc": [
             "linux.cpp",
             "linux_glibc.cpp",
         ],
-        "//build/bazel/platforms/os:linux_musl": [
+        "//build/bazel_common_rules/platforms/os:linux_musl": [
             "linux.cpp",
             "linux_musl.cpp",
         ],
-        "//build/bazel/platforms/os:windows": ["windows.cpp"],
+        "//build/bazel_common_rules/platforms/os:windows": ["windows.cpp"],
         "//conditions:default": [],
     })`,
 		}),
@@ -2056,7 +2056,7 @@
 `,
 		ExpectedBazelTargets: makeCcLibraryTargets("libcrypto", AttrNameToString{
 			"inject_bssl_hash": `select({
-        "//build/bazel/platforms/os:android": True,
+        "//build/bazel_common_rules/platforms/os:android": True,
         "//conditions:default": None,
     })`,
 		}),
@@ -2697,11 +2697,11 @@
 		ExpectedBazelTargets: makeCcLibraryTargets("foo", AttrNameToString{
 			"srcs": `["foo.cpp"]`,
 			"target_compatible_with": `select({
-        "//build/bazel/platforms/os_arch:darwin_arm64": ["@platforms//:incompatible"],
-        "//build/bazel/platforms/os_arch:darwin_x86_64": ["@platforms//:incompatible"],
-        "//build/bazel/platforms/os_arch:linux_glibc_x86": ["@platforms//:incompatible"],
-        "//build/bazel/platforms/os_arch:windows_x86": ["@platforms//:incompatible"],
-        "//build/bazel/platforms/os_arch:windows_x86_64": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os_arch:darwin_arm64": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os_arch:darwin_x86_64": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os_arch:linux_glibc_x86": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os_arch:windows_x86": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os_arch:windows_x86_64": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 		}),
@@ -2733,8 +2733,8 @@
 		ExpectedBazelTargets: makeCcLibraryTargets("foo", AttrNameToString{
 			"srcs": `["foo.cpp"]`,
 			"target_compatible_with": `select({
-        "//build/bazel/platforms/os_arch:darwin_arm64": [],
-        "//build/bazel/platforms/os_arch:darwin_x86_64": [],
+        "//build/bazel_common_rules/platforms/os_arch:darwin_arm64": [],
+        "//build/bazel_common_rules/platforms/os_arch:darwin_x86_64": [],
         "//conditions:default": ["@platforms//:incompatible"],
     })`,
 		}),
@@ -2767,7 +2767,7 @@
 		}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
 			"srcs": `["foo.cpp"]`,
 			"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 		}),
@@ -2804,15 +2804,15 @@
 		ExpectedBazelTargets: []string{MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
 			"srcs": `["foo.cpp"]`,
 			"target_compatible_with": `select({
-        "//build/bazel/platforms/os:windows": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:windows": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 		}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
 			"srcs": `["foo.cpp"]`,
 			"target_compatible_with": `select({
-        "//build/bazel/platforms/os_arch:darwin_arm64": [],
-        "//build/bazel/platforms/os_arch:darwin_x86_64": [],
-        "//build/bazel/platforms/os_arch:linux_glibc_x86": [],
+        "//build/bazel_common_rules/platforms/os_arch:darwin_arm64": [],
+        "//build/bazel_common_rules/platforms/os_arch:darwin_x86_64": [],
+        "//build/bazel_common_rules/platforms/os_arch:linux_glibc_x86": [],
         "//conditions:default": ["@platforms//:incompatible"],
     })`,
 		}),
@@ -2923,22 +2923,22 @@
 }`,
 		ExpectedBazelTargets: makeCcLibraryTargets("foolib", AttrNameToString{
 			"implementation_dynamic_deps": `select({
-        "//build/bazel/platforms/os:darwin": [":bazlib"],
-        "//build/bazel/platforms/os:linux_bionic": [":bazlib"],
-        "//build/bazel/platforms/os:linux_glibc": [":bazlib"],
-        "//build/bazel/platforms/os:linux_musl": [":bazlib"],
-        "//build/bazel/platforms/os:windows": [":bazlib"],
+        "//build/bazel_common_rules/platforms/os:darwin": [":bazlib"],
+        "//build/bazel_common_rules/platforms/os:linux_bionic": [":bazlib"],
+        "//build/bazel_common_rules/platforms/os:linux_glibc": [":bazlib"],
+        "//build/bazel_common_rules/platforms/os:linux_musl": [":bazlib"],
+        "//build/bazel_common_rules/platforms/os:windows": [":bazlib"],
         "//conditions:default": [],
     }) + select({
-        "//build/bazel/platforms/os:darwin": [":quxlib"],
-        "//build/bazel/platforms/os:linux_bionic": [":quxlib"],
-        "//build/bazel/platforms/os:linux_glibc": [":quxlib"],
-        "//build/bazel/platforms/os:linux_musl": [":quxlib"],
-        "//build/bazel/platforms/os:windows": [":quxlib"],
         "//build/bazel/rules/apex:foo": [
             "@api_surfaces//module-libapi/current:barlib",
             "@api_surfaces//module-libapi/current:quxlib",
         ],
+        "//build/bazel_common_rules/platforms/os:darwin": [":quxlib"],
+        "//build/bazel_common_rules/platforms/os:linux_bionic": [":quxlib"],
+        "//build/bazel_common_rules/platforms/os:linux_glibc": [":quxlib"],
+        "//build/bazel_common_rules/platforms/os:linux_musl": [":quxlib"],
+        "//build/bazel_common_rules/platforms/os:windows": [":quxlib"],
         "//conditions:default": [
             ":barlib",
             ":quxlib",
@@ -3053,7 +3053,7 @@
 `,
 		ExpectedBazelTargets: makeCcLibraryTargets("foo", AttrNameToString{
 			"features": `select({
-        "//build/bazel/platforms/arch:arm": ["arm_isa_arm"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["arm_isa_arm"],
         "//conditions:default": [],
     })`,
 			"local_includes": `["."]`,
@@ -3137,8 +3137,8 @@
 			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
 				"srcs_c": `["foo.c"]`,
 				"suffix": `select({
-        "//build/bazel/platforms/arch:arm": "-32",
-        "//build/bazel/platforms/arch:arm64": "-64",
+        "//build/bazel_common_rules/platforms/arch:arm": "-32",
+        "//build/bazel_common_rules/platforms/arch:arm64": "-64",
         "//conditions:default": None,
     })`,
 			}),
@@ -3503,7 +3503,7 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTargetNoRestrictions("sysprop_library", "foo_sysprop_library", AttrNameToString{
 				"srcs": `select({
-        "//build/bazel/platforms/os:android": ["bar.sysprop"],
+        "//build/bazel_common_rules/platforms/os:android": ["bar.sysprop"],
         "//conditions:default": [],
     })`,
 			}),
@@ -3516,7 +3516,7 @@
 				"local_includes":  `["."]`,
 				"min_sdk_version": `"5"`,
 				"whole_archive_deps": `select({
-        "//build/bazel/platforms/os:android": [":foo_cc_sysprop_library_static"],
+        "//build/bazel_common_rules/platforms/os:android": [":foo_cc_sysprop_library_static"],
         "//conditions:default": [],
     })`,
 			}),
@@ -3525,7 +3525,7 @@
 				"local_includes":  `["."]`,
 				"min_sdk_version": `"5"`,
 				"whole_archive_deps": `select({
-        "//build/bazel/platforms/os:android": [":foo_cc_sysprop_library_static"],
+        "//build/bazel_common_rules/platforms/os:android": [":foo_cc_sysprop_library_static"],
         "//conditions:default": [],
     })`,
 			}),
@@ -3861,39 +3861,39 @@
 `,
 		ExpectedBazelTargets: makeCcLibraryTargets("a", AttrNameToString{
 			"export_includes": `select({
-        "//build/bazel/platforms/os_arch:android_arm": [
+        "//build/bazel_common_rules/platforms/os_arch:android_arm": [
             "android_arm_eid1",
             "android_arm_eid2",
         ],
         "//conditions:default": [],
     }) + select({
-        "//build/bazel/platforms/os:android": [
+        "//build/bazel_common_rules/platforms/os:android": [
             "android_eid1",
             "android_eid2",
             "linux_eid1",
             "linux_eid2",
         ],
-        "//build/bazel/platforms/os:linux_bionic": [
+        "//build/bazel_common_rules/platforms/os:linux_bionic": [
             "linux_eid1",
             "linux_eid2",
         ],
-        "//build/bazel/platforms/os:linux_glibc": [
+        "//build/bazel_common_rules/platforms/os:linux_glibc": [
             "linux_eid1",
             "linux_eid2",
         ],
-        "//build/bazel/platforms/os:linux_musl": [
+        "//build/bazel_common_rules/platforms/os:linux_musl": [
             "linux_eid1",
             "linux_eid2",
         ],
         "//conditions:default": [],
     }) + select({
-        "//build/bazel/platforms/arch:arm": [
+        "//build/bazel_common_rules/platforms/arch:arm": [
             "lib32_eid1",
             "lib32_eid2",
             "arm_eid1",
             "arm_eid2",
         ],
-        "//build/bazel/platforms/arch:x86": [
+        "//build/bazel_common_rules/platforms/arch:x86": [
             "lib32_eid1",
             "lib32_eid2",
         ],
@@ -3903,39 +3903,39 @@
         "eid2",
     ]`,
 			"export_system_includes": `select({
-        "//build/bazel/platforms/os_arch:android_arm": [
+        "//build/bazel_common_rules/platforms/os_arch:android_arm": [
             "android_arm_esid1",
             "android_arm_esid2",
         ],
         "//conditions:default": [],
     }) + select({
-        "//build/bazel/platforms/os:android": [
+        "//build/bazel_common_rules/platforms/os:android": [
             "android_esid1",
             "android_esid2",
             "linux_esid1",
             "linux_esid2",
         ],
-        "//build/bazel/platforms/os:linux_bionic": [
+        "//build/bazel_common_rules/platforms/os:linux_bionic": [
             "linux_esid1",
             "linux_esid2",
         ],
-        "//build/bazel/platforms/os:linux_glibc": [
+        "//build/bazel_common_rules/platforms/os:linux_glibc": [
             "linux_esid1",
             "linux_esid2",
         ],
-        "//build/bazel/platforms/os:linux_musl": [
+        "//build/bazel_common_rules/platforms/os:linux_musl": [
             "linux_esid1",
             "linux_esid2",
         ],
         "//conditions:default": [],
     }) + select({
-        "//build/bazel/platforms/arch:arm": [
+        "//build/bazel_common_rules/platforms/arch:arm": [
             "lib32_esid1",
             "lib32_esid2",
             "arm_esid1",
             "arm_esid2",
         ],
-        "//build/bazel/platforms/arch:x86": [
+        "//build/bazel_common_rules/platforms/arch:x86": [
             "lib32_esid1",
             "lib32_esid2",
         ],
@@ -3946,7 +3946,7 @@
     ]`,
 			"srcs":                   `["a.cpp"]`,
 			"local_includes":         `["."]`,
-			"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+			"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 		}),
 	},
 	)
@@ -4081,8 +4081,8 @@
         "ubsan_undefined",
         "ubsan_nullability",
     ] + select({
-        "//build/bazel/platforms/os:android": ["ubsan_alignment"],
-        "//build/bazel/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
+        "//build/bazel_common_rules/platforms/os:android": ["ubsan_alignment"],
+        "//build/bazel_common_rules/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
         "//conditions:default": [],
     })`,
 				"local_includes": `["."]`,
@@ -4092,8 +4092,8 @@
         "ubsan_undefined",
         "ubsan_nullability",
     ] + select({
-        "//build/bazel/platforms/os:android": ["ubsan_alignment"],
-        "//build/bazel/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
+        "//build/bazel_common_rules/platforms/os:android": ["ubsan_alignment"],
+        "//build/bazel_common_rules/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
         "//conditions:default": [],
     })`,
 				"local_includes": `["."]`,
@@ -4221,21 +4221,21 @@
 			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
 				"local_includes": `["."]`,
 				"features": `select({
-        "//build/bazel/platforms/os_arch:android_arm": ["android_thin_lto"],
-        "//build/bazel/platforms/os_arch:android_arm64": ["android_thin_lto"],
-        "//build/bazel/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
-        "//build/bazel/platforms/os_arch:android_x86": ["android_thin_lto"],
-        "//build/bazel/platforms/os_arch:android_x86_64": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_arm": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_x86": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_x86_64": ["android_thin_lto"],
         "//conditions:default": [],
     })`}),
 			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
 				"local_includes": `["."]`,
 				"features": `select({
-        "//build/bazel/platforms/os_arch:android_arm": ["android_thin_lto"],
-        "//build/bazel/platforms/os_arch:android_arm64": ["android_thin_lto"],
-        "//build/bazel/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
-        "//build/bazel/platforms/os_arch:android_x86": ["android_thin_lto"],
-        "//build/bazel/platforms/os_arch:android_x86_64": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_arm": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_x86": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_x86_64": ["android_thin_lto"],
         "//conditions:default": [],
     })`}),
 		},
@@ -4266,14 +4266,14 @@
 			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
 				"local_includes": `["."]`,
 				"features": `select({
-        "//build/bazel/platforms/os:android": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os:android": ["android_thin_lto"],
         "//conditions:default": ["-android_thin_lto"],
     })`,
 			}),
 			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
 				"local_includes": `["."]`,
 				"features": `select({
-        "//build/bazel/platforms/os:android": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os:android": ["android_thin_lto"],
         "//conditions:default": ["-android_thin_lto"],
     })`,
 			}),
@@ -4401,14 +4401,14 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
 				"features": `select({
-        "//build/bazel/platforms/os:android": ["visibility_hidden"],
+        "//build/bazel_common_rules/platforms/os:android": ["visibility_hidden"],
         "//conditions:default": [],
     })`,
 				"local_includes": `["."]`,
 			}),
 			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
 				"features": `select({
-        "//build/bazel/platforms/os:android": ["visibility_hidden"],
+        "//build/bazel_common_rules/platforms/os:android": ["visibility_hidden"],
         "//conditions:default": [],
     })`,
 				"local_includes": `["."]`,
@@ -4440,7 +4440,7 @@
 					"flag_values": `{
         "//build/bazel/rules/apex:api_domain": "myapex",
     }`,
-					"constraint_values": `["//build/bazel/platforms/os:android"]`,
+					"constraint_values": `["//build/bazel_common_rules/platforms/os:android"]`,
 				},
 			),
 		},
@@ -4574,12 +4574,12 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTargetNoRestrictions("cc_binary", "a", AttrNameToString{
 				"linkopts": `["-lcommon"] + select({
-        "//build/bazel/platforms/os:darwin": [
+        "//build/bazel_common_rules/platforms/os:darwin": [
             "-ldarwinadditional",
             "-ldarwin",
         ],
-        "//build/bazel/platforms/os:linux_glibc": ["-llinux"],
-        "//build/bazel/platforms/os:windows": ["-lwindows"],
+        "//build/bazel_common_rules/platforms/os:linux_glibc": ["-llinux"],
+        "//build/bazel_common_rules/platforms/os:windows": ["-lwindows"],
         "//conditions:default": [],
     })`,
 				"local_includes": `["."]`,
@@ -4632,14 +4632,14 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
 				"features": `select({
-        "//build/bazel/platforms/os:android": ["android_cfi"],
+        "//build/bazel_common_rules/platforms/os:android": ["android_cfi"],
         "//conditions:default": [],
     })`,
 				"local_includes": `["."]`,
 			}),
 			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
 				"features": `select({
-        "//build/bazel/platforms/os:android": ["android_cfi"],
+        "//build/bazel_common_rules/platforms/os:android": ["android_cfi"],
         "//conditions:default": [],
     })`,
 				"local_includes": `["."]`,
@@ -4737,8 +4737,8 @@
 			}),
 			MakeBazelTarget("cc_library_shared", "foo_with_arch_variant_stem", AttrNameToString{
 				"stem": `select({
-        "//build/bazel/platforms/arch:arm": "foo-arm",
-        "//build/bazel/platforms/arch:arm64": "foo-arm64",
+        "//build/bazel_common_rules/platforms/arch:arm": "foo-arm",
+        "//build/bazel_common_rules/platforms/arch:arm64": "foo-arm64",
         "//conditions:default": None,
     })`,
 				"local_includes": `["."]`,
@@ -5122,35 +5122,35 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTargetNoRestrictions("cc_library_shared", "lib32", AttrNameToString{
 				"local_includes": `["."]`,
-				"target_compatible_with": `["//build/bazel/platforms/os:android"] + select({
-        "//build/bazel/platforms/arch:arm64": ["@platforms//:incompatible"],
-        "//build/bazel/platforms/arch:riscv64": ["@platforms//:incompatible"],
-        "//build/bazel/platforms/arch:x86_64": ["@platforms//:incompatible"],
+				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"] + select({
+        "//build/bazel_common_rules/platforms/arch:arm64": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/arch:riscv64": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/arch:x86_64": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
 			MakeBazelTargetNoRestrictions("cc_library_static", "lib32_bp2build_cc_library_static", AttrNameToString{
 				"local_includes": `["."]`,
-				"target_compatible_with": `["//build/bazel/platforms/os:android"] + select({
-        "//build/bazel/platforms/arch:arm64": ["@platforms//:incompatible"],
-        "//build/bazel/platforms/arch:riscv64": ["@platforms//:incompatible"],
-        "//build/bazel/platforms/arch:x86_64": ["@platforms//:incompatible"],
+				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"] + select({
+        "//build/bazel_common_rules/platforms/arch:arm64": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/arch:riscv64": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/arch:x86_64": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
 			MakeBazelTargetNoRestrictions("cc_library_shared", "lib64", AttrNameToString{
 				"local_includes": `["."]`,
-				"target_compatible_with": `["//build/bazel/platforms/os:android"] + select({
-        "//build/bazel/platforms/arch:arm": ["@platforms//:incompatible"],
-        "//build/bazel/platforms/arch:x86": ["@platforms//:incompatible"],
+				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"] + select({
+        "//build/bazel_common_rules/platforms/arch:arm": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/arch:x86": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
 			MakeBazelTargetNoRestrictions("cc_library_static", "lib64_bp2build_cc_library_static", AttrNameToString{
 				"local_includes": `["."]`,
-				"target_compatible_with": `["//build/bazel/platforms/os:android"] + select({
-        "//build/bazel/platforms/arch:arm": ["@platforms//:incompatible"],
-        "//build/bazel/platforms/arch:x86": ["@platforms//:incompatible"],
+				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"] + select({
+        "//build/bazel_common_rules/platforms/arch:arm": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/arch:x86": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
diff --git a/bp2build/cc_library_headers_conversion_test.go b/bp2build/cc_library_headers_conversion_test.go
index 5168fe9..7655986 100644
--- a/bp2build/cc_library_headers_conversion_test.go
+++ b/bp2build/cc_library_headers_conversion_test.go
@@ -103,9 +103,9 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
 				"export_includes": `select({
-        "//build/bazel/platforms/arch:arm64": ["arch_arm64_exported_include_dir"],
-        "//build/bazel/platforms/arch:x86": ["arch_x86_exported_include_dir"],
-        "//build/bazel/platforms/arch:x86_64": ["arch_x86_64_exported_include_dir"],
+        "//build/bazel_common_rules/platforms/arch:arm64": ["arch_arm64_exported_include_dir"],
+        "//build/bazel_common_rules/platforms/arch:x86": ["arch_x86_exported_include_dir"],
+        "//build/bazel_common_rules/platforms/arch:x86_64": ["arch_x86_64_exported_include_dir"],
         "//conditions:default": [],
     }) + [
         "dir-1",
@@ -180,11 +180,11 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
 				"deps": `select({
-        "//build/bazel/platforms/os:android": [":android-lib"],
-        "//build/bazel/platforms/os:darwin": [":darwin-lib"],
-        "//build/bazel/platforms/os:linux_bionic": [":linux_bionic-lib"],
-        "//build/bazel/platforms/os:linux_glibc": [":linux-lib"],
-        "//build/bazel/platforms/os:windows": [":windows-lib"],
+        "//build/bazel_common_rules/platforms/os:android": [":android-lib"],
+        "//build/bazel_common_rules/platforms/os:darwin": [":darwin-lib"],
+        "//build/bazel_common_rules/platforms/os:linux_bionic": [":linux_bionic-lib"],
+        "//build/bazel_common_rules/platforms/os:linux_glibc": [":linux-lib"],
+        "//build/bazel_common_rules/platforms/os:windows": [":windows-lib"],
         "//conditions:default": [],
     }) + [":base-lib"]`,
 			}),
@@ -217,7 +217,7 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
 				"deps": `select({
-        "//build/bazel/platforms/os:android": [":exported-lib"],
+        "//build/bazel_common_rules/platforms/os:android": [":exported-lib"],
         "//conditions:default": [],
     })`,
 			}),
@@ -268,13 +268,13 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
 				"export_system_includes": `select({
-        "//build/bazel/platforms/os:android": ["android_include_dir"],
-        "//build/bazel/platforms/os:darwin": ["darwin_include_dir"],
-        "//build/bazel/platforms/os:linux_glibc": ["linux_include_dir"],
+        "//build/bazel_common_rules/platforms/os:android": ["android_include_dir"],
+        "//build/bazel_common_rules/platforms/os:darwin": ["darwin_include_dir"],
+        "//build/bazel_common_rules/platforms/os:linux_glibc": ["linux_include_dir"],
         "//conditions:default": [],
     }) + select({
-        "//build/bazel/platforms/arch:arm": ["arm_include_dir"],
-        "//build/bazel/platforms/arch:x86_64": ["x86_64_include_dir"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["arm_include_dir"],
+        "//build/bazel_common_rules/platforms/arch:x86_64": ["x86_64_include_dir"],
         "//conditions:default": [],
     }) + ["shared_include_dir"]`,
 			}),
diff --git a/bp2build/cc_library_shared_conversion_test.go b/bp2build/cc_library_shared_conversion_test.go
index 2c5305f..9f9fcf9 100644
--- a/bp2build/cc_library_shared_conversion_test.go
+++ b/bp2build/cc_library_shared_conversion_test.go
@@ -204,11 +204,11 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
 				"implementation_dynamic_deps": `select({
-        "//build/bazel/platforms/arch:arm64": [":shared_dep"],
+        "//build/bazel_common_rules/platforms/arch:arm64": [":shared_dep"],
         "//conditions:default": [],
     })`,
 				"whole_archive_deps": `select({
-        "//build/bazel/platforms/arch:arm64": [":static_dep"],
+        "//build/bazel_common_rules/platforms/arch:arm64": [":static_dep"],
         "//conditions:default": [],
     })`,
 			}),
@@ -233,7 +233,7 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
 				"implementation_dynamic_deps": `select({
-        "//build/bazel/platforms/os:android": [":shared_dep"],
+        "//build/bazel_common_rules/platforms/os:android": [":shared_dep"],
         "//conditions:default": [],
     })`,
 			}),
@@ -266,10 +266,10 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
 				"implementation_dynamic_deps": `[":shared_dep"] + select({
-        "//build/bazel/platforms/arch:arm64": [":shared_dep3"],
+        "//build/bazel_common_rules/platforms/arch:arm64": [":shared_dep3"],
         "//conditions:default": [],
     }) + select({
-        "//build/bazel/platforms/os:android": [":shared_dep2"],
+        "//build/bazel_common_rules/platforms/os:android": [":shared_dep2"],
         "//conditions:default": [],
     })`,
 			}),
@@ -472,7 +472,7 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
 				"features": `select({
-        "//build/bazel/platforms/arch:arm": ["-link_crt"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["-link_crt"],
         "//conditions:default": [],
     })`,
 				"srcs": `["impl.cpp"]`,
@@ -1006,8 +1006,8 @@
 			MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
 				"srcs_c": `["foo.c"]`,
 				"suffix": `select({
-        "//build/bazel/platforms/arch:arm": "-32",
-        "//build/bazel/platforms/arch:arm64": "-64",
+        "//build/bazel_common_rules/platforms/arch:arm": "-32",
+        "//build/bazel_common_rules/platforms/arch:arm64": "-64",
         "//conditions:default": None,
     })`,
 			}),
@@ -1068,7 +1068,7 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("sysprop_library", "foo_sysprop_library", AttrNameToString{
 				"srcs": `select({
-        "//build/bazel/platforms/os:android": ["bar.sysprop"],
+        "//build/bazel_common_rules/platforms/os:android": ["bar.sysprop"],
         "//conditions:default": [],
     })`,
 			}),
@@ -1081,7 +1081,7 @@
 				"local_includes":  `["."]`,
 				"min_sdk_version": `"5"`,
 				"whole_archive_deps": `select({
-        "//build/bazel/platforms/os:android": [":foo_cc_sysprop_library_static"],
+        "//build/bazel_common_rules/platforms/os:android": [":foo_cc_sysprop_library_static"],
         "//conditions:default": [],
     })`,
 			}),
@@ -1201,8 +1201,8 @@
         "ubsan_undefined",
         "ubsan_nullability",
     ] + select({
-        "//build/bazel/platforms/os:android": ["ubsan_alignment"],
-        "//build/bazel/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
+        "//build/bazel_common_rules/platforms/os:android": ["ubsan_alignment"],
+        "//build/bazel_common_rules/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
         "//conditions:default": [],
     })`,
 				"local_includes": `["."]`,
@@ -1303,11 +1303,11 @@
 			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
 				"local_includes": `["."]`,
 				"features": `select({
-        "//build/bazel/platforms/os_arch:android_arm": ["android_thin_lto"],
-        "//build/bazel/platforms/os_arch:android_arm64": ["android_thin_lto"],
-        "//build/bazel/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
-        "//build/bazel/platforms/os_arch:android_x86": ["android_thin_lto"],
-        "//build/bazel/platforms/os_arch:android_x86_64": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_arm": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_x86": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_x86_64": ["android_thin_lto"],
         "//conditions:default": [],
     })`}),
 		},
@@ -1336,7 +1336,7 @@
 			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
 				"local_includes": `["."]`,
 				"features": `select({
-        "//build/bazel/platforms/os:android": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os:android": ["android_thin_lto"],
         "//conditions:default": ["-android_thin_lto"],
     })`,
 			}),
@@ -1400,7 +1400,7 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
 				"features": `select({
-        "//build/bazel/platforms/os:android": ["visibility_hidden"],
+        "//build/bazel_common_rules/platforms/os:android": ["visibility_hidden"],
         "//conditions:default": [],
     })`,
 				"local_includes": `["."]`,
@@ -1510,7 +1510,7 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
 				"features": `select({
-        "//build/bazel/platforms/os:android": ["android_cfi"],
+        "//build/bazel_common_rules/platforms/os:android": ["android_cfi"],
         "//conditions:default": [],
     })`,
 				"local_includes": `["."]`,
diff --git a/bp2build/cc_library_static_conversion_test.go b/bp2build/cc_library_static_conversion_test.go
index 09e40ed..d7bbd68 100644
--- a/bp2build/cc_library_static_conversion_test.go
+++ b/bp2build/cc_library_static_conversion_test.go
@@ -410,11 +410,11 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
 				"implementation_deps": `select({
-        "//build/bazel/platforms/arch:arm64": [":static_dep"],
+        "//build/bazel_common_rules/platforms/arch:arm64": [":static_dep"],
         "//conditions:default": [],
     })`,
 				"whole_archive_deps": `select({
-        "//build/bazel/platforms/arch:arm64": [":static_dep2"],
+        "//build/bazel_common_rules/platforms/arch:arm64": [":static_dep2"],
         "//conditions:default": [],
     })`,
 			}),
@@ -442,11 +442,11 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
 				"implementation_deps": `select({
-        "//build/bazel/platforms/os:android": [":static_dep"],
+        "//build/bazel_common_rules/platforms/os:android": [":static_dep"],
         "//conditions:default": [],
     })`,
 				"whole_archive_deps": `select({
-        "//build/bazel/platforms/os:android": [":static_dep2"],
+        "//build/bazel_common_rules/platforms/os:android": [":static_dep2"],
         "//conditions:default": [],
     })`,
 			}),
@@ -484,10 +484,10 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
 				"implementation_deps": `[":static_dep"] + select({
-        "//build/bazel/platforms/arch:arm64": [":static_dep4"],
+        "//build/bazel_common_rules/platforms/arch:arm64": [":static_dep4"],
         "//conditions:default": [],
     }) + select({
-        "//build/bazel/platforms/os:android": [":static_dep3"],
+        "//build/bazel_common_rules/platforms/os:android": [":static_dep3"],
         "//conditions:default": [],
     })`,
 				"whole_archive_deps": `[":static_dep2"]`,
@@ -539,7 +539,7 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
 				"srcs_c": `["common.c"] + select({
-        "//build/bazel/platforms/arch:arm": ["foo-arm.c"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["foo-arm.c"],
         "//conditions:default": [],
     })`,
 			}),
@@ -569,7 +569,7 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
 				"srcs_c": `["common.c"] + select({
-        "//build/bazel/platforms/arch:arm": ["for-arm.c"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["for-arm.c"],
         "//conditions:default": ["not-for-arm.c"],
     })`,
 			}),
@@ -601,11 +601,11 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
 				"srcs_c": `["common.c"] + select({
-        "//build/bazel/platforms/arch:arm": [
+        "//build/bazel_common_rules/platforms/arch:arm": [
             "not-for-x86.c",
             "for-arm.c",
         ],
-        "//build/bazel/platforms/arch:x86": [
+        "//build/bazel_common_rules/platforms/arch:x86": [
             "not-for-arm.c",
             "for-x86.c",
         ],
@@ -650,25 +650,25 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
 				"srcs_c": `["common.c"] + select({
-        "//build/bazel/platforms/arch:arm": [
+        "//build/bazel_common_rules/platforms/arch:arm": [
             "not-for-arm64.c",
             "not-for-x86.c",
             "not-for-x86_64.c",
             "for-arm.c",
         ],
-        "//build/bazel/platforms/arch:arm64": [
+        "//build/bazel_common_rules/platforms/arch:arm64": [
             "not-for-arm.c",
             "not-for-x86.c",
             "not-for-x86_64.c",
             "for-arm64.c",
         ],
-        "//build/bazel/platforms/arch:x86": [
+        "//build/bazel_common_rules/platforms/arch:x86": [
             "not-for-arm.c",
             "not-for-arm64.c",
             "not-for-x86_64.c",
             "for-x86.c",
         ],
-        "//build/bazel/platforms/arch:x86_64": [
+        "//build/bazel_common_rules/platforms/arch:x86_64": [
             "not-for-arm.c",
             "not-for-arm64.c",
             "not-for-x86.c",
@@ -707,7 +707,7 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
 				"srcs": `["common.cc"] + select({
-        "//build/bazel/platforms/arch:arm": [],
+        "//build/bazel_common_rules/platforms/arch:arm": [],
         "//conditions:default": ["foo-no-arm.cc"],
     })`,
 			}),
@@ -738,8 +738,8 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
 				"srcs": `["common.cc"] + select({
-        "//build/bazel/platforms/arch:arm": [],
-        "//build/bazel/platforms/arch:x86": [
+        "//build/bazel_common_rules/platforms/arch:arm": [],
+        "//build/bazel_common_rules/platforms/arch:x86": [
             "foo-no-arm.cc",
             "x86-only.cc",
         ],
@@ -792,8 +792,8 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
 				"srcs_c": `["common.c"] + select({
-        "//build/bazel/platforms/arch:arm": ["for-lib32.c"],
-        "//build/bazel/platforms/arch:x86": ["for-lib32.c"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["for-lib32.c"],
+        "//build/bazel_common_rules/platforms/arch:x86": ["for-lib32.c"],
         "//conditions:default": ["not-for-lib32.c"],
     })`,
 			}),
@@ -824,23 +824,23 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
 				"srcs_c": `["common.c"] + select({
-        "//build/bazel/platforms/arch:arm": [
+        "//build/bazel_common_rules/platforms/arch:arm": [
             "not-for-lib64.c",
             "for-lib32.c",
         ],
-        "//build/bazel/platforms/arch:arm64": [
+        "//build/bazel_common_rules/platforms/arch:arm64": [
             "not-for-lib32.c",
             "for-lib64.c",
         ],
-        "//build/bazel/platforms/arch:riscv64": [
+        "//build/bazel_common_rules/platforms/arch:riscv64": [
             "not-for-lib32.c",
             "for-lib64.c",
         ],
-        "//build/bazel/platforms/arch:x86": [
+        "//build/bazel_common_rules/platforms/arch:x86": [
             "not-for-lib64.c",
             "for-lib32.c",
         ],
-        "//build/bazel/platforms/arch:x86_64": [
+        "//build/bazel_common_rules/platforms/arch:x86_64": [
             "not-for-lib32.c",
             "for-lib64.c",
         ],
@@ -895,7 +895,7 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
 				"srcs_c": `["common.c"] + select({
-        "//build/bazel/platforms/arch:arm": [
+        "//build/bazel_common_rules/platforms/arch:arm": [
             "not-for-arm64.c",
             "not-for-lib64.c",
             "not-for-riscv64.c",
@@ -904,7 +904,7 @@
             "for-arm.c",
             "for-lib32.c",
         ],
-        "//build/bazel/platforms/arch:arm64": [
+        "//build/bazel_common_rules/platforms/arch:arm64": [
             "not-for-arm.c",
             "not-for-lib32.c",
             "not-for-riscv64.c",
@@ -913,7 +913,7 @@
             "for-arm64.c",
             "for-lib64.c",
         ],
-        "//build/bazel/platforms/arch:riscv64": [
+        "//build/bazel_common_rules/platforms/arch:riscv64": [
             "not-for-arm.c",
             "not-for-arm64.c",
             "not-for-lib32.c",
@@ -922,7 +922,7 @@
             "for-riscv64.c",
             "for-lib64.c",
         ],
-        "//build/bazel/platforms/arch:x86": [
+        "//build/bazel_common_rules/platforms/arch:x86": [
             "not-for-arm.c",
             "not-for-arm64.c",
             "not-for-lib64.c",
@@ -931,7 +931,7 @@
             "for-x86.c",
             "for-lib32.c",
         ],
-        "//build/bazel/platforms/arch:x86_64": [
+        "//build/bazel_common_rules/platforms/arch:x86_64": [
             "not-for-arm.c",
             "not-for-arm64.c",
             "not-for-lib32.c",
@@ -1089,20 +1089,20 @@
         "//dep:generated_src_other_pkg",
         ":generated_hdr",
     ] + select({
-        "//build/bazel/platforms/arch:x86": ["for-x86.cpp"],
+        "//build/bazel_common_rules/platforms/arch:x86": ["for-x86.cpp"],
         "//conditions:default": [
             "not-for-x86.cpp",
             ":generated_src_not_x86",
         ],
     }) + select({
-        "//build/bazel/platforms/os:android": [":generated_src_android"],
+        "//build/bazel_common_rules/platforms/os:android": [":generated_src_android"],
         "//conditions:default": [],
     })`,
 				"hdrs": `select({
-        "//build/bazel/platforms/os:android": ["//dep:generated_hdr_other_pkg_android"],
+        "//build/bazel_common_rules/platforms/os:android": ["//dep:generated_hdr_other_pkg_android"],
         "//conditions:default": [],
     }) + select({
-        "//build/bazel/platforms/arch:x86": ["//dep:generated_hdr_other_pkg_x86"],
+        "//build/bazel_common_rules/platforms/arch:x86": ["//dep:generated_hdr_other_pkg_x86"],
         "//conditions:default": [],
     }) + ["//dep:generated_hdr_other_pkg"]`,
 				"local_includes":           `["."]`,
@@ -1147,15 +1147,15 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
 				"srcs_c": `select({
-        "//build/bazel/platforms/os:android": ["android_src.c"],
+        "//build/bazel_common_rules/platforms/os:android": ["android_src.c"],
         "//conditions:default": [],
     }) + select({
-        "//build/bazel/platforms/os_arch:android_arm": ["android_arm_src.c"],
-        "//build/bazel/platforms/os_arch:android_arm64": ["android_arm64_src.c"],
-        "//build/bazel/platforms/os_arch:android_x86": ["android_x86_src.c"],
-        "//build/bazel/platforms/os_arch:android_x86_64": ["android_x86_64_src.c"],
-        "//build/bazel/platforms/os_arch:linux_bionic_arm64": ["linux_bionic_arm64_src.c"],
-        "//build/bazel/platforms/os_arch:linux_bionic_x86_64": ["linux_bionic_x86_64_src.c"],
+        "//build/bazel_common_rules/platforms/os_arch:android_arm": ["android_arm_src.c"],
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": ["android_arm64_src.c"],
+        "//build/bazel_common_rules/platforms/os_arch:android_x86": ["android_x86_src.c"],
+        "//build/bazel_common_rules/platforms/os_arch:android_x86_64": ["android_x86_64_src.c"],
+        "//build/bazel_common_rules/platforms/os_arch:linux_bionic_arm64": ["linux_bionic_arm64_src.c"],
+        "//build/bazel_common_rules/platforms/os_arch:linux_bionic_x86_64": ["linux_bionic_x86_64_src.c"],
         "//conditions:default": [],
     })`,
 			}),
@@ -1358,7 +1358,7 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_static", "target_bionic_empty", AttrNameToString{
 				"system_dynamic_deps": `select({
-        "//build/bazel/platforms/os:linux_musl": [":libc_musl"],
+        "//build/bazel_common_rules/platforms/os:linux_musl": [":libc_musl"],
         "//conditions:default": [],
     })`,
 			}),
@@ -1392,7 +1392,7 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_static", "target_linux_bionic_empty", AttrNameToString{
 				"system_dynamic_deps": `select({
-        "//build/bazel/platforms/os:linux_musl": [":libc_musl"],
+        "//build/bazel_common_rules/platforms/os:linux_musl": [":libc_musl"],
         "//conditions:default": [],
     })`,
 			}),
@@ -1477,9 +1477,9 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_static", "target_bionic", AttrNameToString{
 				"system_dynamic_deps": `select({
-        "//build/bazel/platforms/os:android": [":libc"],
-        "//build/bazel/platforms/os:linux_bionic": [":libc"],
-        "//build/bazel/platforms/os:linux_musl": [":libc_musl"],
+        "//build/bazel_common_rules/platforms/os:android": [":libc"],
+        "//build/bazel_common_rules/platforms/os:linux_bionic": [":libc"],
+        "//build/bazel_common_rules/platforms/os:linux_musl": [":libc_musl"],
         "//conditions:default": [],
     })`,
 			}),
@@ -1512,8 +1512,8 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_static", "target_linux_bionic", AttrNameToString{
 				"system_dynamic_deps": `[":libc"] + select({
-        "//build/bazel/platforms/os:linux_bionic": [":libm"],
-        "//build/bazel/platforms/os:linux_musl": [":libc_musl"],
+        "//build/bazel_common_rules/platforms/os:linux_bionic": [":libm"],
+        "//build/bazel_common_rules/platforms/os:linux_musl": [":libc_musl"],
         "//conditions:default": [],
     })`,
 			}),
@@ -1837,7 +1837,7 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("sysprop_library", "foo_sysprop_library", AttrNameToString{
 				"srcs": `select({
-        "//build/bazel/platforms/os:android": ["bar.sysprop"],
+        "//build/bazel_common_rules/platforms/os:android": ["bar.sysprop"],
         "//conditions:default": [],
     })`,
 			}),
@@ -1850,7 +1850,7 @@
 				"local_includes":  `["."]`,
 				"min_sdk_version": `"5"`,
 				"whole_archive_deps": `select({
-        "//build/bazel/platforms/os:android": [":foo_cc_sysprop_library_static"],
+        "//build/bazel_common_rules/platforms/os:android": [":foo_cc_sysprop_library_static"],
         "//conditions:default": [],
     })`,
 			}),
@@ -1930,8 +1930,8 @@
         "ubsan_undefined",
         "ubsan_nullability",
     ] + select({
-        "//build/bazel/platforms/os:android": ["ubsan_alignment"],
-        "//build/bazel/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
+        "//build/bazel_common_rules/platforms/os:android": ["ubsan_alignment"],
+        "//build/bazel_common_rules/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
         "//conditions:default": [],
     })`,
 				"local_includes": `["."]`,
@@ -2032,11 +2032,11 @@
 			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
 				"local_includes": `["."]`,
 				"features": `select({
-        "//build/bazel/platforms/os_arch:android_arm": ["android_thin_lto"],
-        "//build/bazel/platforms/os_arch:android_arm64": ["android_thin_lto"],
-        "//build/bazel/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
-        "//build/bazel/platforms/os_arch:android_x86": ["android_thin_lto"],
-        "//build/bazel/platforms/os_arch:android_x86_64": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_arm": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_x86": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os_arch:android_x86_64": ["android_thin_lto"],
         "//conditions:default": [],
     })`}),
 		},
@@ -2065,7 +2065,7 @@
 			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
 				"local_includes": `["."]`,
 				"features": `select({
-        "//build/bazel/platforms/os:android": ["android_thin_lto"],
+        "//build/bazel_common_rules/platforms/os:android": ["android_thin_lto"],
         "//conditions:default": ["-android_thin_lto"],
     })`,
 			}),
@@ -2129,7 +2129,7 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
 				"features": `select({
-        "//build/bazel/platforms/os:android": ["visibility_hidden"],
+        "//build/bazel_common_rules/platforms/os:android": ["visibility_hidden"],
         "//conditions:default": [],
     })`,
 				"local_includes": `["."]`,
@@ -2174,7 +2174,7 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
 				"features": `select({
-        "//build/bazel/platforms/os:android": ["android_cfi"],
+        "//build/bazel_common_rules/platforms/os:android": ["android_cfi"],
         "//conditions:default": [],
     })`,
 				"local_includes": `["."]`,
diff --git a/bp2build/cc_object_conversion_test.go b/bp2build/cc_object_conversion_test.go
index e1e2f43..4d44db7 100644
--- a/bp2build/cc_object_conversion_test.go
+++ b/bp2build/cc_object_conversion_test.go
@@ -232,11 +232,11 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_object", "foo", AttrNameToString{
 				"copts": `["-fno-addrsig"] + select({
-        "//build/bazel/platforms/arch:x86": ["-fPIC"],
+        "//build/bazel_common_rules/platforms/arch:x86": ["-fPIC"],
         "//conditions:default": [],
     })`,
 				"srcs": `["a.cpp"] + select({
-        "//build/bazel/platforms/arch:arm": ["arch/arm/file.cpp"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["arch/arm/file.cpp"],
         "//conditions:default": [],
     })`,
 				"system_dynamic_deps": `[]`,
@@ -276,17 +276,17 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_object", "foo", AttrNameToString{
 				"copts": `["-fno-addrsig"] + select({
-        "//build/bazel/platforms/arch:arm": ["-Wall"],
-        "//build/bazel/platforms/arch:arm64": ["-Wall"],
-        "//build/bazel/platforms/arch:x86": ["-fPIC"],
-        "//build/bazel/platforms/arch:x86_64": ["-fPIC"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["-Wall"],
+        "//build/bazel_common_rules/platforms/arch:arm64": ["-Wall"],
+        "//build/bazel_common_rules/platforms/arch:x86": ["-fPIC"],
+        "//build/bazel_common_rules/platforms/arch:x86_64": ["-fPIC"],
         "//conditions:default": [],
     })`,
 				"srcs": `["base.cpp"] + select({
-        "//build/bazel/platforms/arch:arm": ["arm.cpp"],
-        "//build/bazel/platforms/arch:arm64": ["arm64.cpp"],
-        "//build/bazel/platforms/arch:x86": ["x86.cpp"],
-        "//build/bazel/platforms/arch:x86_64": ["x86_64.cpp"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["arm.cpp"],
+        "//build/bazel_common_rules/platforms/arch:arm64": ["arm64.cpp"],
+        "//build/bazel_common_rules/platforms/arch:x86": ["x86.cpp"],
+        "//build/bazel_common_rules/platforms/arch:x86_64": ["x86_64.cpp"],
         "//conditions:default": [],
     })`,
 				"system_dynamic_deps": `[]`,
@@ -364,15 +364,15 @@
 			MakeBazelTarget("cc_object", "foo", AttrNameToString{
 				"copts": `["-fno-addrsig"]`,
 				"objs": `select({
-        "//build/bazel/platforms/arch:arm": [":arm_obj"],
-        "//build/bazel/platforms/arch:x86": [":x86_obj"],
-        "//build/bazel/platforms/arch:x86_64": [":x86_64_obj"],
+        "//build/bazel_common_rules/platforms/arch:arm": [":arm_obj"],
+        "//build/bazel_common_rules/platforms/arch:x86": [":x86_obj"],
+        "//build/bazel_common_rules/platforms/arch:x86_64": [":x86_64_obj"],
         "//conditions:default": [],
     })`,
 				"linker_script": `select({
-        "//build/bazel/platforms/arch:arm": "arm.lds",
-        "//build/bazel/platforms/arch:x86": "x86.lds",
-        "//build/bazel/platforms/arch:x86_64": "x86_64.lds",
+        "//build/bazel_common_rules/platforms/arch:arm": "arm.lds",
+        "//build/bazel_common_rules/platforms/arch:x86": "x86.lds",
+        "//build/bazel_common_rules/platforms/arch:x86_64": "x86_64.lds",
         "//conditions:default": None,
     })`,
 				"srcs": `["base.cpp"]`,
@@ -405,18 +405,18 @@
 			MakeBazelTarget("cc_object", "foo", AttrNameToString{
 				"copts": `["-fno-addrsig"]`,
 				"srcs": `["base.cpp"] + select({
-        "//build/bazel/platforms/os_arch:android_arm64": [
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
             "linux_arm64.cpp",
             "bionic_arm64.cpp",
         ],
-        "//build/bazel/platforms/os_arch:android_x86": ["linux_x86.cpp"],
-        "//build/bazel/platforms/os_arch:linux_bionic_arm64": [
+        "//build/bazel_common_rules/platforms/os_arch:android_x86": ["linux_x86.cpp"],
+        "//build/bazel_common_rules/platforms/os_arch:linux_bionic_arm64": [
             "linux_arm64.cpp",
             "bionic_arm64.cpp",
         ],
-        "//build/bazel/platforms/os_arch:linux_glibc_x86": ["linux_x86.cpp"],
-        "//build/bazel/platforms/os_arch:linux_musl_arm64": ["linux_arm64.cpp"],
-        "//build/bazel/platforms/os_arch:linux_musl_x86": ["linux_x86.cpp"],
+        "//build/bazel_common_rules/platforms/os_arch:linux_glibc_x86": ["linux_x86.cpp"],
+        "//build/bazel_common_rules/platforms/os_arch:linux_musl_arm64": ["linux_arm64.cpp"],
+        "//build/bazel_common_rules/platforms/os_arch:linux_musl_x86": ["linux_x86.cpp"],
         "//conditions:default": [],
     })`,
 			}),
diff --git a/bp2build/cc_prebuilt_binary_conversion_test.go b/bp2build/cc_prebuilt_binary_conversion_test.go
index 0e8048c..9adaf32 100644
--- a/bp2build/cc_prebuilt_binary_conversion_test.go
+++ b/bp2build/cc_prebuilt_binary_conversion_test.go
@@ -95,8 +95,8 @@
 }`, ExpectedBazelTargets: []string{
 				MakeBazelTarget("cc_prebuilt_binary", "bintest", AttrNameToString{
 					"src": `select({
-        "//build/bazel/platforms/arch:arm": "binb",
-        "//build/bazel/platforms/arch:arm64": "bina",
+        "//build/bazel_common_rules/platforms/arch:arm": "binb",
+        "//build/bazel_common_rules/platforms/arch:arm64": "bina",
         "//conditions:default": None,
     })`,
 				}),
diff --git a/bp2build/cc_prebuilt_library_conversion_test.go b/bp2build/cc_prebuilt_library_conversion_test.go
index 8c33be3..a7f0c7b 100644
--- a/bp2build/cc_prebuilt_library_conversion_test.go
+++ b/bp2build/cc_prebuilt_library_conversion_test.go
@@ -76,21 +76,21 @@
 			ExpectedBazelTargets: []string{
 				MakeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static", AttrNameToString{
 					"static_library": `select({
-        "//build/bazel/platforms/arch:arm": "libg.so",
-        "//build/bazel/platforms/arch:arm64": "libf.so",
+        "//build/bazel_common_rules/platforms/arch:arm": "libg.so",
+        "//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
         "//conditions:default": None,
     })`}),
 				MakeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static_alwayslink", AttrNameToString{
 					"alwayslink": "True",
 					"static_library": `select({
-        "//build/bazel/platforms/arch:arm": "libg.so",
-        "//build/bazel/platforms/arch:arm64": "libf.so",
+        "//build/bazel_common_rules/platforms/arch:arm": "libg.so",
+        "//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
         "//conditions:default": None,
     })`}),
 				MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
 					"shared_library": `select({
-        "//build/bazel/platforms/arch:arm": "libg.so",
-        "//build/bazel/platforms/arch:arm64": "libf.so",
+        "//build/bazel_common_rules/platforms/arch:arm": "libg.so",
+        "//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
         "//conditions:default": None,
     })`,
 				}),
@@ -289,16 +289,16 @@
 			MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
 				"shared_library": `"libf.so"`,
 				"export_includes": `select({
-        "//build/bazel/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel/platforms/arch:arm64": ["testdir/2/"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
+        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
         "//conditions:default": [],
     })`,
 			}),
 			MakeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static", AttrNameToString{
 				"static_library": `"libf.so"`,
 				"export_includes": `select({
-        "//build/bazel/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel/platforms/arch:arm64": ["testdir/2/"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
+        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
         "//conditions:default": [],
     })`,
 			}),
@@ -306,8 +306,8 @@
 				"alwayslink":     "True",
 				"static_library": `"libf.so"`,
 				"export_includes": `select({
-        "//build/bazel/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel/platforms/arch:arm64": ["testdir/2/"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
+        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
         "//conditions:default": [],
     })`,
 			}),
@@ -336,16 +336,16 @@
 			MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
 				"shared_library": `"libf.so"`,
 				"export_system_includes": `select({
-        "//build/bazel/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel/platforms/arch:arm64": ["testdir/2/"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
+        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
         "//conditions:default": [],
     })`,
 			}),
 			MakeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static", AttrNameToString{
 				"static_library": `"libf.so"`,
 				"export_system_includes": `select({
-        "//build/bazel/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel/platforms/arch:arm64": ["testdir/2/"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
+        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
         "//conditions:default": [],
     })`,
 			}),
@@ -353,8 +353,8 @@
 				"alwayslink":     "True",
 				"static_library": `"libf.so"`,
 				"export_system_includes": `select({
-        "//build/bazel/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel/platforms/arch:arm64": ["testdir/2/"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
+        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
         "//conditions:default": [],
     })`,
 			}),
@@ -381,11 +381,11 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("cc_prebuilt_library_static", "ndk_libfoo_static", AttrNameToString{
 				"static_library": `select({
-        "//build/bazel/platforms/os_arch:android_arm": "current/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libfoo_static.a",
-        "//build/bazel/platforms/os_arch:android_arm64": "current/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libfoo_static.a",
-        "//build/bazel/platforms/os_arch:android_riscv64": "current/sources/cxx-stl/llvm-libc++/libs/riscv64/libfoo_static.a",
-        "//build/bazel/platforms/os_arch:android_x86": "current/sources/cxx-stl/llvm-libc++/libs/x86/libfoo_static.a",
-        "//build/bazel/platforms/os_arch:android_x86_64": "current/sources/cxx-stl/llvm-libc++/libs/x86_64/libfoo_static.a",
+        "//build/bazel_common_rules/platforms/os_arch:android_arm": "current/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libfoo_static.a",
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": "current/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libfoo_static.a",
+        "//build/bazel_common_rules/platforms/os_arch:android_riscv64": "current/sources/cxx-stl/llvm-libc++/libs/riscv64/libfoo_static.a",
+        "//build/bazel_common_rules/platforms/os_arch:android_x86": "current/sources/cxx-stl/llvm-libc++/libs/x86/libfoo_static.a",
+        "//build/bazel_common_rules/platforms/os_arch:android_x86_64": "current/sources/cxx-stl/llvm-libc++/libs/x86_64/libfoo_static.a",
         "//conditions:default": None,
     })`,
 				"export_system_includes": `[
@@ -395,11 +395,11 @@
 			}),
 			MakeBazelTarget("cc_prebuilt_library_shared", "ndk_libfoo_shared", AttrNameToString{
 				"shared_library": `select({
-        "//build/bazel/platforms/os_arch:android_arm": "current/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libfoo_shared.so",
-        "//build/bazel/platforms/os_arch:android_arm64": "current/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libfoo_shared.so",
-        "//build/bazel/platforms/os_arch:android_riscv64": "current/sources/cxx-stl/llvm-libc++/libs/riscv64/libfoo_shared.so",
-        "//build/bazel/platforms/os_arch:android_x86": "current/sources/cxx-stl/llvm-libc++/libs/x86/libfoo_shared.so",
-        "//build/bazel/platforms/os_arch:android_x86_64": "current/sources/cxx-stl/llvm-libc++/libs/x86_64/libfoo_shared.so",
+        "//build/bazel_common_rules/platforms/os_arch:android_arm": "current/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libfoo_shared.so",
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": "current/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libfoo_shared.so",
+        "//build/bazel_common_rules/platforms/os_arch:android_riscv64": "current/sources/cxx-stl/llvm-libc++/libs/riscv64/libfoo_shared.so",
+        "//build/bazel_common_rules/platforms/os_arch:android_x86": "current/sources/cxx-stl/llvm-libc++/libs/x86/libfoo_shared.so",
+        "//build/bazel_common_rules/platforms/os_arch:android_x86_64": "current/sources/cxx-stl/llvm-libc++/libs/x86_64/libfoo_shared.so",
         "//conditions:default": None,
     })`,
 				"export_system_includes": `[
diff --git a/bp2build/cc_prebuilt_library_shared_conversion_test.go b/bp2build/cc_prebuilt_library_shared_conversion_test.go
index 9e975ae..2242758 100644
--- a/bp2build/cc_prebuilt_library_shared_conversion_test.go
+++ b/bp2build/cc_prebuilt_library_shared_conversion_test.go
@@ -68,8 +68,8 @@
 			ExpectedBazelTargets: []string{
 				MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
 					"shared_library": `select({
-        "//build/bazel/platforms/arch:arm": "libg.so",
-        "//build/bazel/platforms/arch:arm64": "libf.so",
+        "//build/bazel_common_rules/platforms/arch:arm": "libg.so",
+        "//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
         "//conditions:default": None,
     })`,
 				}),
@@ -125,8 +125,8 @@
 			MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
 				"shared_library": `"libf.so"`,
 				"export_includes": `select({
-        "//build/bazel/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel/platforms/arch:arm64": ["testdir/2/"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
+        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
         "//conditions:default": [],
     })`,
 			}),
@@ -155,8 +155,8 @@
 			MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
 				"shared_library": `"libf.so"`,
 				"export_system_includes": `select({
-        "//build/bazel/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel/platforms/arch:arm64": ["testdir/2/"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
+        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
         "//conditions:default": [],
     })`,
 			}),
diff --git a/bp2build/cc_prebuilt_library_shared_test.go b/bp2build/cc_prebuilt_library_shared_test.go
index 58c0a70..1a9579a 100644
--- a/bp2build/cc_prebuilt_library_shared_test.go
+++ b/bp2build/cc_prebuilt_library_shared_test.go
@@ -52,8 +52,8 @@
 			ExpectedBazelTargets: []string{
 				MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
 					"shared_library": `select({
-        "//build/bazel/platforms/arch:arm": "libg.so",
-        "//build/bazel/platforms/arch:arm64": "libf.so",
+        "//build/bazel_common_rules/platforms/arch:arm": "libg.so",
+        "//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
         "//conditions:default": None,
     })`,
 				}),
diff --git a/bp2build/cc_prebuilt_library_static_conversion_test.go b/bp2build/cc_prebuilt_library_static_conversion_test.go
index 77562e7..fb408b5 100644
--- a/bp2build/cc_prebuilt_library_static_conversion_test.go
+++ b/bp2build/cc_prebuilt_library_static_conversion_test.go
@@ -72,15 +72,15 @@
 			ExpectedBazelTargets: []string{
 				MakeBazelTarget("cc_prebuilt_library_static", "libtest", AttrNameToString{
 					"static_library": `select({
-        "//build/bazel/platforms/arch:arm": "libg.so",
-        "//build/bazel/platforms/arch:arm64": "libf.so",
+        "//build/bazel_common_rules/platforms/arch:arm": "libg.so",
+        "//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
         "//conditions:default": None,
     })`}),
 				MakeBazelTarget("cc_prebuilt_library_static", "libtest_alwayslink", AttrNameToString{
 					"alwayslink": "True",
 					"static_library": `select({
-        "//build/bazel/platforms/arch:arm": "libg.so",
-        "//build/bazel/platforms/arch:arm64": "libf.so",
+        "//build/bazel_common_rules/platforms/arch:arm": "libg.so",
+        "//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
         "//conditions:default": None,
     })`}),
 			},
@@ -141,8 +141,8 @@
 			MakeBazelTarget("cc_prebuilt_library_static", "libtest", AttrNameToString{
 				"static_library": `"libf.so"`,
 				"export_includes": `select({
-        "//build/bazel/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel/platforms/arch:arm64": ["testdir/2/"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
+        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
         "//conditions:default": [],
     })`,
 			}),
@@ -150,8 +150,8 @@
 				"alwayslink":     "True",
 				"static_library": `"libf.so"`,
 				"export_includes": `select({
-        "//build/bazel/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel/platforms/arch:arm64": ["testdir/2/"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
+        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
         "//conditions:default": [],
     })`,
 			}),
@@ -180,8 +180,8 @@
 			MakeBazelTarget("cc_prebuilt_library_static", "libtest", AttrNameToString{
 				"static_library": `"libf.so"`,
 				"export_system_includes": `select({
-        "//build/bazel/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel/platforms/arch:arm64": ["testdir/2/"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
+        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
         "//conditions:default": [],
     })`,
 			}),
@@ -189,8 +189,8 @@
 				"alwayslink":     "True",
 				"static_library": `"libf.so"`,
 				"export_system_includes": `select({
-        "//build/bazel/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel/platforms/arch:arm64": ["testdir/2/"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
+        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
         "//conditions:default": [],
     })`,
 			}),
diff --git a/bp2build/cc_prebuilt_library_static_test.go b/bp2build/cc_prebuilt_library_static_test.go
index 17da813..7d0ab28 100644
--- a/bp2build/cc_prebuilt_library_static_test.go
+++ b/bp2build/cc_prebuilt_library_static_test.go
@@ -69,15 +69,15 @@
 			ExpectedBazelTargets: []string{
 				MakeBazelTarget("cc_prebuilt_library_static", "libtest", AttrNameToString{
 					"static_library": `select({
-        "//build/bazel/platforms/arch:arm": "libg.so",
-        "//build/bazel/platforms/arch:arm64": "libf.so",
+        "//build/bazel_common_rules/platforms/arch:arm": "libg.so",
+        "//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
         "//conditions:default": None,
     })`}),
 				MakeBazelTarget("cc_prebuilt_library_static", "libtest_alwayslink", AttrNameToString{
 					"alwayslink": "True",
 					"static_library": `select({
-        "//build/bazel/platforms/arch:arm": "libg.so",
-        "//build/bazel/platforms/arch:arm64": "libf.so",
+        "//build/bazel_common_rules/platforms/arch:arm": "libg.so",
+        "//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
         "//conditions:default": None,
     })`}),
 			},
diff --git a/bp2build/cc_prebuilt_object_conversion_test.go b/bp2build/cc_prebuilt_object_conversion_test.go
index 903c816..068e4e2 100644
--- a/bp2build/cc_prebuilt_object_conversion_test.go
+++ b/bp2build/cc_prebuilt_object_conversion_test.go
@@ -71,8 +71,8 @@
 }`, ExpectedBazelTargets: []string{
 				MakeBazelTarget("cc_prebuilt_object", "objtest", AttrNameToString{
 					"src": `select({
-        "//build/bazel/platforms/arch:arm": "objb.o",
-        "//build/bazel/platforms/arch:arm64": "obja.o",
+        "//build/bazel_common_rules/platforms/arch:arm": "objb.o",
+        "//build/bazel_common_rules/platforms/arch:arm64": "obja.o",
         "//conditions:default": None,
     })`,
 				}),
diff --git a/bp2build/cc_test_conversion_test.go b/bp2build/cc_test_conversion_test.go
index 679a364..c5f5f79 100644
--- a/bp2build/cc_test_conversion_test.go
+++ b/bp2build/cc_test_conversion_test.go
@@ -117,26 +117,26 @@
         ":libgtest_main",
         ":libgtest",
     ] + select({
-        "//build/bazel/platforms/os:darwin": [":hostlib"],
-        "//build/bazel/platforms/os:linux_bionic": [":hostlib"],
-        "//build/bazel/platforms/os:linux_glibc": [":hostlib"],
-        "//build/bazel/platforms/os:linux_musl": [":hostlib"],
-        "//build/bazel/platforms/os:windows": [":hostlib"],
+        "//build/bazel_common_rules/platforms/os:darwin": [":hostlib"],
+        "//build/bazel_common_rules/platforms/os:linux_bionic": [":hostlib"],
+        "//build/bazel_common_rules/platforms/os:linux_glibc": [":hostlib"],
+        "//build/bazel_common_rules/platforms/os:linux_musl": [":hostlib"],
+        "//build/bazel_common_rules/platforms/os:windows": [":hostlib"],
         "//conditions:default": [],
     })`,
 				"local_includes": `["."]`,
 				"dynamic_deps": `[":cc_test_lib2"] + select({
-        "//build/bazel/platforms/os:android": [":foolib"],
+        "//build/bazel_common_rules/platforms/os:android": [":foolib"],
         "//conditions:default": [],
     })`,
 				"srcs": `["test.cpp"] + select({
-        "//build/bazel/platforms/os:android": [
+        "//build/bazel_common_rules/platforms/os:android": [
             "linux.cpp",
             "android.cpp",
         ],
-        "//build/bazel/platforms/os:linux_bionic": ["linux.cpp"],
-        "//build/bazel/platforms/os:linux_glibc": ["linux.cpp"],
-        "//build/bazel/platforms/os:linux_musl": ["linux.cpp"],
+        "//build/bazel_common_rules/platforms/os:linux_bionic": ["linux.cpp"],
+        "//build/bazel_common_rules/platforms/os:linux_glibc": ["linux.cpp"],
+        "//build/bazel_common_rules/platforms/os:linux_musl": ["linux.cpp"],
         "//conditions:default": [],
     })`,
 				"runs_on": `[
@@ -144,7 +144,7 @@
         "device",
     ]`,
 				"features": `select({
-        "//build/bazel/platforms/os_arch:android_arm64": [
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
             "memtag_heap",
             "diag_memtag_heap",
         ],
@@ -178,7 +178,7 @@
         "device",
     ]`,
 				"features": `select({
-        "//build/bazel/platforms/os_arch:android_arm64": [
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
             "memtag_heap",
             "diag_memtag_heap",
         ],
@@ -217,7 +217,7 @@
         "device",
     ]`,
 				"features": `select({
-        "//build/bazel/platforms/os_arch:android_arm64": [
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
             "memtag_heap",
             "diag_memtag_heap",
         ],
@@ -248,7 +248,7 @@
 			{"cc_test", "mytest", AttrNameToString{
 				"local_includes":         `["."]`,
 				"srcs":                   `["test.cpp"]`,
-				"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 				"test_config":            `"test_config.xml"`,
 				"deps": `[
         ":libgtest_main",
@@ -256,7 +256,7 @@
     ]`,
 				"runs_on": `["device"]`,
 				"features": `select({
-        "//build/bazel/platforms/os_arch:android_arm64": [
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
             "memtag_heap",
             "diag_memtag_heap",
         ],
@@ -287,7 +287,7 @@
 			{"cc_test", "mytest", AttrNameToString{
 				"local_includes":         `["."]`,
 				"srcs":                   `["test.cpp"]`,
-				"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 				"test_config":            `"AndroidTest.xml"`,
 				"dynamic_config":         `"DynamicConfig.xml"`,
 				"deps": `[
@@ -296,7 +296,7 @@
     ]`,
 				"runs_on": `["device"]`,
 				"features": `select({
-        "//build/bazel/platforms/os_arch:android_arm64": [
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
             "memtag_heap",
             "diag_memtag_heap",
         ],
@@ -330,7 +330,7 @@
 				"auto_generate_test_config": "True",
 				"local_includes":            `["."]`,
 				"srcs":                      `["test.cpp"]`,
-				"target_compatible_with":    `["//build/bazel/platforms/os:android"]`,
+				"target_compatible_with":    `["//build/bazel_common_rules/platforms/os:android"]`,
 				"template_configs": `[
         "'<target_preparer class=\"com.android.tradefed.targetprep.RootTargetPreparer\">\\n        <option name=\"force-root\" value=\"false\" />\\n    </target_preparer>'",
         "'<option name=\"not-shardable\" value=\"true\" />'",
@@ -341,7 +341,7 @@
 				"dynamic_deps":          `[":liblog"]`,
 				"runs_on":               `["device"]`,
 				"features": `select({
-        "//build/bazel/platforms/os_arch:android_arm64": [
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
             "memtag_heap",
             "diag_memtag_heap",
         ],
@@ -369,14 +369,14 @@
 			{"cc_test", "mytest", AttrNameToString{
 				"local_includes":         `["."]`,
 				"srcs":                   `["test.cpp"]`,
-				"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 				"deps": `[
         ":libgtest",
         ":libgtest_main",
     ]`,
 				"runs_on": `["device"]`,
 				"features": `select({
-        "//build/bazel/platforms/os_arch:android_arm64": [
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
             "memtag_heap",
             "diag_memtag_heap",
         ],
@@ -405,12 +405,12 @@
 			{"cc_test", "mytest", AttrNameToString{
 				"local_includes":         `["."]`,
 				"srcs":                   `["test.cpp"]`,
-				"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 				"deps":                   `[":libgtest_isolated_main"]`,
 				"dynamic_deps":           `[":liblog"]`,
 				"runs_on":                `["device"]`,
 				"features": `select({
-        "//build/bazel/platforms/os_arch:android_arm64": [
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
             "memtag_heap",
             "diag_memtag_heap",
         ],
@@ -446,10 +446,10 @@
         ":libgtest",
     ]`,
 				"gtest":                  "True",
-				"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 				"runs_on":                `["device"]`,
 				"features": `select({
-        "//build/bazel/platforms/os_arch:android_arm64": [
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
             "memtag_heap",
             "diag_memtag_heap",
         ],
@@ -460,10 +460,10 @@
 			{"cc_test", "mytest_with_no_gtest", AttrNameToString{
 				"local_includes":         `["."]`,
 				"gtest":                  "False",
-				"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 				"runs_on":                `["device"]`,
 				"features": `select({
-        "//build/bazel/platforms/os_arch:android_arm64": [
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
             "memtag_heap",
             "diag_memtag_heap",
         ],
@@ -495,12 +495,12 @@
 			{"cc_test", "mytest", AttrNameToString{
 				"local_includes":         `["."]`,
 				"srcs":                   `["test.cpp"]`,
-				"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 				"deps":                   `[":libgtest_isolated_main"]`,
 				"dynamic_deps":           `[":liblog"]`,
 				"runs_on":                `["device"]`,
 				"features": `["android_cfi"] + select({
-        "//build/bazel/platforms/os_arch:android_arm64": ["-memtag_heap"],
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": ["-memtag_heap"],
         "//conditions:default": [],
     })`,
 			},
@@ -532,12 +532,12 @@
 			{"cc_test", "mytest", AttrNameToString{
 				"local_includes":         `["."]`,
 				"srcs":                   `["test.cpp"]`,
-				"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 				"deps":                   `[":libgtest_isolated_main"]`,
 				"dynamic_deps":           `[":liblog"]`,
 				"runs_on":                `["device"]`,
 				"features": `select({
-        "//build/bazel/platforms/os_arch:android_arm64": ["-memtag_heap"],
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": ["-memtag_heap"],
         "//conditions:default": [],
     })`,
 			},
@@ -569,12 +569,12 @@
 			{"cc_test", "mytest", AttrNameToString{
 				"local_includes":         `["."]`,
 				"srcs":                   `["test.cpp"]`,
-				"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 				"deps":                   `[":libgtest_isolated_main"]`,
 				"dynamic_deps":           `[":liblog"]`,
 				"runs_on":                `["device"]`,
 				"features": `select({
-        "//build/bazel/platforms/os_arch:android_arm64": [
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
             "memtag_heap",
             "diag_memtag_heap",
         ],
@@ -615,12 +615,12 @@
 			{"cc_test", "mytest", AttrNameToString{
 				"local_includes":         `["."]`,
 				"srcs":                   `["test.cpp"]`,
-				"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 				"deps":                   `[":libgtest_isolated_main"]`,
 				"dynamic_deps":           `[":liblog"]`,
 				"runs_on":                `["device"]`,
 				"features": `select({
-        "//build/bazel/platforms/os_arch:android_arm64": [
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
             "-memtag_heap",
             "-diag_memtag_heap",
         ],
diff --git a/bp2build/cc_yasm_conversion_test.go b/bp2build/cc_yasm_conversion_test.go
index 55d4feb..c98e1a1 100644
--- a/bp2build/cc_yasm_conversion_test.go
+++ b/bp2build/cc_yasm_conversion_test.go
@@ -126,14 +126,14 @@
 			MakeBazelTarget("yasm", "foo_yasm", map[string]string{
 				"include_dirs": `["."]`,
 				"srcs": `select({
-        "//build/bazel/platforms/arch:x86": ["myfile.asm"],
+        "//build/bazel_common_rules/platforms/arch:x86": ["myfile.asm"],
         "//conditions:default": [],
     })`,
 			}),
 		}, makeCcLibraryTargets("foo", map[string]string{
 			"local_includes": `["."]`,
 			"srcs": `["main.cpp"] + select({
-        "//build/bazel/platforms/arch:x86": [":foo_yasm"],
+        "//build/bazel_common_rules/platforms/arch:x86": [":foo_yasm"],
         "//conditions:default": [],
     })`,
 		})...),
@@ -164,7 +164,7 @@
 			MakeBazelTarget("yasm", "foo_yasm", map[string]string{
 				"include_dirs": `["."]`,
 				"srcs": `["myfile.asm"] + select({
-        "//build/bazel/platforms/arch:x86": ["mysecondfile.asm"],
+        "//build/bazel_common_rules/platforms/arch:x86": ["mysecondfile.asm"],
         "//conditions:default": [],
     })`,
 			}),
diff --git a/bp2build/fdo_profile_conversion_test.go b/bp2build/fdo_profile_conversion_test.go
index 4d04283..918b27c 100644
--- a/bp2build/fdo_profile_conversion_test.go
+++ b/bp2build/fdo_profile_conversion_test.go
@@ -50,8 +50,8 @@
 }`,
 			expectedBazelAttrs: AttrNameToString{
 				"profile": `select({
-        "//build/bazel/platforms/arch:arm": "foo_arm.afdo",
-        "//build/bazel/platforms/arch:arm64": "foo_arm64.afdo",
+        "//build/bazel_common_rules/platforms/arch:arm": "foo_arm.afdo",
+        "//build/bazel_common_rules/platforms/arch:arm64": "foo_arm64.afdo",
         "//conditions:default": None,
     })`,
 			},
diff --git a/bp2build/genrule_conversion_test.go b/bp2build/genrule_conversion_test.go
index 7e9b17b..af03dff 100644
--- a/bp2build/genrule_conversion_test.go
+++ b/bp2build/genrule_conversion_test.go
@@ -681,11 +681,11 @@
 
 	expectedBazelAttrs := AttrNameToString{
 		"srcs": `["foo1.in"] + select({
-        "//build/bazel/platforms/arch:arm": ["foo1_arch.in"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["foo1_arch.in"],
         "//conditions:default": [],
     })`,
 		"cmd":                    `"cat $(SRCS) > $(OUTS)"`,
-		"target_compatible_with": `["//build/bazel/platforms/os:android"]`,
+		"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
 	}
 
 	expectedBazelTargets := []string{
diff --git a/bp2build/go_conversion_test.go b/bp2build/go_conversion_test.go
index 2387641..ebd241d 100644
--- a/bp2build/go_conversion_test.go
+++ b/bp2build/go_conversion_test.go
@@ -84,8 +84,8 @@
         "foo1.go",
         "foo2.go",
     ] + select({
-        "//build/bazel/platforms/os:darwin": ["foo_darwin.go"],
-        "//build/bazel/platforms/os:linux_glibc": ["foo_linux.go"],
+        "//build/bazel_common_rules/platforms/os:darwin": ["foo_darwin.go"],
+        "//build/bazel_common_rules/platforms/os:linux_glibc": ["foo_linux.go"],
         "//conditions:default": [],
     })`,
 			},
@@ -98,8 +98,8 @@
         "foo1_test.go",
         "foo2_test.go",
     ] + select({
-        "//build/bazel/platforms/os:darwin": ["foo_darwin_test.go"],
-        "//build/bazel/platforms/os:linux_glibc": ["foo_linux_test.go"],
+        "//build/bazel_common_rules/platforms/os:darwin": ["foo_darwin_test.go"],
+        "//build/bazel_common_rules/platforms/os:linux_glibc": ["foo_linux_test.go"],
         "//conditions:default": [],
     })`,
 				},
diff --git a/bp2build/java_binary_host_conversion_test.go b/bp2build/java_binary_host_conversion_test.go
index 4271f76..29c0e44 100644
--- a/bp2build/java_binary_host_conversion_test.go
+++ b/bp2build/java_binary_host_conversion_test.go
@@ -63,7 +63,7 @@
 				"java_version": `"8"`,
 				"javacopts":    `["-Xdoclint:all/protected"]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -71,7 +71,7 @@
 				"main_class": `"com.android.test.MainClass"`,
 				"jvm_flags":  `["-Djava.library.path=$${RUNPATH}other/jni-lib-1"]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 				"runtime_deps": `[":java-binary-host-1_lib"]`,
@@ -102,7 +102,7 @@
 				"main_class":   `"com.android.test.MainClass"`,
 				"runtime_deps": `[":java-dep-1"]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -132,14 +132,14 @@
 				"srcs": `["a.java"]`,
 				"deps": `[":java-lib-dep-1-neverlink"]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
 			MakeBazelTarget("java_binary", "java-binary-host-libs", AttrNameToString{
 				"main_class": `"com.android.test.MainClass"`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 				"runtime_deps": `[":java-binary-host-libs_lib"]`,
@@ -165,7 +165,7 @@
         "b.kt",
     ]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -173,7 +173,7 @@
 				"main_class":   `"com.android.test.MainClass"`,
 				"runtime_deps": `[":java-binary-host_lib"]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -197,7 +197,7 @@
 				"srcs":        `["a.java"]`,
 				"common_srcs": `["b.kt"]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -205,7 +205,7 @@
 				"main_class":   `"com.android.test.MainClass"`,
 				"runtime_deps": `[":java-binary-host_lib"]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -240,7 +240,7 @@
     ]`,
 				"resource_strip_prefix": `"res"`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -248,7 +248,7 @@
 				"main_class":   `"com.android.test.MainClass"`,
 				"runtime_deps": `[":java-binary-host_lib"]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -286,7 +286,7 @@
     ]`,
 				"resource_strip_prefix": `"adir"`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -294,7 +294,7 @@
 				"main_class":   `"com.android.test.MainClass"`,
 				"runtime_deps": `[":java-binary-host_lib"]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -321,7 +321,7 @@
         "-flag2",
     ]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -329,7 +329,7 @@
 				"main_class":   `"com.android.test.MainClass"`,
 				"runtime_deps": `[":java-binary-host_lib"]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
diff --git a/bp2build/java_import_conversion_test.go b/bp2build/java_import_conversion_test.go
index d9910af..bba2f50 100644
--- a/bp2build/java_import_conversion_test.go
+++ b/bp2build/java_import_conversion_test.go
@@ -88,8 +88,8 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("java_import", "example_import", AttrNameToString{
 				"jars": `select({
-        "//build/bazel/platforms/os:android": ["android.jar"],
-        "//build/bazel/platforms/os:linux_glibc": ["linux.jar"],
+        "//build/bazel_common_rules/platforms/os:android": ["android.jar"],
+        "//build/bazel_common_rules/platforms/os:linux_glibc": ["linux.jar"],
         "//conditions:default": [],
     })`,
 			}),
diff --git a/bp2build/java_library_conversion_test.go b/bp2build/java_library_conversion_test.go
index ad0ec65..9cb9443 100644
--- a/bp2build/java_library_conversion_test.go
+++ b/bp2build/java_library_conversion_test.go
@@ -780,7 +780,7 @@
 				AttrNameToString{
 					"srcs": `["lib.java"] + select({
         "//build/bazel/platforms/arch/variants:arm-neon": [],
-        "//build/bazel/platforms/arch:arm": ["arm_non_neon.java"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["arm_non_neon.java"],
         "//conditions:default": [],
     })`,
 					"manifest":       `"manifest/AndroidManifest.xml"`,
@@ -899,11 +899,11 @@
 			MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
 				"srcs": `["a.java"]`,
 				"exports": `select({
-        "//build/bazel/platforms/os:android": [":java-lib-4"],
+        "//build/bazel_common_rules/platforms/os:android": [":java-lib-4"],
         "//conditions:default": [],
     })`,
 				"deps": `[":java-lib-2-neverlink"] + select({
-        "//build/bazel/platforms/os:android": [
+        "//build/bazel_common_rules/platforms/os:android": [
             ":java-lib-3-neverlink",
             ":java-lib-4",
         ],
@@ -934,7 +934,7 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
 				"srcs": `["b.java"] + select({
-        "//build/bazel/platforms/os:android": [],
+        "//build/bazel_common_rules/platforms/os:android": [],
         "//conditions:default": ["a.java"],
     })`,
 				"sdk_version": `"current"`,
diff --git a/bp2build/java_library_host_conversion_test.go b/bp2build/java_library_host_conversion_test.go
index 9e47b09..d0fdec6 100644
--- a/bp2build/java_library_host_conversion_test.go
+++ b/bp2build/java_library_host_conversion_test.go
@@ -50,7 +50,7 @@
 				"srcs": `["a.java"]`,
 				"deps": `[":java-lib-host-2-neverlink"]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -58,7 +58,7 @@
 				"exports":   `[":java-lib-host-1"]`,
 				"neverlink": `True`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -66,7 +66,7 @@
 				"java_version": `"9"`,
 				"srcs":         `["c.java"]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -74,7 +74,7 @@
 				"exports":   `[":java-lib-host-2"]`,
 				"neverlink": `True`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 				"java_version": `"9"`,
diff --git a/bp2build/java_plugin_conversion_test.go b/bp2build/java_plugin_conversion_test.go
index dcc17b5..e63cc55 100644
--- a/bp2build/java_plugin_conversion_test.go
+++ b/bp2build/java_plugin_conversion_test.go
@@ -55,7 +55,7 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("java_plugin", "java-plug-1", AttrNameToString{
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 				"deps": `[
@@ -95,7 +95,7 @@
 		ExpectedBazelTargets: []string{
 			MakeBazelTarget("java_plugin", "java-plug-1", AttrNameToString{
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 				"deps": `[
diff --git a/bp2build/java_test_host_conversion_test.go b/bp2build/java_test_host_conversion_test.go
index 1a98ea2..5d93f58 100644
--- a/bp2build/java_test_host_conversion_test.go
+++ b/bp2build/java_test_host_conversion_test.go
@@ -64,7 +64,7 @@
 				"javacopts":    `["-Xdoclint:all/protected"]`,
 				"srcs":         `["a.java"]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -76,7 +76,7 @@
     ]`,
 				"srcs": `["a.java"]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -111,7 +111,7 @@
         ":static_libs_a",
     ]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -137,7 +137,7 @@
     ]`,
 				"runtime_deps": `[":java_test_host-1_lib"]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -147,7 +147,7 @@
         "b.kt",
     ]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
diff --git a/bp2build/prebuilt_etc_conversion_test.go b/bp2build/prebuilt_etc_conversion_test.go
index e237303..1f37270 100644
--- a/bp2build/prebuilt_etc_conversion_test.go
+++ b/bp2build/prebuilt_etc_conversion_test.go
@@ -80,8 +80,8 @@
 				"filename":    `"tz_version"`,
 				"installable": `False`,
 				"src": `select({
-        "//build/bazel/platforms/arch:arm": "arm",
-        "//build/bazel/platforms/arch:arm64": "arm64",
+        "//build/bazel_common_rules/platforms/arch:arm": "arm",
+        "//build/bazel_common_rules/platforms/arch:arm64": "arm64",
         "//conditions:default": "version/tz_version",
     })`,
 				"dir": `"etc/tz"`,
@@ -119,11 +119,11 @@
 				"filename":    `"tz_version"`,
 				"installable": `False`,
 				"src": `select({
-        "//build/bazel/platforms/os_arch:android_arm": "arm",
-        "//build/bazel/platforms/os_arch:android_arm64": "darwin_or_arm64",
-        "//build/bazel/platforms/os_arch:darwin_arm64": "darwin_or_arm64",
-        "//build/bazel/platforms/os_arch:darwin_x86_64": "darwin_or_arm64",
-        "//build/bazel/platforms/os_arch:linux_bionic_arm64": "darwin_or_arm64",
+        "//build/bazel_common_rules/platforms/os_arch:android_arm": "arm",
+        "//build/bazel_common_rules/platforms/os_arch:android_arm64": "darwin_or_arm64",
+        "//build/bazel_common_rules/platforms/os_arch:darwin_arm64": "darwin_or_arm64",
+        "//build/bazel_common_rules/platforms/os_arch:darwin_x86_64": "darwin_or_arm64",
+        "//build/bazel_common_rules/platforms/os_arch:linux_bionic_arm64": "darwin_or_arm64",
         "//conditions:default": "version/tz_version",
     })`,
 				"dir": `"etc/tz"`,
@@ -270,8 +270,8 @@
 				"filename_from_src": `True`,
 				"dir":               `"etc"`,
 				"src": `select({
-        "//build/bazel/platforms/arch:arm": "barSrc",
-        "//build/bazel/platforms/arch:arm64": "bazSrc",
+        "//build/bazel_common_rules/platforms/arch:arm": "barSrc",
+        "//build/bazel_common_rules/platforms/arch:arm64": "bazSrc",
         "//conditions:default": None,
     })`,
 			})}})
@@ -317,8 +317,8 @@
 				"filename": `"fooFilename"`,
 				"dir":      `"etc"`,
 				"src": `select({
-        "//build/bazel/platforms/arch:arm": "armSrc",
         "//build/bazel/product_config/config_settings:native_coverage-arm": "nativeCoverageArmSrc",
+        "//build/bazel_common_rules/platforms/arch:arm": "armSrc",
         "//conditions:default": None,
     })`,
 			})}})
diff --git a/bp2build/python_binary_conversion_test.go b/bp2build/python_binary_conversion_test.go
index b69c4ea..eb993c2 100644
--- a/bp2build/python_binary_conversion_test.go
+++ b/bp2build/python_binary_conversion_test.go
@@ -56,7 +56,7 @@
         "b/d.py",
     ]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -90,7 +90,7 @@
 				"imports":        `["."]`,
 				"srcs":           `["a.py"]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -124,7 +124,7 @@
 				"imports": `["."]`,
 				"srcs":    `["a.py"]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -156,12 +156,12 @@
 			MakeBazelTarget("py_binary", "foo-arm", AttrNameToString{
 				"imports": `["."]`,
 				"srcs": `select({
-        "//build/bazel/platforms/arch:arm": ["arm.py"],
-        "//build/bazel/platforms/arch:x86": ["x86.py"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["arm.py"],
+        "//build/bazel_common_rules/platforms/arch:x86": ["x86.py"],
         "//conditions:default": [],
     })`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -183,7 +183,7 @@
 			MakeBazelTarget("py_binary", "foo", AttrNameToString{
 				"imports": `["."]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -212,7 +212,7 @@
 				"main":    `":a"`,
 				"imports": `["."]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -241,7 +241,7 @@
 				"main":    `"//a:b.py"`,
 				"imports": `["."]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -269,7 +269,7 @@
 				"main":    `"a/b.py"`,
 				"imports": `["."]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
@@ -311,7 +311,7 @@
         ":r2",
     ]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
diff --git a/bp2build/python_library_conversion_test.go b/bp2build/python_library_conversion_test.go
index 497df80..ad6a27b 100644
--- a/bp2build/python_library_conversion_test.go
+++ b/bp2build/python_library_conversion_test.go
@@ -25,7 +25,7 @@
 func convertPythonLibTestCaseToBp2build_Host(tc pythonLibBp2BuildTestCase) Bp2buildTestCase {
 	for i := range tc.expectedBazelTargets {
 		tc.expectedBazelTargets[i].attrs["target_compatible_with"] = `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`
 	}
@@ -296,8 +296,8 @@
 				name: "foo",
 				attrs: AttrNameToString{
 					"srcs": `select({
-        "//build/bazel/platforms/arch:arm": ["arm.py"],
-        "//build/bazel/platforms/arch:x86": ["x86.py"],
+        "//build/bazel_common_rules/platforms/arch:arm": ["arm.py"],
+        "//build/bazel_common_rules/platforms/arch:x86": ["x86.py"],
         "//conditions:default": [],
     })`,
 					"srcs_version": `"PY3"`,
diff --git a/bp2build/python_test_conversion_test.go b/bp2build/python_test_conversion_test.go
index fa2e485..fca7efb 100644
--- a/bp2build/python_test_conversion_test.go
+++ b/bp2build/python_test_conversion_test.go
@@ -58,7 +58,7 @@
         "b/d.py",
     ]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			}),
diff --git a/bp2build/sh_test_conversion_test.go b/bp2build/sh_test_conversion_test.go
index 48fd077..4bea396 100644
--- a/bp2build/sh_test_conversion_test.go
+++ b/bp2build/sh_test_conversion_test.go
@@ -120,7 +120,7 @@
     ]`,
 				"tags": `["no-remote"]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			})},
@@ -164,7 +164,7 @@
 				"srcs":                      `["empty.sh"]`,
 				"runs_on":                   `["device"]`,
 				"auto_generate_test_config": "True",
-				"target_compatible_with":    `["//build/bazel/platforms/os:android"]`,
+				"target_compatible_with":    `["//build/bazel_common_rules/platforms/os:android"]`,
 				"template_test_config":      `":art-run-test-target-template"`,
 				"data": `[
         "android.hardware.bluetooth@1.1-service.sim.rc",
@@ -220,7 +220,7 @@
 				"runs_on":                   `["host_without_device"]`,
 				"auto_generate_test_config": "True",
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 				"template_test_config": `":art-run-test-target-template"`,
@@ -332,7 +332,7 @@
     ]`,
 				"tags": `["no-remote"]`,
 				"target_compatible_with": `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`,
 			})},
diff --git a/bp2build/soong_config_module_type_conversion_test.go b/bp2build/soong_config_module_type_conversion_test.go
index 5ec6bab..2535cf3 100644
--- a/bp2build/soong_config_module_type_conversion_test.go
+++ b/bp2build/soong_config_module_type_conversion_test.go
@@ -1207,13 +1207,13 @@
     local_includes = ["."],
     srcs = ["main.cc"],
     target_compatible_with = select({
-        "//build/bazel/platforms/os_arch:android_x86_64": ["@platforms//:incompatible"],
-        "//build/bazel/platforms/os_arch:darwin_arm64": ["@platforms//:incompatible"],
-        "//build/bazel/platforms/os_arch:darwin_x86_64": ["@platforms//:incompatible"],
-        "//build/bazel/platforms/os_arch:linux_bionic_x86_64": ["@platforms//:incompatible"],
-        "//build/bazel/platforms/os_arch:linux_glibc_x86_64": ["@platforms//:incompatible"],
-        "//build/bazel/platforms/os_arch:linux_musl_x86_64": ["@platforms//:incompatible"],
-        "//build/bazel/platforms/os_arch:windows_x86_64": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os_arch:android_x86_64": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os_arch:darwin_arm64": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os_arch:darwin_x86_64": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os_arch:linux_bionic_x86_64": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os_arch:linux_glibc_x86_64": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os_arch:linux_musl_x86_64": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os_arch:windows_x86_64": ["@platforms//:incompatible"],
         "//conditions:default": [],
     }) + select({
         "//build/bazel/product_config/config_settings:alphabet_module__special_build": [],
@@ -1423,7 +1423,7 @@
 		ExpectedBazelTargets: []string{`cc_binary(
     name = "my_binary",
     copts = select({
-        "//build/bazel/platforms/os:android": ["-DFOO"],
+        "//build/bazel_common_rules/platforms/os:android": ["-DFOO"],
         "//conditions:default": [],
     }) + select({
         "//build/bazel/product_config/config_settings:my_namespace__my_bool_variable__android": ["-DBAR"],
@@ -1440,7 +1440,7 @@
     }),
     local_includes = ["."],
     srcs = ["main.cc"],
-    target_compatible_with = ["//build/bazel/platforms/os:android"],
+    target_compatible_with = ["//build/bazel_common_rules/platforms/os:android"],
 )`}})
 }
 
diff --git a/bp2build/testing.go b/bp2build/testing.go
index 763cccc..b2804f9 100644
--- a/bp2build/testing.go
+++ b/bp2build/testing.go
@@ -682,11 +682,11 @@
 		switch hod {
 		case android.HostSupported:
 			attrs["target_compatible_with"] = `select({
-        "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
+        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
         "//conditions:default": [],
     })`
 		case android.DeviceSupported:
-			attrs["target_compatible_with"] = `["//build/bazel/platforms/os:android"]`
+			attrs["target_compatible_with"] = `["//build/bazel_common_rules/platforms/os:android"]`
 		}
 	}
 
diff --git a/cc/bp2build.go b/cc/bp2build.go
index ec5d522..57333b8 100644
--- a/cc/bp2build.go
+++ b/cc/bp2build.go
@@ -1514,7 +1514,7 @@
 		Constraint_values: bazel.MakeLabelListAttribute(
 			bazel.MakeLabelList(
 				[]bazel.Label{
-					bazel.Label{Label: "//build/bazel/platforms/os:android"},
+					bazel.Label{Label: "//build/bazel_common_rules/platforms/os:android"},
 				},
 			),
 		),
diff --git a/xml/xml_conversion_test.go b/xml/xml_conversion_test.go
index 6606ddc..c052b44 100644
--- a/xml/xml_conversion_test.go
+++ b/xml/xml_conversion_test.go
@@ -121,8 +121,8 @@
 				"filename_from_src": `True`,
 				"dir":               `"etc"`,
 				"src": `select({
-        "//build/bazel/platforms/arch:arm": "barSrc",
-        "//build/bazel/platforms/arch:arm64": "bazSrc",
+        "//build/bazel_common_rules/platforms/arch:arm": "barSrc",
+        "//build/bazel_common_rules/platforms/arch:arm64": "bazSrc",
         "//conditions:default": None,
     })`,
 			})}})