Snap for 12369952 from 19256badc5 to 24Q4-release

Change-Id: I1fde3b7302ca549d25945af7e6836c48222d5b53
This commit is contained in:
Android Build Coastguard Worker
2024-09-14 22:35:19 +00:00
7 changed files with 64 additions and 35 deletions

View File

@@ -2215,6 +2215,7 @@ func (m *ModuleBase) IsNativeBridgeSupported() bool {
type ConfigurableEvaluatorContext interface { type ConfigurableEvaluatorContext interface {
Config() Config Config() Config
OtherModulePropertyErrorf(module Module, property string, fmt string, args ...interface{}) OtherModulePropertyErrorf(module Module, property string, fmt string, args ...interface{})
HasMutatorFinished(mutatorName string) bool
} }
type configurationEvalutor struct { 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 { func (e configurationEvalutor) EvaluateConfiguration(condition proptools.ConfigurableCondition, property string) proptools.ConfigurableValue {
ctx := e.ctx ctx := e.ctx
m := e.m 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() { switch condition.FunctionName() {
case "release_flag": case "release_flag":
if condition.NumArgs() != 1 { if condition.NumArgs() != 1 {

View File

@@ -118,6 +118,7 @@ func runPackagingTest(t *testing.T, config testConfig, bp string, expected []str
} }
result := GroupFixturePreparers( result := GroupFixturePreparers(
PrepareForTestWithDefaults,
PrepareForTestWithArchMutator, PrepareForTestWithArchMutator,
FixtureRegisterWithContext(func(ctx RegistrationContext) { FixtureRegisterWithContext(func(ctx RegistrationContext) {
ctx.RegisterModuleType("component", componentTestModuleFactory) ctx.RegisterModuleType("component", componentTestModuleFactory)

View File

@@ -286,6 +286,8 @@ var (
// New warnings to be fixed after clang-r468909 // New warnings to be fixed after clang-r468909
"-Wno-error=deprecated-builtins", // http://b/241601211 "-Wno-error=deprecated-builtins", // http://b/241601211
"-Wno-error=deprecated", // in external/googletest/googletest "-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 // New warnings to be fixed after clang-r475365
"-Wno-error=enum-constexpr-conversion", // http://b/243964282 "-Wno-error=enum-constexpr-conversion", // http://b/243964282
// New warnings to be fixed after clang-r522817 // New warnings to be fixed after clang-r522817

View File

@@ -38,7 +38,7 @@ For example, in
clang-tidy is enabled explicitly and with a different check list: clang-tidy is enabled explicitly and with a different check list:
``` ```
cc_defaults { cc_defaults {
name: "bpf_defaults", name: "bpf_cc_defaults",
// snipped // snipped
tidy: true, tidy: true,
tidy_checks: [ tidy_checks: [
@@ -52,7 +52,7 @@ cc_defaults {
} }
``` ```
That means in normal builds, even without `WITH_TIDY=1`, 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`. over C/C++ source files with the given `tidy_checks`.
However since clang-tidy warnings and its runtime cost might However since clang-tidy warnings and its runtime cost might

View File

@@ -33,7 +33,6 @@ func RegisterRavenwoodBuildComponents(ctx android.RegistrationContext) {
var ravenwoodLibContentTag = dependencyTag{name: "ravenwoodlibcontent"} var ravenwoodLibContentTag = dependencyTag{name: "ravenwoodlibcontent"}
var ravenwoodUtilsTag = dependencyTag{name: "ravenwoodutils"} var ravenwoodUtilsTag = dependencyTag{name: "ravenwoodutils"}
var ravenwoodRuntimeTag = dependencyTag{name: "ravenwoodruntime"} var ravenwoodRuntimeTag = dependencyTag{name: "ravenwoodruntime"}
var ravenwoodDataTag = dependencyTag{name: "ravenwooddata"}
var ravenwoodTestResourceApkTag = dependencyTag{name: "ravenwoodtestresapk"} var ravenwoodTestResourceApkTag = dependencyTag{name: "ravenwoodtestresapk"}
const ravenwoodUtilsName = "ravenwood-utils" const ravenwoodUtilsName = "ravenwood-utils"
@@ -228,7 +227,10 @@ type ravenwoodLibgroupProperties struct {
Jni_libs []string Jni_libs []string
// We use this to copy framework-res.apk to the ravenwood runtime directory. // 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 { type ravenwoodLibgroup struct {
@@ -267,9 +269,6 @@ func (r *ravenwoodLibgroup) DepsMutator(ctx android.BottomUpMutatorContext) {
for _, lib := range r.ravenwoodLibgroupProperties.Jni_libs { for _, lib := range r.ravenwoodLibgroupProperties.Jni_libs {
ctx.AddVariationDependencies(ctx.Config().BuildOSTarget.Variations(), jniLibTag, lib) 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) { func (r *ravenwoodLibgroup) GenerateAndroidBuildActions(ctx android.ModuleContext) {
@@ -309,12 +308,17 @@ func (r *ravenwoodLibgroup) GenerateAndroidBuildActions(ctx android.ModuleContex
} }
dataInstallPath := installPath.Join(ctx, "ravenwood-data") dataInstallPath := installPath.Join(ctx, "ravenwood-data")
for _, data := range r.ravenwoodLibgroupProperties.Data { data := android.PathsForModuleSrc(ctx, r.ravenwoodLibgroupProperties.Data)
libModule := ctx.GetDirectDepWithTag(data, ravenwoodDataTag) for _, file := range data {
file := android.OutputFileForModule(ctx, libModule, "")
ctx.InstallFile(dataInstallPath, file.Base(), file) 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 // Normal build should perform install steps
ctx.Phony(r.BaseModuleName(), android.PathForPhony(ctx, r.BaseModuleName()+"-install")) ctx.Phony(r.BaseModuleName(), android.PathForPhony(ctx, r.BaseModuleName()+"-install"))
} }

View File

@@ -19,6 +19,7 @@ import (
"testing" "testing"
"android/soong/android" "android/soong/android"
"android/soong/etc"
) )
var prepareRavenwoodRuntime = android.GroupFixturePreparers( var prepareRavenwoodRuntime = android.GroupFixturePreparers(
@@ -59,11 +60,15 @@ var prepareRavenwoodRuntime = android.GroupFixturePreparers(
} }
android_app { android_app {
name: "app1", name: "app1",
sdk_version: "current", sdk_version: "current",
} }
android_app { android_app {
name: "app2", name: "app2",
sdk_version: "current", sdk_version: "current",
}
prebuilt_font {
name: "Font.ttf",
src: "Font.ttf",
} }
android_ravenwood_libgroup { android_ravenwood_libgroup {
name: "ravenwood-runtime", name: "ravenwood-runtime",
@@ -76,7 +81,10 @@ var prepareRavenwoodRuntime = android.GroupFixturePreparers(
"ravenwood-runtime-jni2", "ravenwood-runtime-jni2",
], ],
data: [ data: [
"app1", ":app1",
],
fonts: [
":Font.ttf"
], ],
} }
android_ravenwood_libgroup { android_ravenwood_libgroup {
@@ -97,6 +105,7 @@ func TestRavenwoodRuntime(t *testing.T) {
ctx := android.GroupFixturePreparers( ctx := android.GroupFixturePreparers(
PrepareForIntegrationTestWithJava, PrepareForIntegrationTestWithJava,
etc.PrepareForTestWithPrebuiltEtc,
prepareRavenwoodRuntime, prepareRavenwoodRuntime,
).RunTest(t) ).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/libred.so")
runtime.Output(installPathPrefix + "/ravenwood-runtime/lib64/ravenwood-runtime-jni3.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/ravenwood-data/app1.apk")
runtime.Output(installPathPrefix + "/ravenwood-runtime/fonts/Font.ttf")
utils := ctx.ModuleForTests("ravenwood-utils", "android_common") utils := ctx.ModuleForTests("ravenwood-utils", "android_common")
utils.Output(installPathPrefix + "/ravenwood-utils/framework-rules.ravenwood.jar") utils.Output(installPathPrefix + "/ravenwood-utils/framework-rules.ravenwood.jar")
} }
@@ -125,29 +135,30 @@ func TestRavenwoodTest(t *testing.T) {
ctx := android.GroupFixturePreparers( ctx := android.GroupFixturePreparers(
PrepareForIntegrationTestWithJava, PrepareForIntegrationTestWithJava,
etc.PrepareForTestWithPrebuiltEtc,
prepareRavenwoodRuntime, prepareRavenwoodRuntime,
).RunTestWithBp(t, ` ).RunTestWithBp(t, `
cc_library_shared { cc_library_shared {
name: "jni-lib1", name: "jni-lib1",
host_supported: true, host_supported: true,
srcs: ["jni.cpp"], srcs: ["jni.cpp"],
} }
cc_library_shared { cc_library_shared {
name: "jni-lib2", name: "jni-lib2",
host_supported: true, host_supported: true,
srcs: ["jni.cpp"], srcs: ["jni.cpp"],
stem: "libblue", stem: "libblue",
shared_libs: [ shared_libs: [
"jni-lib3", "jni-lib3",
], ],
} }
cc_library_shared { cc_library_shared {
name: "jni-lib3", name: "jni-lib3",
host_supported: true, host_supported: true,
srcs: ["jni.cpp"], srcs: ["jni.cpp"],
stem: "libpink", stem: "libpink",
} }
android_ravenwood_test { android_ravenwood_test {
name: "ravenwood-test", name: "ravenwood-test",
srcs: ["Test.java"], srcs: ["Test.java"],
jni_libs: [ jni_libs: [

View File

@@ -36,7 +36,7 @@ def has_preprocessed_issues(args, *, fail=False):
if fail: if fail:
sys.exit(args.apk + ': Contains compressed JNI libraries') sys.exit(args.apk + ': Contains compressed JNI libraries')
return True 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 args.privileged and args.uncompress_priv_app_dex:
if info.filename.endswith('.dex') and info.compress_type != zipfile.ZIP_STORED: if info.filename.endswith('.dex') and info.compress_type != zipfile.ZIP_STORED:
if fail: if fail:
@@ -46,6 +46,10 @@ def has_preprocessed_issues(args, *, fail=False):
def main(): 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 = argparse.ArgumentParser()
parser.add_argument('--aapt2', help = "the path to the aapt2 executable") parser.add_argument('--aapt2', help = "the path to the aapt2 executable")
parser.add_argument('--zipalign', help = "the path to the zipalign executable") parser.add_argument('--zipalign', help = "the path to the zipalign executable")