diff --git a/bazel/configurability.go b/bazel/configurability.go index a28432c01..2c9a5364a 100644 --- a/bazel/configurability.go +++ b/bazel/configurability.go @@ -133,7 +133,7 @@ func createPlatformArchMap() map[string]string { } 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 @@ var ( // 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 @@ var ( 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 475c2d666..bdad1f4cd 100644 --- a/bp2build/aar_conversion_test.go +++ b/bp2build/aar_conversion_test.go @@ -69,8 +69,8 @@ android_library { "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 9d73ec09c..be9a33db1 100644 --- a/bp2build/aconfig_conversion_test.go +++ b/bp2build/aconfig_conversion_test.go @@ -128,7 +128,7 @@ func TestCcAconfigLibrary(t *testing.T) { 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 @@ func TestJavaAconfigLibrary(t *testing.T) { "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 @@ func TestJavaAconfigLibraryAsTaggedOutput(t *testing.T) { "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 @@ func TestJavaAconfigLibraryAsTaggedOutput(t *testing.T) { 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 afe6dcd55..33d1a040d 100644 --- a/bp2build/android_app_conversion_test.go +++ b/bp2build/android_app_conversion_test.go @@ -167,8 +167,8 @@ android_app { 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 @@ filegroup { "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 5871d5921..bdb655b78 100644 --- a/bp2build/apex_conversion_test.go +++ b/bp2build/apex_conversion_test.go @@ -158,22 +158,22 @@ apex { "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 @@ filegroup { ":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 @@ func TestApexBundleCompileMultilibFirstAndDefaultValue(t *testing.T) { 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 @@ func TestApexBundleCompileMultilibFirstAndDefaultValue(t *testing.T) { "//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 @@ filegroup { ":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 @@ filegroup { 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 @@ override_apex { "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 @@ override_apex { "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 @@ apex { "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 140afb76a..05e2f25bd 100644 --- a/bp2build/apex_key_conversion_test.go +++ b/bp2build/apex_key_conversion_test.go @@ -49,7 +49,7 @@ apex_key { 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 @@ apex_key { 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 @@ apex_key { 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 1259f9e35..26b0bf434 100644 --- a/bp2build/bpf_conversion_test.go +++ b/bp2build/bpf_conversion_test.go @@ -58,7 +58,7 @@ bpf { "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 0a4d749a7..f809bcc07 100644 --- a/bp2build/build_conversion_test.go +++ b/bp2build/build_conversion_test.go @@ -270,8 +270,8 @@ func TestGenerateBazelTargetModules(t *testing.T) { 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 @@ custom { 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 @@ custom { }), 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 @@ python_library { 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 c67970375..2857a91df 100644 --- a/bp2build/cc_binary_conversion_test.go +++ b/bp2build/cc_binary_conversion_test.go @@ -618,13 +618,13 @@ cc_library { {"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 @@ func TestCcBinaryWithInstructionSet(t *testing.T) { 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 @@ func TestCcArchVariantBinarySuffix(t *testing.T) { {"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 @@ func TestCcBinaryWithSyspropSrcsSomeConfigs(t *testing.T) { 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 @@ func TestCcBinaryWithSyspropSrcsSomeConfigs(t *testing.T) { "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 @@ func TestCcBinaryWithUBSanPropertiesArchSpecific(t *testing.T) { "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 @@ func TestCcBinaryWithThinLtoArchSpecific(t *testing.T) { {"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 @@ func TestCcBinaryWithThinLtoDisabledDefaultEnabledVariant(t *testing.T) { {"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 @@ func TestCcBinaryHiddenVisibilityConvertedToFeatureOsSpecific(t *testing.T) { {"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 @@ func TestCcBinaryWithCfiOsSpecific(t *testing.T) { 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 { }}, {"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 d19859645..188c81b2a 100644 --- a/bp2build/cc_library_conversion_test.go +++ b/bp2build/cc_library_conversion_test.go @@ -137,22 +137,22 @@ cc_library { "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 @@ cc_library { "-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 @@ cc_library { 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 @@ cc_library_static { name: "android_dep_for_shared" } "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 @@ cc_library_static { name: "android_dep_for_shared" } "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 @@ cc_library_static { name: "android_dep_for_shared" } "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 @@ cc_library_static { name: "android_dep_for_shared" } "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 @@ cc_library { 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 @@ cc_library { })`, "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 @@ func TestCcLibraryFeatures(t *testing.T) { })...) 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 @@ func TestCcLibraryFeatures(t *testing.T) { })...) 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 @@ func TestCcLibraryCppFlagsGoesIntoCopts(t *testing.T) { "-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 @@ cc_library { `, 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 @@ cc_library { })`, "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 @@ cc_library { "//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 @@ cc_library { `, 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 @@ cc_library { 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 @@ cc_library { `, 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 @@ cc_library { 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 @@ cc_library { 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 @@ cc_library { `, 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 @@ cc_library { `, 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 @@ cc_library { `, 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 @@ cc_library { `, 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 @@ func TestCcLibraryDisabledArchAndTarget(t *testing.T) { 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 @@ func TestCcLibraryDisabledArchAndTargetWithDefault(t *testing.T) { 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 @@ func TestCcLibrarySharedDisabled(t *testing.T) { }), 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 @@ func TestCcLibraryStaticDisabledForSomeArch(t *testing.T) { 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 @@ cc_library { }`, 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 @@ func TestCcLibraryWithInstructionSet(t *testing.T) { `, 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 @@ func TestCcLibraryArchVariantSuffix(t *testing.T) { 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 @@ cc_library { 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 @@ cc_library { "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 @@ cc_library { "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 @@ cc_library { `, 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 @@ cc_library { "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 @@ cc_library { ]`, "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 @@ cc_library { "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 @@ cc_library { "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 @@ cc_library { 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 @@ cc_library { 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 @@ cc_library { 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 @@ cc_library { "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 @@ func TestCcLibraryHostLdLibs(t *testing.T) { 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 @@ cc_library { 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 @@ cc_library_shared { }), 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 @@ cc_library { 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 5168fe95c..765598666 100644 --- a/bp2build/cc_library_headers_conversion_test.go +++ b/bp2build/cc_library_headers_conversion_test.go @@ -103,9 +103,9 @@ cc_library_headers { 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 @@ cc_library_headers { 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 @@ cc_library_headers { 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 @@ func TestCcLibraryHeadersArchAndTargetExportSystemIncludes(t *testing.T) { 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 2c5305f72..9f9fcf9c1 100644 --- a/bp2build/cc_library_shared_conversion_test.go +++ b/bp2build/cc_library_shared_conversion_test.go @@ -204,11 +204,11 @@ cc_library_shared { 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 @@ cc_library_shared { 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 @@ cc_library_shared { 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 @@ cc_library_shared { 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 @@ cc_library_shared { 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 @@ cc_library_shared { 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 @@ cc_library_shared { "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 @@ cc_library_shared { "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 @@ cc_library_shared { 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 @@ cc_library_shared { 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 @@ cc_library_shared{ 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 @@ cc_library_shared { 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 09e40edab..d7bbd6810 100644 --- a/bp2build/cc_library_static_conversion_test.go +++ b/bp2build/cc_library_static_conversion_test.go @@ -410,11 +410,11 @@ cc_library_static { 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 @@ cc_library_static { 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 @@ cc_library_static { 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 @@ cc_library_static { 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 @@ cc_library_static { 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 @@ cc_library_static { 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 @@ cc_library_static { 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 @@ cc_library_static { 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 @@ cc_library_static { 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 @@ cc_library_static { 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 @@ cc_library_static { 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 @@ cc_library_static { 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 @@ cc_library_static { "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 @@ cc_library_static { "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 @@ cc_library_static { "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 @@ cc_library_static { "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 @@ cc_library_static { "//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 @@ cc_library_static { 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 @@ cc_library_static { 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 @@ cc_library_static { 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 @@ cc_library_static { 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 @@ cc_library_static { 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 @@ cc_library_static { 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 @@ cc_library_static { "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 @@ cc_library_static { "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 @@ cc_library_static { 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 @@ cc_library_static { 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 @@ cc_library_static { 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 @@ cc_library_static { 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 e1e2f43d7..4d44db76a 100644 --- a/bp2build/cc_object_conversion_test.go +++ b/bp2build/cc_object_conversion_test.go @@ -232,11 +232,11 @@ func TestCcObjectCflagsOneArch(t *testing.T) { 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 @@ func TestCcObjectCflagsFourArch(t *testing.T) { 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 @@ cc_object { 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 @@ func TestCcObjectSelectOnLinuxAndBionicArchs(t *testing.T) { 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 0e8048c27..9adaf32d1 100644 --- a/bp2build/cc_prebuilt_binary_conversion_test.go +++ b/bp2build/cc_prebuilt_binary_conversion_test.go @@ -95,8 +95,8 @@ cc_prebuilt_binary { }`, 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 8c33be3c9..a7f0c7b27 100644 --- a/bp2build/cc_prebuilt_library_conversion_test.go +++ b/bp2build/cc_prebuilt_library_conversion_test.go @@ -76,21 +76,21 @@ cc_prebuilt_library { 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 @@ cc_prebuilt_library { 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 @@ cc_prebuilt_library { "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 @@ cc_prebuilt_library { 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 @@ cc_prebuilt_library { "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 @@ ndk_prebuilt_shared_stl { 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 @@ ndk_prebuilt_shared_stl { }), 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 9e975aea3..2242758c6 100644 --- a/bp2build/cc_prebuilt_library_shared_conversion_test.go +++ b/bp2build/cc_prebuilt_library_shared_conversion_test.go @@ -68,8 +68,8 @@ cc_prebuilt_library_shared { 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 @@ cc_prebuilt_library_shared { 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 @@ cc_prebuilt_library_shared { 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 58c0a703d..1a9579ace 100644 --- a/bp2build/cc_prebuilt_library_shared_test.go +++ b/bp2build/cc_prebuilt_library_shared_test.go @@ -52,8 +52,8 @@ cc_prebuilt_library_shared { 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 77562e726..fb408b5f0 100644 --- a/bp2build/cc_prebuilt_library_static_conversion_test.go +++ b/bp2build/cc_prebuilt_library_static_conversion_test.go @@ -72,15 +72,15 @@ cc_prebuilt_library_static { 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 @@ cc_prebuilt_library_static { 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 @@ cc_prebuilt_library_static { "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 @@ cc_prebuilt_library_static { 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 @@ cc_prebuilt_library_static { "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 17da8132a..7d0ab2874 100644 --- a/bp2build/cc_prebuilt_library_static_test.go +++ b/bp2build/cc_prebuilt_library_static_test.go @@ -69,15 +69,15 @@ cc_prebuilt_library_static { 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 903c81634..068e4e28b 100644 --- a/bp2build/cc_prebuilt_object_conversion_test.go +++ b/bp2build/cc_prebuilt_object_conversion_test.go @@ -71,8 +71,8 @@ cc_prebuilt_object { }`, 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 679a36461..c5f5f795c 100644 --- a/bp2build/cc_test_conversion_test.go +++ b/bp2build/cc_test_conversion_test.go @@ -117,26 +117,26 @@ cc_test_library { ":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 @@ cc_test_library { "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 @@ cc_test { "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 @@ cc_test { "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 { {"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 @@ cc_test { ]`, "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 { {"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 @@ cc_test { ]`, "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 @@ cc_test { "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": `[ "'\\n '", "'