Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bda5850a authored by Liz Kammer's avatar Liz Kammer Committed by Gerrit Code Review
Browse files

Merge changes from topic "libbuildversion-directly"

* changes:
  Allowlist aapt2 deps.
  Add libbuildversion in converion instead of macro
parents 59c33ac8 09d831ec
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -165,10 +165,12 @@ var (
		"frameworks/av/media/liberror":                       Bp2BuildDefaultTrueRecursively,
		"frameworks/av/services/minijail":                    Bp2BuildDefaultTrueRecursively,
		"frameworks/av/media/module/minijail":                Bp2BuildDefaultTrueRecursively,
		"frameworks/base/libs/androidfw":                     Bp2BuildDefaultTrue,
		"frameworks/base/media/tests/MediaDump":              Bp2BuildDefaultTrue,
		"frameworks/base/services/tests/servicestests/aidl":  Bp2BuildDefaultTrue,
		"frameworks/base/startop/apps/test":                  Bp2BuildDefaultTrue,
		"frameworks/base/tests/appwidgets/AppWidgetHostTest": Bp2BuildDefaultTrueRecursively,
		"frameworks/base/tools/aapt2":                        Bp2BuildDefaultTrue,
		"frameworks/native/libs/adbd_auth":                   Bp2BuildDefaultTrueRecursively,
		"frameworks/native/libs/arect":                       Bp2BuildDefaultTrueRecursively,
		"frameworks/native/libs/math":                        Bp2BuildDefaultTrueRecursively,
@@ -261,6 +263,7 @@ var (
		"system/core/libvndksupport":                             Bp2BuildDefaultTrueRecursively,
		"system/core/property_service/libpropertyinfoparser":     Bp2BuildDefaultTrueRecursively,
		"system/core/property_service/libpropertyinfoserializer": Bp2BuildDefaultTrueRecursively,
		"system/incremental_delivery/incfs":                      Bp2BuildDefaultTrue,
		"system/libartpalette":                                   Bp2BuildDefaultTrueRecursively,
		"system/libbase":                                         Bp2BuildDefaultTrueRecursively,
		"system/libfmq":                                          Bp2BuildDefaultTrue,
@@ -289,8 +292,8 @@ var (
		"system/testing/gtest_extras":                            Bp2BuildDefaultTrueRecursively,
		"system/timezone/apex":                                   Bp2BuildDefaultTrueRecursively,
		"system/timezone/output_data":                            Bp2BuildDefaultTrueRecursively,
		"system/tools/sysprop":                                   Bp2BuildDefaultTrue,
		"system/tools/aidl/build/tests_bp2build":                 Bp2BuildDefaultTrue,
		"system/tools/sysprop":                                   Bp2BuildDefaultTrue,
		"system/unwinding/libunwindstack":                        Bp2BuildDefaultTrueRecursively,

		"frameworks/proto_logging/stats": Bp2BuildDefaultTrueRecursively,
@@ -339,6 +342,8 @@ var (
	}

	Bp2buildModuleAlwaysConvertList = []string{
		"libidmap2_policies",
		"libSurfaceFlingerProp",
		// cc mainline modules
		"code_coverage.policy",
		"code_coverage.policy.other",
@@ -380,7 +385,6 @@ var (
		"libgraphicsenv",
		"libhardware",
		"libhardware_headers",
		"libincfs_headers",
		"libnativeloader-headers",
		"libnativewindow_headers",
		"libneuralnetworks_headers",
@@ -564,15 +568,16 @@ var (
		"auto_value_plugin_resources",      // TODO(b/210751803), we don't handle path property for filegroups

		// go deps:
		"aapt2-protos",                                                                               // depends on soong_zip, a go binary
		"analyze_bcpf",                                                                               // depends on bpmodify a blueprint_go_binary.
		"apex-protos",                                                                                // depends on soong_zip, a go binary
		"generated_android_icu4j_src_files", "generated_android_icu4j_test_files", "icu4c_test_data", // depends on unconverted modules: soong_zip
		"host_bionic_linker_asm",                                                  // depends on extract_linker, a go binary.
		"host_bionic_linker_script",                                               // depends on extract_linker, a go binary.
		"libc_musl_sysroot_bionic_arch_headers",                                   // depends on soong_zip
		"libc_musl_sysroot_zlib_headers",                                          // depends on soong_zip and zip2zip
		"libc_musl_sysroot_bionic_headers",                                        // 218405924, depends on soong_zip and generates duplicate srcs
		"libc_musl_sysroot_libc++_headers", "libc_musl_sysroot_libc++abi_headers", // depends on soong_zip, zip2zip
		"libc_musl_sysroot_zlib_headers", // depends on soong_zip and zip2zip
		"robolectric-sqlite4java-native", // depends on soong_zip, a go binary
		"robolectric_tzdata",             // depends on soong_zip, a go binary

@@ -628,6 +633,9 @@ var (
		// '//bionic/libc:libc_bp2build_cc_library_static' is duplicated in the 'deps' attribute of rule
		"toybox-static",

		// aidl files not created
		"overlayable_policy_aidl_interface",

		// cc_test related.
		// Failing host cc_tests
		"memunreachable_unit_test",
@@ -652,6 +660,8 @@ var (
		"libnativebridge6-test-case",
		"libnativebridge6prezygotefork",

		"libandroidfw_tests", "aapt2_tests", // failing due to data path issues

		// cc_test with unconverted deps, or are device-only (and not verified to pass yet)
		"AMRWBEncTest",
		"AmrnbDecoderTest",     // depends on unconverted modules: libaudioutils, libsndfile
+10 −3
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ func generateBazelTargetsForTest(targets []testBazelTarget, hod android.HostOrDe

type ccBinaryBp2buildTestCase struct {
	description string
	filesystem  map[string]string
	blueprint   string
	targets     []testBazelTarget
}
@@ -79,6 +80,7 @@ func runCcBinaryTestCase(t *testing.T, testCase ccBinaryBp2buildTestCase) {
			ModuleTypeUnderTestFactory: cc.BinaryFactory,
			Description:                description,
			Blueprint:                  binaryReplacer.Replace(testCase.blueprint),
			Filesystem:                 testCase.filesystem,
		})
	})
}
@@ -94,6 +96,7 @@ func runCcHostBinaryTestCase(t *testing.T, testCase ccBinaryBp2buildTestCase) {
			ModuleTypeUnderTestFactory: cc.BinaryHostFactory,
			Description:                description,
			Blueprint:                  hostBinaryReplacer.Replace(testCase.blueprint),
			Filesystem:                 testCase.filesystem,
		})
	})
}
@@ -101,6 +104,9 @@ func runCcHostBinaryTestCase(t *testing.T, testCase ccBinaryBp2buildTestCase) {
func TestBasicCcBinary(t *testing.T) {
	runCcBinaryTests(t, ccBinaryBp2buildTestCase{
		description: "basic -- properties -> attrs with little/no transformation",
		filesystem: map[string]string{
			soongCcVersionLibBpPath: soongCcVersionLibBp,
		},
		blueprint: `
{rule_name} {
    name: "foo",
@@ -149,6 +155,7 @@ func TestBasicCcBinary(t *testing.T) {
				"sdk_version":        `"current"`,
				"min_sdk_version":    `"29"`,
				"use_version_lib":    `True`,
				"whole_archive_deps": `["//build/soong/cc/libbuildversion:libbuildversion"]`,
			},
			},
		},
+19 −7
Original line number Diff line number Diff line
@@ -27,7 +27,16 @@ const (
	soongCcLibraryPreamble = `
cc_defaults {
    name: "linux_bionic_supported",
}`
}
`

	soongCcVersionLibBpPath = "build/soong/cc/libbuildversion/Android.bp"
	soongCcVersionLibBp     = `
cc_library_static {
	name: "libbuildversion",
	bazel_module: { bp2build_available: false },
}
`

	soongCcProtoLibraries = `
cc_library {
@@ -62,6 +71,7 @@ func TestCcLibrarySimple(t *testing.T) {
		ModuleTypeUnderTest:        "cc_library",
		ModuleTypeUnderTestFactory: cc.LibraryFactory,
		Filesystem: map[string]string{
			soongCcVersionLibBpPath: soongCcVersionLibBp,
			"android.cpp":           "",
			"bionic.cpp":            "",
			"darwin.cpp":            "",
@@ -146,6 +156,7 @@ cc_library {
			"sdk_version":                       `"current"`,
			"min_sdk_version":                   `"29"`,
			"use_version_lib":                   `True`,
			"implementation_whole_archive_deps": `["//build/soong/cc/libbuildversion:libbuildversion"]`,
		}),
	})
}
@@ -1337,6 +1348,7 @@ func makeCcLibraryTargets(name string, attrs AttrNameToString) []string {
		"strip":                    true,
		"inject_bssl_hash":         true,
		"has_stubs":                true,
		"use_version_lib":          true,
	}

	sharedAttrs := AttrNameToString{}
+5 −1
Original line number Diff line number Diff line
@@ -454,6 +454,9 @@ func TestCcLibrarySharedProto(t *testing.T) {

func TestCcLibrarySharedUseVersionLib(t *testing.T) {
	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
		Filesystem: map[string]string{
			soongCcVersionLibBpPath: soongCcVersionLibBp,
		},
		Blueprint: soongCcProtoPreamble + `cc_library_shared {
        name: "foo",
        use_version_lib: true,
@@ -462,6 +465,7 @@ func TestCcLibrarySharedUseVersionLib(t *testing.T) {
		ExpectedBazelTargets: []string{
			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
				"use_version_lib":                   "True",
				"implementation_whole_archive_deps": `["//build/soong/cc/libbuildversion:libbuildversion"]`,
			}),
		},
	})
+24 −1
Original line number Diff line number Diff line
@@ -1485,14 +1485,37 @@ func TestCcLibraryStaticProto(t *testing.T) {

func TestCcLibraryStaticUseVersionLib(t *testing.T) {
	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
		Filesystem: map[string]string{
			soongCcVersionLibBpPath: soongCcVersionLibBp,
		},
		Blueprint: soongCcProtoPreamble + `cc_library_static {
	name: "foo",
	use_version_lib: true,
	static_libs: ["libbuildversion"],
	include_build_directory: false,
}`,
		ExpectedBazelTargets: []string{
			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
				"implementation_whole_archive_deps": `["//build/soong/cc/libbuildversion:libbuildversion"]`,
			}),
		},
	})
}

func TestCcLibraryStaticUseVersionLibHasDep(t *testing.T) {
	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
		Filesystem: map[string]string{
			soongCcVersionLibBpPath: soongCcVersionLibBp,
		},
		Blueprint: soongCcProtoPreamble + `cc_library_static {
	name: "foo",
	use_version_lib: true,
	whole_static_libs: ["libbuildversion"],
	include_build_directory: false,
}`,
		ExpectedBazelTargets: []string{
			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
				"use_version_lib": "True",
				"whole_archive_deps": `["//build/soong/cc/libbuildversion:libbuildversion"]`,
			}),
		},
	})
Loading