From 2c6b4acb87f989c5910f8e0b7135ccb9725f7f3e Mon Sep 17 00:00:00 2001 From: Aditya Kumar Date: Thu, 12 Sep 2024 18:40:17 +0000 Subject: [PATCH 1/5] Disable -Wno-deprecated-dynamic-exception-spec until the warning is fixed in libc++abi header files Test: mmma art/libnativeloader Bug: b/366180429 Change-Id: Ie77f9dc674224044d5c7078db891f88e42a52a19 --- cc/config/global.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cc/config/global.go b/cc/config/global.go index c83835712..9d3de6d68 100644 --- a/cc/config/global.go +++ b/cc/config/global.go @@ -286,6 +286,8 @@ var ( // New warnings to be fixed after clang-r468909 "-Wno-error=deprecated-builtins", // http://b/241601211 "-Wno-error=deprecated", // in external/googletest/googletest + // Disabling until the warning is fixed in libc++abi header files b/366180429 + "-Wno-deprecated-dynamic-exception-spec", // New warnings to be fixed after clang-r475365 "-Wno-error=enum-constexpr-conversion", // http://b/243964282 // New warnings to be fixed after clang-r522817 From dfc02f81fc90702b6e05c4729002dc77c9fd87cf Mon Sep 17 00:00:00 2001 From: Neill Kapron Date: Fri, 13 Sep 2024 17:55:12 +0000 Subject: [PATCH 2/5] BPF: rename bpf_defaults to bpf_cc_defaults With the addition of defaults to the bpf soong module (see aosp/3249485 ), the name `bpf_defaults` will be used to define defaults for bpf program compilation. While there are separate soong namespaces for module types and module names, rename the existing bpf_defaults cc_defaults to bpf_cc_defaults for clarity. While we're at it, add -Wextra, and cleanup unnecessary cflags in clauses which use bpf_cc_defaults. Test: TH Change-Id: Ib5f453ce33b13c698e8b91088bc59f8c6719c892 Signed-off-by: Neill Kapron --- docs/tidy.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tidy.md b/docs/tidy.md index ae0ca9360..2e4c9579d 100644 --- a/docs/tidy.md +++ b/docs/tidy.md @@ -38,7 +38,7 @@ For example, in clang-tidy is enabled explicitly and with a different check list: ``` cc_defaults { - name: "bpf_defaults", + name: "bpf_cc_defaults", // snipped tidy: true, tidy_checks: [ @@ -52,7 +52,7 @@ cc_defaults { } ``` That means in normal builds, even without `WITH_TIDY=1`, -the modules that use `bpf_defaults` _should_ run clang-tidy +the modules that use `bpf_cc_defaults` _should_ run clang-tidy over C/C++ source files with the given `tidy_checks`. However since clang-tidy warnings and its runtime cost might From ce6ddd6e24567af2650ad2c8558461a52e9f819a Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Fri, 13 Sep 2024 11:51:02 -0700 Subject: [PATCH 3/5] Add links to partner docs for presigned apks So if a partner gets this error they can find the script and see links to documentation. Test: Presubmits Change-Id: I50cbe4770e9619fb67a7a586fa6d2210c67d4650 --- scripts/check_prebuilt_presigned_apk.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/check_prebuilt_presigned_apk.py b/scripts/check_prebuilt_presigned_apk.py index abab2e146..db64f90c6 100755 --- a/scripts/check_prebuilt_presigned_apk.py +++ b/scripts/check_prebuilt_presigned_apk.py @@ -36,7 +36,7 @@ def has_preprocessed_issues(args, *, fail=False): if fail: sys.exit(args.apk + ': Contains compressed JNI libraries') return True - # It's ok for non-privileged apps to have compressed dex files, see go/gms-uncompressed-jni-slides + # It's ok for non-privileged apps to have compressed dex files if args.privileged and args.uncompress_priv_app_dex: if info.filename.endswith('.dex') and info.compress_type != zipfile.ZIP_STORED: if fail: @@ -46,6 +46,10 @@ def has_preprocessed_issues(args, *, fail=False): def main(): + # This script enforces requirements for presigned apps as documented in: + # go/gms-uncompressed-jni-slides + # https://docs.partner.android.com/gms/building/integrating/jni-libs + # https://docs.partner.android.com/gms/policies/domains/mba#jni-lib parser = argparse.ArgumentParser() parser.add_argument('--aapt2', help = "the path to the aapt2 executable") parser.add_argument('--zipalign', help = "the path to the zipalign executable") From d706709bf07e4a37093917c29e68151a0b14e441 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Fri, 13 Sep 2024 13:37:59 -0700 Subject: [PATCH 4/5] Prevent evaluating configurable properties before the defaults mutator So that we can change the configuration after the defaults mutator has run. Bug: 361816274 Test: Presubmits Change-Id: I550088b2555d275a86b5dd4d57e85a9ece859233 --- android/module.go | 7 +++++++ android/packaging_test.go | 1 + 2 files changed, 8 insertions(+) diff --git a/android/module.go b/android/module.go index 491c295fb..dd83d6407 100644 --- a/android/module.go +++ b/android/module.go @@ -2215,6 +2215,7 @@ func (m *ModuleBase) IsNativeBridgeSupported() bool { type ConfigurableEvaluatorContext interface { Config() Config OtherModulePropertyErrorf(module Module, property string, fmt string, args ...interface{}) + HasMutatorFinished(mutatorName string) bool } type configurationEvalutor struct { @@ -2236,6 +2237,12 @@ func (e configurationEvalutor) PropertyErrorf(property string, fmt string, args func (e configurationEvalutor) EvaluateConfiguration(condition proptools.ConfigurableCondition, property string) proptools.ConfigurableValue { ctx := e.ctx m := e.m + + if !ctx.HasMutatorFinished("defaults") { + ctx.OtherModulePropertyErrorf(m, property, "Cannot evaluate configurable property before the defaults mutator has run") + return proptools.ConfigurableValueUndefined() + } + switch condition.FunctionName() { case "release_flag": if condition.NumArgs() != 1 { diff --git a/android/packaging_test.go b/android/packaging_test.go index 0f7bb39a1..f5b1020fc 100644 --- a/android/packaging_test.go +++ b/android/packaging_test.go @@ -118,6 +118,7 @@ func runPackagingTest(t *testing.T, config testConfig, bp string, expected []str } result := GroupFixturePreparers( + PrepareForTestWithDefaults, PrepareForTestWithArchMutator, FixtureRegisterWithContext(func(ctx RegistrationContext) { ctx.RegisterModuleType("component", componentTestModuleFactory) From 680cd73e1ac58b3e4f0b4f73f2066a1961083920 Mon Sep 17 00:00:00 2001 From: John Wu Date: Fri, 13 Sep 2024 20:59:05 +0000 Subject: [PATCH 5/5] [Ravenwood] Support fonts files and data files Add support to include font files into ravenwood_libgroup. Also make ravenwood data property to accept paths instead of module name. Bug: 292141694 Flag: EXEMPT host side change only Test: $ANDROID_BUILD_TOP/frameworks/base/ravenwood/scripts/run-ravenwood-tests.sh Change-Id: Ida5ef0230d2cc59fa1209199168c6c35e4842fbd --- java/ravenwood.go | 20 ++++++++------ java/ravenwood_test.go | 59 +++++++++++++++++++++++++----------------- 2 files changed, 47 insertions(+), 32 deletions(-) diff --git a/java/ravenwood.go b/java/ravenwood.go index bb136cf6e..3fa73e64d 100644 --- a/java/ravenwood.go +++ b/java/ravenwood.go @@ -33,7 +33,6 @@ func RegisterRavenwoodBuildComponents(ctx android.RegistrationContext) { var ravenwoodLibContentTag = dependencyTag{name: "ravenwoodlibcontent"} var ravenwoodUtilsTag = dependencyTag{name: "ravenwoodutils"} var ravenwoodRuntimeTag = dependencyTag{name: "ravenwoodruntime"} -var ravenwoodDataTag = dependencyTag{name: "ravenwooddata"} var ravenwoodTestResourceApkTag = dependencyTag{name: "ravenwoodtestresapk"} const ravenwoodUtilsName = "ravenwood-utils" @@ -228,7 +227,10 @@ type ravenwoodLibgroupProperties struct { Jni_libs []string // We use this to copy framework-res.apk to the ravenwood runtime directory. - Data []string + Data []string `android:"path,arch_variant"` + + // We use this to copy font files to the ravenwood runtime directory. + Fonts []string `android:"path,arch_variant"` } type ravenwoodLibgroup struct { @@ -267,9 +269,6 @@ func (r *ravenwoodLibgroup) DepsMutator(ctx android.BottomUpMutatorContext) { for _, lib := range r.ravenwoodLibgroupProperties.Jni_libs { ctx.AddVariationDependencies(ctx.Config().BuildOSTarget.Variations(), jniLibTag, lib) } - for _, data := range r.ravenwoodLibgroupProperties.Data { - ctx.AddVariationDependencies(nil, ravenwoodDataTag, data) - } } func (r *ravenwoodLibgroup) GenerateAndroidBuildActions(ctx android.ModuleContext) { @@ -309,12 +308,17 @@ func (r *ravenwoodLibgroup) GenerateAndroidBuildActions(ctx android.ModuleContex } dataInstallPath := installPath.Join(ctx, "ravenwood-data") - for _, data := range r.ravenwoodLibgroupProperties.Data { - libModule := ctx.GetDirectDepWithTag(data, ravenwoodDataTag) - file := android.OutputFileForModule(ctx, libModule, "") + data := android.PathsForModuleSrc(ctx, r.ravenwoodLibgroupProperties.Data) + for _, file := range data { ctx.InstallFile(dataInstallPath, file.Base(), file) } + fontsInstallPath := installPath.Join(ctx, "fonts") + fonts := android.PathsForModuleSrc(ctx, r.ravenwoodLibgroupProperties.Fonts) + for _, file := range fonts { + ctx.InstallFile(fontsInstallPath, file.Base(), file) + } + // Normal build should perform install steps ctx.Phony(r.BaseModuleName(), android.PathForPhony(ctx, r.BaseModuleName()+"-install")) } diff --git a/java/ravenwood_test.go b/java/ravenwood_test.go index d26db930d..0a1b08926 100644 --- a/java/ravenwood_test.go +++ b/java/ravenwood_test.go @@ -19,6 +19,7 @@ import ( "testing" "android/soong/android" + "android/soong/etc" ) var prepareRavenwoodRuntime = android.GroupFixturePreparers( @@ -59,11 +60,15 @@ var prepareRavenwoodRuntime = android.GroupFixturePreparers( } android_app { name: "app1", - sdk_version: "current", + sdk_version: "current", } android_app { name: "app2", - sdk_version: "current", + sdk_version: "current", + } + prebuilt_font { + name: "Font.ttf", + src: "Font.ttf", } android_ravenwood_libgroup { name: "ravenwood-runtime", @@ -76,7 +81,10 @@ var prepareRavenwoodRuntime = android.GroupFixturePreparers( "ravenwood-runtime-jni2", ], data: [ - "app1", + ":app1", + ], + fonts: [ + ":Font.ttf" ], } android_ravenwood_libgroup { @@ -97,6 +105,7 @@ func TestRavenwoodRuntime(t *testing.T) { ctx := android.GroupFixturePreparers( PrepareForIntegrationTestWithJava, + etc.PrepareForTestWithPrebuiltEtc, prepareRavenwoodRuntime, ).RunTest(t) @@ -114,6 +123,7 @@ func TestRavenwoodRuntime(t *testing.T) { runtime.Output(installPathPrefix + "/ravenwood-runtime/lib64/libred.so") runtime.Output(installPathPrefix + "/ravenwood-runtime/lib64/ravenwood-runtime-jni3.so") runtime.Output(installPathPrefix + "/ravenwood-runtime/ravenwood-data/app1.apk") + runtime.Output(installPathPrefix + "/ravenwood-runtime/fonts/Font.ttf") utils := ctx.ModuleForTests("ravenwood-utils", "android_common") utils.Output(installPathPrefix + "/ravenwood-utils/framework-rules.ravenwood.jar") } @@ -125,29 +135,30 @@ func TestRavenwoodTest(t *testing.T) { ctx := android.GroupFixturePreparers( PrepareForIntegrationTestWithJava, + etc.PrepareForTestWithPrebuiltEtc, prepareRavenwoodRuntime, ).RunTestWithBp(t, ` - cc_library_shared { - name: "jni-lib1", - host_supported: true, - srcs: ["jni.cpp"], - } - cc_library_shared { - name: "jni-lib2", - host_supported: true, - srcs: ["jni.cpp"], - stem: "libblue", - shared_libs: [ - "jni-lib3", - ], - } - cc_library_shared { - name: "jni-lib3", - host_supported: true, - srcs: ["jni.cpp"], - stem: "libpink", - } - android_ravenwood_test { + cc_library_shared { + name: "jni-lib1", + host_supported: true, + srcs: ["jni.cpp"], + } + cc_library_shared { + name: "jni-lib2", + host_supported: true, + srcs: ["jni.cpp"], + stem: "libblue", + shared_libs: [ + "jni-lib3", + ], + } + cc_library_shared { + name: "jni-lib3", + host_supported: true, + srcs: ["jni.cpp"], + stem: "libpink", + } + android_ravenwood_test { name: "ravenwood-test", srcs: ["Test.java"], jni_libs: [