Merge "Move platform constraints to bazel_common_rules." into main
diff --git a/android/bazel.go b/android/bazel.go
index 2e16f3e..202fc48 100644
--- a/android/bazel.go
+++ b/android/bazel.go
@@ -634,9 +634,6 @@
func registerBp2buildConversionMutator(ctx RegisterMutatorsContext) {
ctx.BottomUp("bp2build_conversion", bp2buildConversionMutator).Parallel()
-}
-
-func registerBp2buildDepsMutator(ctx RegisterMutatorsContext) {
ctx.BottomUp("bp2build_deps", bp2buildDepsMutator).Parallel()
}
diff --git a/android/config.go b/android/config.go
index 04b43ac..2930c86 100644
--- a/android/config.go
+++ b/android/config.go
@@ -306,9 +306,6 @@
// in tests when a path doesn't exist.
TestAllowNonExistentPaths bool
- // If true, register the "bp2build_deps" mutator in the mutator pipeline.
- Bp2buildDepsMutator bool
-
// The list of files that when changed, must invalidate soong_build to
// regenerate build.ninja.
ninjaFileDepsSet sync.Map
diff --git a/android/mutator.go b/android/mutator.go
index 3d59655..067d6c3 100644
--- a/android/mutator.go
+++ b/android/mutator.go
@@ -35,9 +35,6 @@
// RegisterMutatorsForBazelConversion is a alternate registration pipeline for bp2build. Exported for testing.
func RegisterMutatorsForBazelConversion(ctx *Context, preArchMutators []RegisterMutatorFunc) {
bp2buildMutators := append(preArchMutators, registerBp2buildConversionMutator)
- if ctx.config.Bp2buildDepsMutator {
- bp2buildMutators = append(bp2buildMutators, registerBp2buildDepsMutator)
- }
registerMutatorsForBazelConversion(ctx, bp2buildMutators)
}
diff --git a/bp2build/Android.bp b/bp2build/Android.bp
index e30e53d..a93fb38 100644
--- a/bp2build/Android.bp
+++ b/bp2build/Android.bp
@@ -77,6 +77,7 @@
"java_proto_conversion_test.go",
"java_sdk_library_conversion_test.go",
"java_sdk_library_import_conversion_test.go",
+ "java_test_host_conversion_test.go",
"license_conversion_test.go",
"license_kind_conversion_test.go",
"linker_config_conversion_test.go",
diff --git a/bp2build/build_conversion_test.go b/bp2build/build_conversion_test.go
index 0500491..f809bcc 100644
--- a/bp2build/build_conversion_test.go
+++ b/bp2build/build_conversion_test.go
@@ -1058,50 +1058,6 @@
}),
},
},
- {
- Description: "depends_on_other_unconverted_module_error",
- ModuleTypeUnderTest: "filegroup",
- ModuleTypeUnderTestFactory: android.FileGroupFactory,
- UnconvertedDepsMode: errorModulesUnconvertedDeps,
- Blueprint: `filegroup {
- name: "foobar",
- srcs: [
- ":foo",
- "c",
- ],
- bazel_module: { bp2build_available: true },
-}`,
- ExpectedErr: fmt.Errorf(`filegroup .:foobar depends on unconverted modules: foo`),
- Filesystem: map[string]string{
- "other/Android.bp": `filegroup {
- name: "foo",
- srcs: ["a", "b"],
-}`,
- },
- },
- {
- Description: "depends_on_other_missing_module_error",
- ModuleTypeUnderTest: "filegroup",
- ModuleTypeUnderTestFactory: android.FileGroupFactory,
- UnconvertedDepsMode: errorModulesUnconvertedDeps,
- Blueprint: `filegroup {
- name: "foobar",
- srcs: [
- "c",
- "//other:foo",
- "//other:goo",
- ],
- bazel_module: { bp2build_available: true },
-}`,
- ExpectedErr: fmt.Errorf(`filegroup .:foobar depends on missing modules: //other:goo`),
- Filesystem: map[string]string{"other/Android.bp": `filegroup {
- name: "foo",
- srcs: ["a"],
- bazel_module: { bp2build_available: true },
-}
-`,
- },
- },
}
for _, testCase := range testCases {
@@ -2119,7 +2075,6 @@
Blueprint: bp,
ExpectedBazelTargets: expectedBazelTargets,
Description: "Skipping conversion of a target with missing transitive dep",
- DepsMutator: true,
})
}
@@ -2157,7 +2112,6 @@
Blueprint: bp,
ExpectedBazelTargets: expectedBazelTargets,
Description: "Skipping conversion of a target with missing direct dep",
- DepsMutator: true,
})
}
@@ -2180,7 +2134,6 @@
Blueprint: bp,
ExpectedBazelTargets: []string{},
Description: "Skipping conversion of a target with unconverted direct dep",
- DepsMutator: true,
})
}
@@ -2219,7 +2172,6 @@
Blueprint: bp,
ExpectedBazelTargets: expectedBazelTargets,
Description: "Skipping conversion of a target with unconverted transitive dep",
- DepsMutator: true,
})
}
@@ -2259,7 +2211,6 @@
Blueprint: bp,
ExpectedBazelTargets: expectedBazelTargets,
Description: "Convert target with already-existing build dep",
- DepsMutator: true,
})
}
@@ -2301,6 +2252,5 @@
Blueprint: bp,
ExpectedBazelTargets: expectedBazelTargets,
Description: "Convert target with dep on libc",
- DepsMutator: true,
})
}
diff --git a/bp2build/java_test_host_conversion_test.go b/bp2build/java_test_host_conversion_test.go
index fc7d815..5d93f58 100644
--- a/bp2build/java_test_host_conversion_test.go
+++ b/bp2build/java_test_host_conversion_test.go
@@ -34,7 +34,7 @@
runJavaTestHostTestCase(t, Bp2buildTestCase{
Description: "java_test_host general",
Filesystem: map[string]string{},
- StubbedBuildDefinitions: []string{"lib_a", "lib_b"},
+ StubbedBuildDefinitions: []string{"lib_a", "static_libs_a"},
Blueprint: `
java_test_host {
name: "java_test_host-1",
diff --git a/bp2build/testing.go b/bp2build/testing.go
index 3e2c296..b2804f9 100644
--- a/bp2build/testing.go
+++ b/bp2build/testing.go
@@ -124,12 +124,6 @@
// be merged with the generated BUILD file. This allows custom BUILD targets
// to be used in tests, or use BUILD files to draw package boundaries.
KeepBuildFileForDirs []string
-
- // If true, the bp2build_deps mutator is used for this test. This is an
- // experimental mutator that will disable modules which have transitive
- // dependencies with no bazel definition.
- // TODO: b/285631638 - Enable this feature by default.
- DepsMutator bool
}
func RunBp2BuildTestCaseExtraContext(t *testing.T, registerModuleTypes func(ctx android.RegistrationContext), modifyContext func(ctx *android.TestContext), tc Bp2buildTestCase) {
@@ -140,11 +134,6 @@
if modifyContext != nil {
preparers = append(preparers, android.FixtureModifyContext(modifyContext))
}
- if tc.DepsMutator {
- preparers = append(preparers, android.FixtureModifyConfig(func(cfg android.Config) {
- cfg.Bp2buildDepsMutator = true
- }))
- }
preparers = append(preparers, SetBp2BuildTestRunner)
bp2buildSetup := android.GroupFixturePreparers(
preparers...,
diff --git a/genrule/allowlists.go b/genrule/allowlists.go
index 9647a18..8c78528 100644
--- a/genrule/allowlists.go
+++ b/genrule/allowlists.go
@@ -16,216 +16,100 @@
var (
DepfileAllowList = []string{
+ // go/keep-sorted start
"depfile_allowed_for_test",
+ "gen_uwb_core_proto",
+ "libtextclassifier_fbgen_actions_actions-entity-data",
+ "libtextclassifier_fbgen_actions_actions_model",
+ "libtextclassifier_fbgen_annotator_datetime_datetime",
+ "libtextclassifier_fbgen_annotator_entity-data",
+ "libtextclassifier_fbgen_annotator_experimental_experimental",
+ "libtextclassifier_fbgen_annotator_model",
+ "libtextclassifier_fbgen_annotator_person_name_person_name_model",
+ "libtextclassifier_fbgen_lang_id_common_flatbuffers_embedding-network",
+ "libtextclassifier_fbgen_lang_id_common_flatbuffers_model",
+ "libtextclassifier_fbgen_utils_codepoint-range",
+ "libtextclassifier_fbgen_utils_container_bit-vector",
+ "libtextclassifier_fbgen_utils_flatbuffers_flatbuffers",
+ "libtextclassifier_fbgen_utils_flatbuffers_flatbuffers_test",
+ "libtextclassifier_fbgen_utils_grammar_rules",
+ "libtextclassifier_fbgen_utils_grammar_semantics_expression",
+ "libtextclassifier_fbgen_utils_grammar_testing_value",
+ "libtextclassifier_fbgen_utils_i18n_language-tag",
+ "libtextclassifier_fbgen_utils_intents_intent-config",
+ "libtextclassifier_fbgen_utils_lua_utils_tests",
+ "libtextclassifier_fbgen_utils_normalization",
+ "libtextclassifier_fbgen_utils_resources",
+ "libtextclassifier_fbgen_utils_tflite_text_encoder_config",
+ "libtextclassifier_fbgen_utils_tokenizer",
+ "libtextclassifier_fbgen_utils_zlib_buffer",
"tflite_support_metadata_schema",
"tflite_support_spm_config",
"tflite_support_spm_encoder_config",
- "gen_uwb_core_proto",
- "libtextclassifier_fbgen_utils_flatbuffers_flatbuffers_test",
- "libtextclassifier_fbgen_utils_lua_utils_tests",
- "libtextclassifier_fbgen_lang_id_common_flatbuffers_model",
- "libtextclassifier_fbgen_lang_id_common_flatbuffers_embedding-network",
- "libtextclassifier_fbgen_annotator_datetime_datetime",
- "libtextclassifier_fbgen_annotator_model",
- "libtextclassifier_fbgen_annotator_experimental_experimental",
- "libtextclassifier_fbgen_annotator_entity-data",
- "libtextclassifier_fbgen_annotator_person_name_person_name_model",
- "libtextclassifier_fbgen_utils_tflite_text_encoder_config",
- "libtextclassifier_fbgen_utils_codepoint-range",
- "libtextclassifier_fbgen_utils_intents_intent-config",
- "libtextclassifier_fbgen_utils_flatbuffers_flatbuffers",
- "libtextclassifier_fbgen_utils_zlib_buffer",
- "libtextclassifier_fbgen_utils_tokenizer",
- "libtextclassifier_fbgen_utils_grammar_rules",
- "libtextclassifier_fbgen_utils_grammar_semantics_expression",
- "libtextclassifier_fbgen_utils_resources",
- "libtextclassifier_fbgen_utils_i18n_language-tag",
- "libtextclassifier_fbgen_utils_normalization",
- "libtextclassifier_fbgen_utils_container_bit-vector",
- "libtextclassifier_fbgen_actions_actions-entity-data",
- "libtextclassifier_fbgen_actions_actions_model",
- "libtextclassifier_fbgen_utils_grammar_testing_value",
+ // go/keep-sorted end
}
SandboxingDenyModuleList = []string{
- "RsBalls-rscript",
- "pvmfw_fdt_template_rs",
- "RSTest_v14-rscript",
- "com.android.apex.test.bar_stripped",
- "com.android.apex.test.sharedlibs_secondary_generated",
- "ImageProcessingJB-rscript",
- "RSTest-rscript",
- "BluetoothGeneratedDumpsysBinarySchema_bfbs",
- "TracingVMProtoStub_h",
- "VehicleServerProtoStub_cc",
+ // go/keep-sorted start
"AudioFocusControlProtoStub_cc",
"AudioFocusControlProtoStub_h",
- "TracingVMProtoStub_cc",
- "VehicleServerProtoStub_h",
- "hidl2aidl_translate_cpp_test_gen_headers",
- "hidl2aidl_translate_cpp_test_gen_src",
- "hidl2aidl_translate_java_test_gen_src",
- "hidl2aidl_translate_ndk_test_gen_headers",
- "hidl2aidl_translate_ndk_test_gen_src",
- "hidl_hash_test_gen",
- "nos_app_avb_service_genc++",
- "nos_app_avb_service_genc++_headers",
- "nos_app_avb_service_genc++_mock",
- "nos_app_identity_service_genc++",
- "nos_app_keymaster_service_genc++",
- "nos_generator_test_service_genc++_headers",
- "nos_generator_test_service_genc++_mock",
- "r8retrace-run-retrace",
- "ltp_config_arm",
- "ltp_config_arm_64_hwasan",
- "ltp_config_arm_lowmem",
- "ltp_config_arm_64",
- "ltp_config_riscv_64",
- "ltp_config_x86_64",
- "vm-tests-tf-lib",
- "hidl_cpp_impl_test_gen-headers",
- "Refocus-rscript",
- "RSTest_v11-rscript",
- "RSTest_v16-rscript",
- "ScriptGroupTest-rscript",
- "ImageProcessing2-rscript",
- "ImageProcessing-rscript",
- "com.android.apex.test.pony_stripped",
- "com.android.apex.test.baz_stripped",
- "com.android.apex.test.foo_stripped",
- "com.android.apex.test.sharedlibs_generated",
"BlueberryFacadeAndCertGeneratedStub_py",
"BlueberryFacadeGeneratedStub_cc",
"BlueberryFacadeGeneratedStub_h",
+ "BluetoothGeneratedDumpsysBinarySchema_bfbs",
"BluetoothGeneratedDumpsysDataSchema_h",
- "c2hal_test_genc++",
- "c2hal_test_genc++_headers",
- "hidl2aidl_test_gen_aidl",
- "hidl_error_test_gen",
- "hidl_export_test_gen-headers",
- "hidl_format_test_diff",
- "hidl_hash_version_gen",
- "libbt_topshim_facade_py_proto",
- "nos_app_identity_service_genc++_headers",
- "nos_app_identity_service_genc++_mock",
- "nos_app_keymaster_service_genc++_headers",
- "nos_app_keymaster_service_genc++_mock",
- "nos_app_weaver_service_genc++",
- "nos_app_weaver_service_genc++_headers",
- "nos_app_weaver_service_genc++_mock",
- "nos_generator_test_service_genc++",
- "aidl_camera_build_version",
- "cronet_aml_base_android_runtime_unchecked_jni_headers",
- "cronet_aml_base_android_runtime_jni_headers",
- "aidl-golden-test-build-hook-gen",
- "PacketStreamerStub_h",
- "FrontendStub_cc",
- "FrontendStub_h",
- "PacketStreamerStub_cc",
- "pixelstatsatoms.h",
- "pixelatoms_defs.h",
- "pixelstatsatoms.cpp",
- "hidl_java_impl_test_gen",
- "cronet_aml_base_android_runtime_jni_headers__testing",
- "cronet_aml_base_android_runtime_unchecked_jni_headers__testing",
- "hidl_cpp_impl_test_gen-sources",
- "fdt_test_tree_multiple_memory_ranges_dtb",
- "fdt_test_tree_one_memory_range_dtb",
- "fdt_test_tree_empty_memory_range_dtb",
- "ltp_config_arm_64_lowmem",
- "ltp_config_arm_64_lowmem_hwasan",
- "ltp_config_x86",
- "libbssl_sys_src_nostd",
- "libcore-non-cts-tests-txt",
"ControlEnvProxyServerProto_cc",
"ControlEnvProxyServerProto_h",
- "camera-its",
- "android-cts-verifier",
"CtsApkVerityTestDebugFiles",
- "vm-tests-tf-lib",
- "egl_extensions_functions_hdr",
- "egl_functions_hdr",
- "gles1_core_functions_hdr",
- "gles1_extensions_functions_hdr",
- "gles2_core_functions_hdr",
- "gles2_extensions_functions_hdr",
- "gles31_only_functions_hdr",
- "gles3_only_functions_hdr",
- "angle_commit_id",
- "deqp_spvtools_update_build_version",
- "emp_ematch.yacc.c",
- "emp_ematch.yacc.h",
- "libchrome-crypto-include",
- "libchrome-include",
- "libmojo_jni_headers",
- "libxml2_schema_fuzz_corpus",
- "libxml2_xml_fuzz_corpus",
- "libc_musl_sysroot_bits",
- "awkgram.tab.h",
- "openwrt_rootfs_combined_aarch64",
- "openwrt_rootfs_combined_x86_64",
- "openwrt_rootfs_customization_aarch64",
- "openwrt_rootfs_customization_x86_64",
- "pandora-python-gen-src",
- "pdl_cxx_canonical_be_src_gen",
- "pdl_cxx_canonical_be_test_gen",
- "pdl_cxx_canonical_le_src_gen",
- "pdl_cxx_canonical_le_test_gen",
- "pdl_python_generator_be_test_gen",
- "pdl_python_generator_le_test_gen",
- "pdl_rust_noalloc_le_test_backend_srcs",
- "pdl_rust_noalloc_le_test_gen_harness",
- "swiftshader_spvtools_update_build_version",
- "uwb_core_artifacts",
- "futility_cmds",
+ "FrontendStub_cc",
+ "FrontendStub_h",
+ "HeadlessBuildTimestamp",
+ "ImageProcessing-rscript",
+ "ImageProcessing2-rscript",
+ "ImageProcessingJB-rscript",
"MultiDexLegacyTestApp_genrule",
- "com.android.overlaytest.overlaid.pem",
- "com.android.overlaytest.overlaid.pubkey",
- "com.android.overlaytest.overlay.pem",
- "com.android.overlaytest.overlay.pubkey",
- "wm_shell_protolog_src",
- "services.core.protologsrc",
"PackageManagerServiceServerTests_apks_as_resources",
- "wmtests.protologsrc",
- "com.android.apex.apkrollback.test.pem",
- "com.android.apex.apkrollback.test.pubkey",
+ "PacketStreamerStub_cc",
+ "PacketStreamerStub_h",
+ "RSTest-rscript",
+ "RSTest_v11-rscript",
+ "RSTest_v14-rscript",
+ "RSTest_v16-rscript",
+ "Refocus-rscript",
+ "RsBalls-rscript",
+ "ScriptGroupTest-rscript",
+ "TracingVMProtoStub_cc",
+ "TracingVMProtoStub_h",
"UpdatableSystemFontTest_NotoColorEmojiV0.sig",
"UpdatableSystemFontTest_NotoColorEmojiV0.ttf",
"UpdatableSystemFontTest_NotoColorEmojiVPlus1.sig",
"UpdatableSystemFontTest_NotoColorEmojiVPlus1.ttf",
"UpdatableSystemFontTest_NotoColorEmojiVPlus2.sig",
"UpdatableSystemFontTest_NotoColorEmojiVPlus2.ttf",
- "temp_layoutlib",
+ "VehicleServerProtoStub_cc",
+ "VehicleServerProtoStub_cc@2.0-grpc-trout",
+ "VehicleServerProtoStub_cc@default-grpc",
+ "VehicleServerProtoStub_h",
+ "VehicleServerProtoStub_h@2.0-grpc-trout",
+ "VehicleServerProtoStub_h@default-grpc",
+ "aidl-golden-test-build-hook-gen",
+ "aidl_camera_build_version",
+ "android-cts-verifier",
"android-support-multidex-instrumentation-version",
"android-support-multidex-version",
- "core-tests-smali-dex",
- "gd_hci_packets_python3_gen",
- "gd_smp_packets_python3_gen",
- "bluetooth_core_rust_packets",
- "HeadlessBuildTimestamp",
- "hci_packets_python3_gen",
- "link_layer_packets_python3_gen",
- "llcp_packets_python3_gen",
- "rootcanal_bredr_bb_packets_cxx_gen",
- "rootcanal_hci_packets_cxx_gen",
- "rootcanal_link_layer_packets_cxx_gen",
- "authfs_test_apk_assets",
- "measure_io_as_jar",
- "statsd-config-protos",
- "statsd-config-protos",
- "sample-profile-text-protos",
- "sample-profile-text-protos",
- "lib-test-profile-text-protos",
- "lib-test-profile-text-protos",
- "common-profile-text-protos",
- "common-profile-text-protos",
- "vndk_abi_dump_zip",
- "r8retrace-dexdump-sample-app",
- "gen_key_mismatch_capex",
- "gen_corrupt_rebootless_apex",
- "gen_corrupt_superblock_apex",
- "gen_manifest_mismatch_apex_no_hashtree",
+ "angle_commit_id",
"apexer_test_host_tools",
+ "atest_integration_fake_src",
+ "authfs_test_apk_assets",
+ "awkgram.tab.h",
+ "bluetooth_core_rust_packets",
+ "c2hal_test_genc++",
+ "c2hal_test_genc++_headers",
+ "camera-its",
+ "checkIn-service-stub-lite",
+ "chre_atoms_log.h",
+ "com.android.apex.apkrollback.test.pem",
+ "com.android.apex.apkrollback.test.pubkey",
"com.android.apex.cts.shim.debug.pem",
"com.android.apex.cts.shim.debug.pubkey",
"com.android.apex.cts.shim.pem",
@@ -241,27 +125,142 @@
"com.android.apex.cts.shim_not_pre_installed.pubkey",
"com.android.apex.rotation.key.bob.pem",
"com.android.apex.rotation.key.bob.pk8",
- "com.android.apex.rotation.key.bob.rot.rollback",
"com.android.apex.rotation.key.bob.rot",
+ "com.android.apex.rotation.key.bob.rot.rollback",
"com.android.apex.rotation.key.bob.x509.pem",
+ "com.android.apex.test.bar_stripped",
+ "com.android.apex.test.baz_stripped",
+ "com.android.apex.test.foo_stripped",
+ "com.android.apex.test.pony_stripped",
+ "com.android.apex.test.sharedlibs_generated",
+ "com.android.apex.test.sharedlibs_secondary_generated",
+ "com.android.overlaytest.overlaid.pem",
+ "com.android.overlaytest.overlaid.pubkey",
+ "com.android.overlaytest.overlay.pem",
+ "com.android.overlaytest.overlay.pubkey",
+ "common-profile-text-protos",
+ "core-tests-smali-dex",
+ "cronet_aml_base_android_runtime_jni_headers",
+ "cronet_aml_base_android_runtime_jni_headers__testing",
+ "cronet_aml_base_android_runtime_unchecked_jni_headers",
+ "cronet_aml_base_android_runtime_unchecked_jni_headers__testing",
+ "deqp_spvtools_update_build_version",
+ "egl_extensions_functions_hdr",
+ "egl_functions_hdr",
+ "emp_ematch.yacc.c",
+ "emp_ematch.yacc.h",
+ "fdt_test_tree_empty_memory_range_dtb",
+ "fdt_test_tree_multiple_memory_ranges_dtb",
+ "fdt_test_tree_one_memory_range_dtb",
+ "futility_cmds",
+ "gd_hci_packets_python3_gen",
+ "gd_smp_packets_python3_gen",
+ "gen_corrupt_rebootless_apex",
+ "gen_corrupt_superblock_apex",
+ "gen_key_mismatch_capex",
+ "gen_manifest_mismatch_apex_no_hashtree",
"generate_hash_v1",
- "ue_unittest_erofs_imgs",
- "ue_unittest_erofs_imgs",
- "ue_unittest_erofs_imgs",
- "vts_vndk_abi_dump_zip",
- "atest_integration_fake_src",
- "VehicleServerProtoStub_cc@2.0-grpc-trout",
- "VehicleServerProtoStub_cc@default-grpc",
- "VehicleServerProtoStub_h@default-grpc",
- "VehicleServerProtoStub_h@2.0-grpc-trout",
- "chre_atoms_log.h",
- "checkIn-service-stub-lite",
+ "gles1_core_functions_hdr",
+ "gles1_extensions_functions_hdr",
+ "gles2_core_functions_hdr",
+ "gles2_extensions_functions_hdr",
+ "gles31_only_functions_hdr",
+ "gles3_only_functions_hdr",
+ "hci_packets_python3_gen",
+ "hidl2aidl_test_gen_aidl",
+ "hidl2aidl_translate_cpp_test_gen_headers",
+ "hidl2aidl_translate_cpp_test_gen_src",
+ "hidl2aidl_translate_java_test_gen_src",
+ "hidl2aidl_translate_ndk_test_gen_headers",
+ "hidl2aidl_translate_ndk_test_gen_src",
+ "hidl_cpp_impl_test_gen-headers",
+ "hidl_cpp_impl_test_gen-sources",
+ "hidl_error_test_gen",
+ "hidl_export_test_gen-headers",
+ "hidl_format_test_diff",
+ "hidl_hash_test_gen",
+ "hidl_hash_version_gen",
+ "hidl_java_impl_test_gen",
+ "lib-test-profile-text-protos",
+ "libbssl_sys_src_nostd",
+ "libbt_topshim_facade_py_proto",
+ "libc_musl_sysroot_bits",
+ "libchrome-crypto-include",
+ "libchrome-include",
+ "libcore-non-cts-tests-txt",
+ "libmojo_jni_headers",
+ "libxml2_schema_fuzz_corpus",
+ "libxml2_xml_fuzz_corpus",
+ "link_layer_packets_python3_gen",
+ "llcp_packets_python3_gen",
+ "ltp_config_arm",
+ "ltp_config_arm_64",
+ "ltp_config_arm_64_hwasan",
+ "ltp_config_arm_64_lowmem",
+ "ltp_config_arm_64_lowmem_hwasan",
+ "ltp_config_arm_lowmem",
+ "ltp_config_riscv_64",
+ "ltp_config_x86",
+ "ltp_config_x86_64",
+ "measure_io_as_jar",
+ "nos_app_avb_service_genc++",
+ "nos_app_avb_service_genc++_headers",
+ "nos_app_avb_service_genc++_mock",
+ "nos_app_identity_service_genc++",
+ "nos_app_identity_service_genc++_headers",
+ "nos_app_identity_service_genc++_mock",
+ "nos_app_keymaster_service_genc++",
+ "nos_app_keymaster_service_genc++_headers",
+ "nos_app_keymaster_service_genc++_mock",
+ "nos_app_weaver_service_genc++",
+ "nos_app_weaver_service_genc++_headers",
+ "nos_app_weaver_service_genc++_mock",
+ "nos_generator_test_service_genc++",
+ "nos_generator_test_service_genc++_headers",
+ "nos_generator_test_service_genc++_mock",
+ "openwrt_rootfs_combined_aarch64",
+ "openwrt_rootfs_combined_x86_64",
+ "openwrt_rootfs_customization_aarch64",
+ "openwrt_rootfs_customization_x86_64",
+ "pandora-python-gen-src",
+ "pdl_cxx_canonical_be_src_gen",
+ "pdl_cxx_canonical_be_test_gen",
+ "pdl_cxx_canonical_le_src_gen",
+ "pdl_cxx_canonical_le_test_gen",
+ "pdl_python_generator_be_test_gen",
+ "pdl_python_generator_le_test_gen",
+ "pdl_rust_noalloc_le_test_backend_srcs",
+ "pdl_rust_noalloc_le_test_gen_harness",
+ "pixelatoms_defs.h",
+ "pixelstatsatoms.cpp",
+ "pixelstatsatoms.h",
+ "pvmfw_fdt_template_rs",
+ "r8retrace-dexdump-sample-app",
+ "r8retrace-run-retrace",
+ "rootcanal_bredr_bb_packets_cxx_gen",
+ "rootcanal_hci_packets_cxx_gen",
+ "rootcanal_link_layer_packets_cxx_gen",
+ "sample-profile-text-protos",
"seller-frontend-service-stub-lite",
+ "services.core.protologsrc",
+ "statsd-config-protos",
+ "swiftshader_spvtools_update_build_version",
+ "temp_layoutlib",
+ "ue_unittest_erofs_imgs",
+ "uwb_core_artifacts",
+ "vm-tests-tf-lib",
+ "vndk_abi_dump_zip",
+ "vts_vndk_abi_dump_zip",
+ "wm_shell_protolog_src",
+ "wmtests.protologsrc",
+ // go/keep-sorted end
}
SandboxingDenyPathList = []string{
+ // go/keep-sorted start
"art/test",
- "external/perfetto",
"external/cronet",
+ "external/perfetto",
+ // go/keep-sorted end
}
)
diff --git a/java/droidstubs.go b/java/droidstubs.go
index b059c0a..5432ce7 100644
--- a/java/droidstubs.go
+++ b/java/droidstubs.go
@@ -538,7 +538,9 @@
// Force metalava to sort overloaded methods by their order in the source code.
// See b/285312164 for more information.
- cmd.FlagWithArg("--format-defaults ", "overloaded-method-order=source")
+ // And add concrete overrides of abstract methods, see b/299366704 for more
+ // information.
+ cmd.FlagWithArg("--format-defaults ", "overloaded-method-order=source,add-additional-overrides=yes")
if ctx.DeviceConfig().HideFlaggedApis() {
cmd.FlagWithArg("--hide-annotation ", "android.annotation.FlaggedApi")
diff --git a/java/java.go b/java/java.go
index bde35e8..35fd7c2 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1087,6 +1087,10 @@
return true
}
+func (j *TestHost) IsNativeCoverageNeeded(ctx android.BaseModuleContext) bool {
+ return ctx.DeviceConfig().NativeCoverageEnabled()
+}
+
func (j *TestHost) addDataDeviceBinsDeps(ctx android.BottomUpMutatorContext) {
if len(j.testHostProperties.Data_device_bins_first) > 0 {
deviceVariations := ctx.Config().AndroidFirstDeviceTarget.Variations()
diff --git a/java/testing.go b/java/testing.go
index 0b7e685..4461351 100644
--- a/java/testing.go
+++ b/java/testing.go
@@ -73,10 +73,15 @@
// Needed for various deps defined in GatherRequiredDepsForTest()
defaultJavaDir + "/a.java": nil,
defaultJavaDir + "/api/current.txt": nil,
+ defaultJavaDir + "/api/removed.txt": nil,
defaultJavaDir + "/api/system-current.txt": nil,
+ defaultJavaDir + "/api/system-removed.txt": nil,
defaultJavaDir + "/api/test-current.txt": nil,
+ defaultJavaDir + "/api/test-removed.txt": nil,
defaultJavaDir + "/api/module-lib-current.txt": nil,
+ defaultJavaDir + "/api/module-lib-removed.txt": nil,
defaultJavaDir + "/api/system-server-current.txt": nil,
+ defaultJavaDir + "/api/system-server-removed.txt": nil,
// Needed for R8 rules on apps
"build/make/core/proguard.flags": nil,
@@ -425,80 +430,96 @@
`, extra)
}
- type apiContributionStruct struct {
- name string
- apiSurface string
- apiFile string
+ type droidstubsStruct struct {
+ name string
+ apiSurface string
+ apiFile string
+ removedFile string
}
- var publicApiContribution = apiContributionStruct{
- name: "api-stubs-docs-non-updatable.api.contribution",
- apiSurface: "public",
- apiFile: "api/current.txt",
+ var publicDroidstubs = droidstubsStruct{
+ name: "api-stubs-docs-non-updatable",
+ apiSurface: "public",
+ apiFile: "api/current.txt",
+ removedFile: "api/removed.txt",
}
- var systemApiContribution = apiContributionStruct{
- name: "system-api-stubs-docs-non-updatable.api.contribution",
- apiSurface: "system",
- apiFile: "api/system-current.txt",
+ var systemDroidstubs = droidstubsStruct{
+ name: "system-api-stubs-docs-non-updatable",
+ apiSurface: "system",
+ apiFile: "api/system-current.txt",
+ removedFile: "api/system-removed.txt",
}
- var testApiContribution = apiContributionStruct{
- name: "test-api-stubs-docs-non-updatable.api.contribution",
- apiSurface: "test",
- apiFile: "api/test-current.txt",
+ var testDroidstubs = droidstubsStruct{
+ name: "test-api-stubs-docs-non-updatable",
+ apiSurface: "test",
+ apiFile: "api/test-current.txt",
+ removedFile: "api/test-removed.txt",
}
- var moduleLibApiContribution = apiContributionStruct{
- name: "module-lib-api-stubs-docs-non-updatable.api.contribution",
- apiSurface: "module-lib",
- apiFile: "api/module-lib-current.txt",
+ var moduleLibDroidstubs = droidstubsStruct{
+ name: "module-lib-api-stubs-docs-non-updatable",
+ apiSurface: "module-lib",
+ apiFile: "api/module-lib-current.txt",
+ removedFile: "api/module-lib-removed.txt",
}
- var systemServerApiContribution = apiContributionStruct{
+ var systemServerDroidstubs = droidstubsStruct{
// This module does not exist but is named this way for consistency
- name: "system-server-api-stubs-docs-non-updatable.api.contribution",
- apiSurface: "system-server",
- apiFile: "api/system-server-current.txt",
+ name: "system-server-api-stubs-docs-non-updatable",
+ apiSurface: "system-server",
+ apiFile: "api/system-server-current.txt",
+ removedFile: "api/system-server-removed.txt",
}
- var apiContributionStructs = []apiContributionStruct{
- publicApiContribution,
- systemApiContribution,
- testApiContribution,
- moduleLibApiContribution,
- systemServerApiContribution,
+ var droidstubsStructs = []droidstubsStruct{
+ publicDroidstubs,
+ systemDroidstubs,
+ testDroidstubs,
+ moduleLibDroidstubs,
+ systemServerDroidstubs,
}
- extraApiLibraryModules := map[string]apiContributionStruct{
- "android_stubs_current.from-text": publicApiContribution,
- "android_system_stubs_current.from-text": systemApiContribution,
- "android_test_stubs_current.from-text": testApiContribution,
- "android_module_lib_stubs_current.from-text": moduleLibApiContribution,
- "android_module_lib_stubs_current_full.from-text": moduleLibApiContribution,
- "android_system_server_stubs_current.from-text": systemServerApiContribution,
- "core.current.stubs.from-text": publicApiContribution,
- "legacy.core.platform.api.stubs.from-text": publicApiContribution,
- "stable.core.platform.api.stubs.from-text": publicApiContribution,
- "core-lambda-stubs.from-text": publicApiContribution,
- "android-non-updatable.stubs.from-text": publicApiContribution,
- "android-non-updatable.stubs.system.from-text": systemApiContribution,
- "android-non-updatable.stubs.test.from-text": testApiContribution,
- "android-non-updatable.stubs.module_lib.from-text": moduleLibApiContribution,
+ extraApiLibraryModules := map[string]droidstubsStruct{
+ "android_stubs_current.from-text": publicDroidstubs,
+ "android_system_stubs_current.from-text": systemDroidstubs,
+ "android_test_stubs_current.from-text": testDroidstubs,
+ "android_module_lib_stubs_current.from-text": moduleLibDroidstubs,
+ "android_module_lib_stubs_current_full.from-text": moduleLibDroidstubs,
+ "android_system_server_stubs_current.from-text": systemServerDroidstubs,
+ "core.current.stubs.from-text": publicDroidstubs,
+ "legacy.core.platform.api.stubs.from-text": publicDroidstubs,
+ "stable.core.platform.api.stubs.from-text": publicDroidstubs,
+ "core-lambda-stubs.from-text": publicDroidstubs,
+ "android-non-updatable.stubs.from-text": publicDroidstubs,
+ "android-non-updatable.stubs.system.from-text": systemDroidstubs,
+ "android-non-updatable.stubs.test.from-text": testDroidstubs,
+ "android-non-updatable.stubs.module_lib.from-text": moduleLibDroidstubs,
}
- for _, apiContribution := range apiContributionStructs {
+ for _, droidstubs := range droidstubsStructs {
bp += fmt.Sprintf(`
- java_api_contribution {
+ droidstubs {
name: "%s",
api_surface: "%s",
- api_file: "%s",
+ check_api: {
+ current: {
+ api_file: "%s",
+ removed_api_file: "%s",
+ }
+ }
}
- `, apiContribution.name, apiContribution.apiSurface, apiContribution.apiFile)
+ `,
+ droidstubs.name,
+ droidstubs.apiSurface,
+ droidstubs.apiFile,
+ droidstubs.removedFile,
+ )
}
- for libName, apiContribution := range extraApiLibraryModules {
+ for libName, droidstubs := range extraApiLibraryModules {
bp += fmt.Sprintf(`
java_api_library {
name: "%s",
api_contributions: ["%s"],
}
- `, libName, apiContribution.name)
+ `, libName, droidstubs.name+".api.contribution")
}
bp += `
@@ -553,7 +574,7 @@
return bp
}
-func CheckModuleDependencies(t *testing.T, ctx *android.TestContext, name, variant string, expected []string) {
+func getModuleDependencies(t *testing.T, ctx *android.TestContext, name, variant string) []string {
t.Helper()
module := ctx.ModuleForTests(name, variant).Module()
deps := []string{}
@@ -562,11 +583,29 @@
})
sort.Strings(deps)
+ return deps
+}
+
+// CheckModuleDependencies checks if the expected dependencies of the module are
+// identical to the actual dependencies.
+func CheckModuleDependencies(t *testing.T, ctx *android.TestContext, name, variant string, expected []string) {
+ deps := getModuleDependencies(t, ctx, name, variant)
+
if actual := deps; !reflect.DeepEqual(expected, actual) {
t.Errorf("expected %#q, found %#q", expected, actual)
}
}
+// CheckModuleHasDependency returns true if the module depends on the expected dependency.
+func CheckModuleHasDependency(t *testing.T, ctx *android.TestContext, name, variant string, expected string) bool {
+ for _, dep := range getModuleDependencies(t, ctx, name, variant) {
+ if dep == expected {
+ return true
+ }
+ }
+ return false
+}
+
// CheckPlatformBootclasspathModules returns the apex:module pair for the modules depended upon by
// the platform-bootclasspath module.
func CheckPlatformBootclasspathModules(t *testing.T, result *android.TestResult, name string, expected []string) {
diff --git a/tests/b_args_test.sh b/tests/b_args_test.sh
new file mode 100755
index 0000000..0dfbabf
--- /dev/null
+++ b/tests/b_args_test.sh
@@ -0,0 +1,43 @@
+#!/bin/bash -eu
+
+# This file tests the creation of bazel commands for b usage
+set -o pipefail
+source "$(dirname "$0")/../../bazel/lib.sh"
+
+BES_UUID="blank"
+OUT_DIR="arbitrary_out"
+b_args=$(formulate_b_args "build --config=nonsense foo:bar")
+
+if [[ $b_args != "build --profile=$OUT_DIR/bazel_metrics-profile --config=bp2build --invocation_id=$BES_UUID --config=metrics_data --config=nonsense foo:bar" ]]; then
+ echo "b args are malformed"
+ echo "Expected : build --profile=$OUT_DIR/bazel_metrics-profile --config=bp2build --invocation_id=$BES_UUID --config=metrics_data --config=nonsense foo:bar"
+ echo "Actual: $b_args"
+ exit 1
+fi
+
+b_args=$(formulate_b_args "build --config=nonsense --disable_bes --package_path \"my package\" foo:bar")
+
+if [[ $b_args != "build --profile=$OUT_DIR/bazel_metrics-profile --config=bp2build --invocation_id=$BES_UUID --config=nonsense --package_path \"my package\" foo:bar" ]]; then
+ echo "b args are malformed"
+ echo "Expected : build --profile=$OUT_DIR/bazel_metrics-profile --config=bp2build --invocation_id=$BES_UUID --config=nonsense --package_path \"my package\" foo:bar"
+ echo "Actual: $b_args"
+ exit 1
+fi
+
+# Test with startup option
+b_args=$(formulate_b_args "--batch build --config=nonsense --disable_bes --package_path \"my package\" foo:bar")
+if [[ $b_args != "--batch build --profile=$OUT_DIR/bazel_metrics-profile --config=bp2build --invocation_id=$BES_UUID --config=nonsense --package_path \"my package\" foo:bar" ]]; then
+ echo "b args are malformed"
+ echo "Expected : --batch build --profile=$OUT_DIR/bazel_metrics-profile --config=bp2build --invocation_id=$BES_UUID --config=nonsense --package_path \"my package\" foo:bar"
+ echo "Actual: $b_args"
+ exit 1
+fi
+
+OUT_DIR="mock_out"
+TEST_PROFILE_OUT=$(get_profile_out_dir)
+if [[ $TEST_PROFILE_OUT != "mock_out" ]]; then
+ echo "Profile Out is malformed."
+ echo "Expected: mock_out"
+ echo "Actual: $TEST_PROFILE_OUT"
+ exit 1
+fi
diff --git a/tests/lib.sh b/tests/lib.sh
index fb3b374..e0b319e 100644
--- a/tests/lib.sh
+++ b/tests/lib.sh
@@ -16,7 +16,7 @@
if [[ -n "$HARDWIRED_MOCK_TOP" ]]; then
MOCK_TOP="$HARDWIRED_MOCK_TOP"
else
- MOCK_TOP=$(mktemp -t -d st.XXXXX)
+ MOCK_TOP=$(make_mock_top)
trap cleanup_mock_top EXIT
fi
diff --git a/tests/run_integration_tests.sh b/tests/run_integration_tests.sh
index 8045591..231e18b 100755
--- a/tests/run_integration_tests.sh
+++ b/tests/run_integration_tests.sh
@@ -4,6 +4,7 @@
TOP="$(readlink -f "$(dirname "$0")"/../../..)"
"$TOP/build/soong/tests/androidmk_test.sh"
+"$TOP/build/soong/tests/b_args_test.sh"
"$TOP/build/soong/tests/bootstrap_test.sh"
"$TOP/build/soong/tests/mixed_mode_test.sh"
"$TOP/build/soong/tests/bp2build_bazel_test.sh"
diff --git a/ui/build/config.go b/ui/build/config.go
index f80868c..2e5921a 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -1349,6 +1349,19 @@
return v
}
}
+ return c.rbeTmpDir()
+}
+
+func (c *configImpl) rbeDownloadTmpDir() string {
+ for _, f := range []string{"RBE_download_tmp_dir", "FLAG_download_tmp_dir"} {
+ if v, ok := c.environ.Get(f); ok {
+ return v
+ }
+ }
+ return c.rbeTmpDir()
+}
+
+func (c *configImpl) rbeTmpDir() string {
buildTmpDir := shared.TempDirForOutDir(c.SoongOutDir())
return filepath.Join(buildTmpDir, "rbe")
}
diff --git a/ui/build/rbe.go b/ui/build/rbe.go
index 3b9d301..19a54df 100644
--- a/ui/build/rbe.go
+++ b/ui/build/rbe.go
@@ -55,13 +55,14 @@
func getRBEVars(ctx Context, config Config) map[string]string {
vars := map[string]string{
- "RBE_log_dir": config.rbeProxyLogsDir(),
- "RBE_re_proxy": config.rbeReproxy(),
- "RBE_exec_root": config.rbeExecRoot(),
- "RBE_output_dir": config.rbeProxyLogsDir(),
- "RBE_proxy_log_dir": config.rbeProxyLogsDir(),
- "RBE_cache_dir": config.rbeCacheDir(),
- "RBE_platform": "container-image=" + remoteexec.DefaultImage,
+ "RBE_log_dir": config.rbeProxyLogsDir(),
+ "RBE_re_proxy": config.rbeReproxy(),
+ "RBE_exec_root": config.rbeExecRoot(),
+ "RBE_output_dir": config.rbeProxyLogsDir(),
+ "RBE_proxy_log_dir": config.rbeProxyLogsDir(),
+ "RBE_cache_dir": config.rbeCacheDir(),
+ "RBE_download_tmp_dir": config.rbeDownloadTmpDir(),
+ "RBE_platform": "container-image=" + remoteexec.DefaultImage,
}
if config.StartRBE() {
name, err := config.rbeSockAddr(absPath(ctx, config.TempDir()))