Merge "rust: Remove rust_ffi_rlibs, keep rust_ffi_static" into main
diff --git a/Android.bp b/Android.bp
index 434ee9f..d78379a 100644
--- a/Android.bp
+++ b/Android.bp
@@ -179,6 +179,7 @@
visibility: [
"//build/make/target/product/generic",
"//build/make/target/product/gsi",
+ "//build/soong/fsgen",
"//packages/modules/Virtualization/build/microdroid",
"//frameworks/base/ravenwood",
],
@@ -190,7 +191,10 @@
system_ext_specific: true,
product_config: ":product_config",
relative_install_path: "etc", // system_ext/etc/build.prop
- visibility: ["//build/make/target/product/gsi"],
+ visibility: [
+ "//build/make/target/product/gsi",
+ "//build/soong/fsgen",
+ ],
}
build_prop {
@@ -199,7 +203,10 @@
product_specific: true,
product_config: ":product_config",
relative_install_path: "etc", // product/etc/build.prop
- visibility: ["//build/make/target/product/gsi"],
+ visibility: [
+ "//build/make/target/product/gsi",
+ "//build/soong/fsgen",
+ ],
}
build_prop {
@@ -208,7 +215,7 @@
device_specific: true,
product_config: ":product_config",
relative_install_path: "etc", // odm/etc/build.prop
- visibility: ["//visibility:private"],
+ visibility: ["//build/soong/fsgen"],
}
build_prop {
diff --git a/android/Android.bp b/android/Android.bp
index 20cd28b..79969a8 100644
--- a/android/Android.bp
+++ b/android/Android.bp
@@ -95,6 +95,7 @@
"proto.go",
"provider.go",
"raw_files.go",
+ "recovery_build_prop.go",
"register.go",
"rule_builder.go",
"sandbox.go",
diff --git a/android/apex.go b/android/apex.go
index db955b5..bbd6875 100644
--- a/android/apex.go
+++ b/android/apex.go
@@ -452,6 +452,10 @@
if strings.HasSuffix(apex_name, ".*") && strings.HasPrefix(what, strings.TrimSuffix(apex_name, "*")) {
return true
}
+ // TODO b/383863941: Remove once legacy name is no longer used
+ if (apex_name == "com.android.btservices" && what == "com.android.bt") || (apex_name == "com.android.bt" && what == "com.android.btservices") {
+ return true
+ }
}
return false
}
diff --git a/android/config.go b/android/config.go
index b811c55..d78bbf7 100644
--- a/android/config.go
+++ b/android/config.go
@@ -1320,6 +1320,10 @@
return c.IsEnvTrue("RUN_ERROR_PRONE")
}
+func (c *config) RunErrorProneInline() bool {
+ return c.IsEnvTrue("RUN_ERROR_PRONE_INLINE")
+}
+
// XrefCorpusName returns the Kythe cross-reference corpus name.
func (c *config) XrefCorpusName() string {
return c.Getenv("XREF_CORPUS")
diff --git a/android/container.go b/android/container.go
index 27b17ed..99e6a30 100644
--- a/android/container.go
+++ b/android/container.go
@@ -197,7 +197,10 @@
func determineUnstableModule(mctx ModuleContext) bool {
module := mctx.Module()
- unstableModule := module.Name() == "framework-minus-apex"
+
+ // TODO(b/383559945) Remove "framework-minus-apex_jarjar-sharded" once
+ // we remove this module.
+ unstableModule := module.Name() == "framework-minus-apex" || module.Name() == "framework-minus-apex_jarjar-sharded"
if installable, ok := module.(InstallableModule); ok {
for _, staticDepTag := range installable.StaticDependencyTags() {
mctx.VisitDirectDepsWithTag(staticDepTag, func(dep Module) {
diff --git a/android/container_violations.go b/android/container_violations.go
index cfee562..ba8f7d5 100644
--- a/android/container_violations.go
+++ b/android/container_violations.go
@@ -15,6 +15,10 @@
package android
var ContainerDependencyViolationAllowlist = map[string][]string{
+ "adservices-service-core": {
+ "gson", // apex [com.android.adservices, com.android.extservices] -> apex [com.android.virt]
+ },
+
"android.car-module.impl": {
"modules-utils-preconditions", // apex [com.android.car.framework] -> apex [com.android.adservices, com.android.appsearch, com.android.cellbroadcast, com.android.extservices, com.android.ondevicepersonalization, com.android.tethering, com.android.uwb, com.android.wifi, test_com.android.cellbroadcast, test_com.android.wifi]
},
@@ -46,6 +50,11 @@
"modules-utils-shell-command-handler", // apex [com.android.car.framework] -> apex [com.android.adservices, com.android.art, com.android.art.debug, com.android.art.testing, com.android.btservices, com.android.configinfrastructure, com.android.mediaprovider, com.android.nfcservices, com.android.permission, com.android.scheduling, com.android.tethering, com.android.uwb, com.android.wifi, test_com.android.mediaprovider, test_com.android.permission, test_com.android.wifi, test_imgdiag_com.android.art, test_jitzygote_com.android.art]
},
+ "cellbroadcastreceiver_aconfig_flags_lib": {
+ "ext", // apex [com.android.cellbroadcast, test_com.android.cellbroadcast] -> system
+ "framework", // apex [com.android.cellbroadcast, test_com.android.cellbroadcast] -> system
+ },
+
"connectivity-net-module-utils-bpf": {
"net-utils-device-common-struct-base", // apex [com.android.tethering] -> system
},
@@ -161,6 +170,10 @@
"framework", // cts -> unstable
},
+ "CtsAppFunctionTestCases": {
+ "framework", // cts -> unstable
+ },
+
"CtsAppOpsTestCases": {
"framework", // cts -> unstable
},
@@ -701,6 +714,10 @@
"framework", // cts -> unstable
},
+ "CtsTvInputTestCases": {
+ "framework", // cts -> unstable
+ },
+
"CtsTvTunerTestCases": {
"framework", // cts -> unstable
},
@@ -822,6 +839,10 @@
"app-compat-annotations", // apex [com.android.btservices] -> system
},
+ "framework-configinfrastructure.impl": {
+ "configinfra_framework_flags_java_lib", // apex [com.android.configinfrastructure] -> system
+ },
+
"framework-connectivity-t.impl": {
"app-compat-annotations", // apex [com.android.tethering] -> system
"framework-connectivity-pre-jarjar", // apex [com.android.tethering] -> system
@@ -839,6 +860,7 @@
},
"framework-ondevicepersonalization.impl": {
+ "app-compat-annotations", // apex [com.android.ondevicepersonalization] -> system
"ondevicepersonalization_flags_lib", // apex [com.android.ondevicepersonalization] -> system
},
@@ -959,7 +981,11 @@
},
"NfcNciApex": {
+ // TODO(b/383782511): Remove the violations once the infra is fixed.
+ "android.nfc.flags-aconfig-java", // apex [com.android.nfcservices] -> system
"android.permission.flags-aconfig-java", // apex [com.android.nfcservices] -> apex [com.android.permission, test_com.android.permission]
+ // TODO(b/383782511): Remove the violations once the infra is fixed.
+ "framework-nfc.impl", // apex [com.android.nfcservices] -> system
},
"okhttp-norepackage": {
diff --git a/android/logtags.go b/android/logtags.go
index 1e92dad..abc37f9 100644
--- a/android/logtags.go
+++ b/android/logtags.go
@@ -14,10 +14,56 @@
package android
-import "github.com/google/blueprint"
+import (
+ "strings"
+
+ "github.com/google/blueprint"
+)
+
+func init() {
+ RegisterParallelSingletonType("logtags", LogtagsSingleton)
+}
type LogtagsInfo struct {
Logtags Paths
}
var LogtagsProviderKey = blueprint.NewProvider[*LogtagsInfo]()
+
+func LogtagsSingleton() Singleton {
+ return &logtagsSingleton{}
+}
+
+type logtagsSingleton struct{}
+
+func MergedLogtagsPath(ctx PathContext) OutputPath {
+ return PathForIntermediates(ctx, "all-event-log-tags.txt")
+}
+
+func (l *logtagsSingleton) GenerateBuildActions(ctx SingletonContext) {
+ var allLogtags Paths
+ ctx.VisitAllModules(func(module Module) {
+ if !module.ExportedToMake() {
+ return
+ }
+ if logtagsInfo, ok := OtherModuleProvider(ctx, module, LogtagsProviderKey); ok {
+ allLogtags = append(allLogtags, logtagsInfo.Logtags...)
+ }
+ })
+ allLogtags = SortedUniquePaths(allLogtags)
+ filteredLogTags := make([]Path, 0, len(allLogtags))
+ for _, p := range allLogtags {
+ // Logic copied from make:
+ // https://cs.android.com/android/platform/superproject/main/+/main:build/make/core/Makefile;l=987;drc=0585bb1bcf4c89065adaf709f48acc8b869fd3ce
+ if !strings.HasPrefix(p.String(), "vendor/") && !strings.HasPrefix(p.String(), "device/") && !strings.HasPrefix(p.String(), "out/") {
+ filteredLogTags = append(filteredLogTags, p)
+ }
+ }
+
+ builder := NewRuleBuilder(pctx, ctx)
+ builder.Command().
+ BuiltTool("merge-event-log-tags").
+ FlagWithOutput("-o ", MergedLogtagsPath(ctx)).
+ Inputs(filteredLogTags)
+ builder.Build("all-event-log-tags.txt", "merge logtags")
+}
diff --git a/android/module_context.go b/android/module_context.go
index ae7b54f..b097117 100644
--- a/android/module_context.go
+++ b/android/module_context.go
@@ -623,8 +623,10 @@
if m.requiresFullInstall() {
deps = append(deps, InstallPaths(m.TransitiveInstallFiles.ToList())...)
- deps = append(deps, m.installedInitRcPaths...)
- deps = append(deps, m.installedVintfFragmentsPaths...)
+ if m.config.KatiEnabled() {
+ deps = append(deps, m.installedInitRcPaths...)
+ deps = append(deps, m.installedVintfFragmentsPaths...)
+ }
var implicitDeps, orderOnlyDeps Paths
diff --git a/android/recovery_build_prop.go b/android/recovery_build_prop.go
new file mode 100644
index 0000000..91d1904
--- /dev/null
+++ b/android/recovery_build_prop.go
@@ -0,0 +1,111 @@
+// Copyright 2024 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package android
+
+import "github.com/google/blueprint/proptools"
+
+func init() {
+ RegisterModuleType("recovery_build_prop", RecoveryBuildPropModuleFactory)
+}
+
+type recoveryBuildPropProperties struct {
+ // Path to the system build.prop file
+ System_build_prop *string `android:"path"`
+
+ // Path to the vendor build.prop file
+ Vendor_build_prop *string `android:"path"`
+
+ // Path to the odm build.prop file
+ Odm_build_prop *string `android:"path"`
+
+ // Path to the product build.prop file
+ Product_build_prop *string `android:"path"`
+
+ // Path to the system_ext build.prop file
+ System_ext_build_prop *string `android:"path"`
+}
+
+type recoveryBuildPropModule struct {
+ ModuleBase
+ properties recoveryBuildPropProperties
+
+ outputFilePath ModuleOutPath
+
+ installPath InstallPath
+}
+
+func RecoveryBuildPropModuleFactory() Module {
+ module := &recoveryBuildPropModule{}
+ module.AddProperties(&module.properties)
+ InitAndroidArchModule(module, DeviceSupported, MultilibCommon)
+ return module
+}
+
+// Overrides ctx.Module().InstallInRoot().
+// recovery_build_prop module always installs in root so that the prop.default
+// file is installed in recovery/root instead of recovery/root/system
+func (r *recoveryBuildPropModule) InstallInRoot() bool {
+ return true
+}
+
+func (r *recoveryBuildPropModule) appendRecoveryUIProperties(ctx ModuleContext, rule *RuleBuilder) {
+ rule.Command().Text("echo '#' >>").Output(r.outputFilePath)
+ rule.Command().Text("echo '# RECOVERY UI BUILD PROPERTIES' >>").Output(r.outputFilePath)
+ rule.Command().Text("echo '#' >>").Output(r.outputFilePath)
+
+ for propName, val := range ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.PrivateRecoveryUiProperties {
+ if len(val) > 0 {
+ rule.Command().
+ Textf("echo ro.recovery.ui.%s=%s >>", propName, val).
+ Output(r.outputFilePath)
+ }
+ }
+}
+
+func (r *recoveryBuildPropModule) getBuildProps(ctx ModuleContext) Paths {
+ var buildProps Paths
+ for _, buildProp := range []*string{
+ r.properties.System_build_prop,
+ r.properties.Vendor_build_prop,
+ r.properties.Odm_build_prop,
+ r.properties.Product_build_prop,
+ r.properties.System_ext_build_prop,
+ } {
+ if buildPropPath := PathForModuleSrc(ctx, proptools.String(buildProp)); buildPropPath != nil {
+ buildProps = append(buildProps, buildPropPath)
+ }
+ }
+ return buildProps
+}
+
+func (r *recoveryBuildPropModule) GenerateAndroidBuildActions(ctx ModuleContext) {
+ if !r.InstallInRecovery() {
+ ctx.ModuleErrorf("recovery_build_prop module must set `recovery` property to true")
+ }
+ r.outputFilePath = PathForModuleOut(ctx, ctx.ModuleName(), "prop.default")
+
+ // Replicates the logic in https://cs.android.com/android/platform/superproject/main/+/main:build/make/core/Makefile;l=2733;drc=0585bb1bcf4c89065adaf709f48acc8b869fd3ce
+ rule := NewRuleBuilder(pctx, ctx)
+ rule.Command().Text("rm").FlagWithOutput("-f ", r.outputFilePath)
+ rule.Command().Text("cat").
+ Inputs(r.getBuildProps(ctx)).
+ Text(">>").
+ Output(r.outputFilePath)
+ r.appendRecoveryUIProperties(ctx, rule)
+
+ rule.Build(ctx.ModuleName(), "generating recovery prop.default")
+ r.installPath = PathForModuleInstall(ctx)
+ ctx.InstallFile(r.installPath, "prop.default", r.outputFilePath)
+}
diff --git a/android/variable.go b/android/variable.go
index 19f63e3..3cf66ea 100644
--- a/android/variable.go
+++ b/android/variable.go
@@ -617,7 +617,11 @@
ProductUseDynamicPartitionSize bool `json:",omitempty"`
CopyImagesForTargetFilesZip bool `json:",omitempty"`
- VendorSecurityPatch string `json:",omitempty"`
+ VendorSecurityPatch string `json:",omitempty"`
+ OdmSecurityPatch string `json:",omitempty"`
+ SystemDlkmSecurityPatch string `json:",omitempty"`
+ VendorDlkmSecurityPatch string `json:",omitempty"`
+ OdmDlkmSecurityPatch string `json:",omitempty"`
// Boot image stuff
BuildingRamdiskImage bool `json:",omitempty"`
@@ -688,6 +692,8 @@
ProductFsverityGenerateMetadata bool `json:",omitempty"`
TargetScreenDensity string `json:",omitempty"`
+
+ PrivateRecoveryUiProperties map[string]string `json:",omitempty"`
}
func boolPtr(v bool) *bool {
diff --git a/apex/apex.go b/apex/apex.go
index fb0d730..b0d2b54 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -147,9 +147,6 @@
// Default: true.
Installable *bool
- // Deprecated. Do not use. TODO(b/350644693) remove this after removing all usage
- Use_vndk_as_stable *bool
-
// The type of filesystem to use. Either 'ext4', 'f2fs' or 'erofs'. Default 'ext4'.
Payload_fs_type *string
@@ -157,10 +154,6 @@
// Default is false.
Ignore_system_library_special_case *bool
- // Whenever apex_payload.img of the APEX should include dm-verity hashtree.
- // Default value is true.
- Generate_hashtree *bool
-
// Whenever apex_payload.img of the APEX should not be dm-verity signed. Should be only
// used in tests.
Test_only_unsigned_payload *bool
@@ -1326,11 +1319,6 @@
return !a.properties.PreventInstall && (a.properties.Installable == nil || proptools.Bool(a.properties.Installable))
}
-// See the generate_hashtree property
-func (a *apexBundle) shouldGenerateHashtree() bool {
- return proptools.BoolDefault(a.properties.Generate_hashtree, true)
-}
-
// See the test_only_unsigned_payload property
func (a *apexBundle) testOnlyShouldSkipPayloadSign() bool {
return proptools.Bool(a.properties.Test_only_unsigned_payload)
diff --git a/apex/apex_test.go b/apex/apex_test.go
index ced3c46..81a62d9 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -7431,7 +7431,6 @@
module := ctx.ModuleForTests("myapex", "android_common_myapex")
args := module.Rule("apexRule").Args
ensureContains(t, args["opt_flags"], "--manifest_json "+module.Output("apex_manifest.json").Output.String())
- ensureNotContains(t, args["opt_flags"], "--no_hashtree")
// The copies of the libraries in the apex should have one more dependency than
// the ones outside the apex, namely the unwinder. Ideally we should check
diff --git a/apex/builder.go b/apex/builder.go
index 45608c9..4c91dd0 100644
--- a/apex/builder.go
+++ b/apex/builder.go
@@ -544,7 +544,7 @@
imageDir := android.PathForModuleOut(ctx, "image"+suffix)
- installSymbolFiles := (!ctx.Config().KatiEnabled() || a.ExportedToMake()) && a.installable()
+ installSymbolFiles := (ctx.Config().KatiEnabled() && a.ExportedToMake()) && a.installable()
// set of dependency module:location mappings
installMapSet := make(map[string]bool)
@@ -764,18 +764,6 @@
implicitInputs = append(implicitInputs, noticeAssetPath)
optFlags = append(optFlags, "--assets_dir "+filepath.Dir(noticeAssetPath.String()))
- // Apexes which are supposed to be installed in builtin dirs(/system, etc)
- // don't need hashtree for activation. Therefore, by removing hashtree from
- // apex bundle (filesystem image in it, to be specific), we can save storage.
- needHashTree := moduleMinSdkVersion.LessThanOrEqualTo(android.SdkVersion_Android10) ||
- a.shouldGenerateHashtree()
- if ctx.Config().ApexCompressionEnabled() && a.isCompressable() {
- needHashTree = true
- }
- if !needHashTree {
- optFlags = append(optFlags, "--no_hashtree")
- }
-
if a.testOnlyShouldSkipPayloadSign() {
optFlags = append(optFlags, "--unsigned_payload")
}
diff --git a/cc/cc.go b/cc/cc.go
index 812d1c3..5c6424b 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -731,9 +731,6 @@
Kind libraryDependencyKind
Order libraryDependencyOrder
- // fromStatic is true when the parent module is a static library or binary
- fromStatic bool
-
wholeStatic bool
reexportFlags bool
@@ -2550,7 +2547,7 @@
}
for _, lib := range deps.HeaderLibs {
- depTag := libraryDependencyTag{Kind: headerLibraryDependency, fromStatic: c.static()}
+ depTag := libraryDependencyTag{Kind: headerLibraryDependency}
if inList(lib, deps.ReexportHeaderLibHeaders) {
depTag.reexportFlags = true
}
@@ -2592,7 +2589,7 @@
}
for _, lib := range deps.WholeStaticLibs {
- depTag := libraryDependencyTag{Kind: staticLibraryDependency, wholeStatic: true, reexportFlags: true, fromStatic: c.static()}
+ depTag := libraryDependencyTag{Kind: staticLibraryDependency, wholeStatic: true, reexportFlags: true}
actx.AddVariationDependencies([]blueprint.Variation{
{Mutator: "link", Variation: "static"},
@@ -2601,7 +2598,7 @@
for _, lib := range deps.StaticLibs {
// Some dependencies listed in static_libs might actually be rust_ffi rlib variants.
- depTag := libraryDependencyTag{Kind: staticLibraryDependency, fromStatic: c.static()}
+ depTag := libraryDependencyTag{Kind: staticLibraryDependency}
if inList(lib, deps.ReexportStaticLibHeaders) {
depTag.reexportFlags = true
@@ -2618,7 +2615,7 @@
// so that native libraries/binaries are linked with static unwinder
// because Q libc doesn't have unwinder APIs
if deps.StaticUnwinderIfLegacy {
- depTag := libraryDependencyTag{Kind: staticLibraryDependency, staticUnwinder: true, fromStatic: c.static()}
+ depTag := libraryDependencyTag{Kind: staticLibraryDependency, staticUnwinder: true}
actx.AddVariationDependencies([]blueprint.Variation{
{Mutator: "link", Variation: "static"},
}, depTag, staticUnwinder(actx))
@@ -2628,7 +2625,7 @@
var sharedLibNames []string
for _, lib := range deps.SharedLibs {
- depTag := libraryDependencyTag{Kind: sharedLibraryDependency, fromStatic: c.static()}
+ depTag := libraryDependencyTag{Kind: sharedLibraryDependency}
if inList(lib, deps.ReexportSharedLibHeaders) {
depTag.reexportFlags = true
}
@@ -2649,14 +2646,14 @@
}
for _, lib := range deps.LateStaticLibs {
- depTag := libraryDependencyTag{Kind: staticLibraryDependency, Order: lateLibraryDependency, fromStatic: c.static()}
+ depTag := libraryDependencyTag{Kind: staticLibraryDependency, Order: lateLibraryDependency}
actx.AddVariationDependencies([]blueprint.Variation{
{Mutator: "link", Variation: "static"},
}, depTag, lib)
}
for _, lib := range deps.UnexportedStaticLibs {
- depTag := libraryDependencyTag{Kind: staticLibraryDependency, Order: lateLibraryDependency, unexportedSymbols: true, fromStatic: c.static()}
+ depTag := libraryDependencyTag{Kind: staticLibraryDependency, Order: lateLibraryDependency, unexportedSymbols: true}
actx.AddVariationDependencies([]blueprint.Variation{
{Mutator: "link", Variation: "static"},
}, depTag, lib)
@@ -2669,7 +2666,7 @@
// linking against both the stubs lib and the non-stubs lib at the same time.
continue
}
- depTag := libraryDependencyTag{Kind: sharedLibraryDependency, Order: lateLibraryDependency, fromStatic: c.static()}
+ depTag := libraryDependencyTag{Kind: sharedLibraryDependency, Order: lateLibraryDependency}
variations := []blueprint.Variation{
{Mutator: "link", Variation: "shared"},
}
@@ -2717,7 +2714,7 @@
version := ctx.sdkVersion()
- ndkStubDepTag := libraryDependencyTag{Kind: sharedLibraryDependency, ndk: true, makeSuffix: "." + version, fromStatic: c.static()}
+ ndkStubDepTag := libraryDependencyTag{Kind: sharedLibraryDependency, ndk: true, makeSuffix: "." + version}
actx.AddVariationDependencies([]blueprint.Variation{
{Mutator: "version", Variation: version},
{Mutator: "link", Variation: "shared"},
@@ -2727,7 +2724,7 @@
{Mutator: "link", Variation: "shared"},
}, ndkStubDepTag, apiNdkLibs...)
- ndkLateStubDepTag := libraryDependencyTag{Kind: sharedLibraryDependency, Order: lateLibraryDependency, ndk: true, makeSuffix: "." + version, fromStatic: c.static()}
+ ndkLateStubDepTag := libraryDependencyTag{Kind: sharedLibraryDependency, Order: lateLibraryDependency, ndk: true, makeSuffix: "." + version}
actx.AddVariationDependencies([]blueprint.Variation{
{Mutator: "version", Variation: version},
{Mutator: "link", Variation: "shared"},
@@ -3767,12 +3764,23 @@
// APEX.
return false
}
+
+ libDepTag, isLibDepTag := depTag.(libraryDependencyTag)
+ if isLibDepTag && c.static() && libDepTag.shared() {
+ // shared_lib dependency from a static lib is considered as crossing
+ // the APEX boundary because the dependency doesn't actually is
+ // linked; the dependency is used only during the compilation phase.
+ return false
+ }
+
+ if isLibDepTag && libDepTag.excludeInApex {
+ return false
+ }
+
return true
}
func (c *Module) IncomingDepIsInSameApex(depTag blueprint.DependencyTag) bool {
- libDepTag, isLibDepTag := depTag.(libraryDependencyTag)
-
if c.HasStubsVariants() {
if IsSharedDepTag(depTag) {
// dynamic dep to a stubs lib crosses APEX boundary
@@ -3789,16 +3797,6 @@
if c.IsLlndk() {
return false
}
- if isLibDepTag && libDepTag.fromStatic && libDepTag.shared() {
- // shared_lib dependency from a static lib is considered as crossing
- // the APEX boundary because the dependency doesn't actually is
- // linked; the dependency is used only during the compilation phase.
- return false
- }
-
- if isLibDepTag && libDepTag.excludeInApex {
- return false
- }
return true
}
diff --git a/cc/config/x86_windows_host.go b/cc/config/x86_windows_host.go
index a4d43b9..1f6cf23 100644
--- a/cc/config/x86_windows_host.go
+++ b/cc/config/x86_windows_host.go
@@ -106,6 +106,8 @@
}
windowsAvailableLibraries = addPrefix([]string{
+ "bcrypt",
+ "dbghelp",
"gdi32",
"imagehlp",
"iphlpapi",
diff --git a/cc/fuzz.go b/cc/fuzz.go
index 122871f..911a81c 100644
--- a/cc/fuzz.go
+++ b/cc/fuzz.go
@@ -288,7 +288,7 @@
}
func (fuzzBin *fuzzBinary) install(ctx ModuleContext, file android.Path) {
- fuzzBin.fuzzPackagedModule = PackageFuzzModule(ctx, fuzzBin.fuzzPackagedModule, pctx)
+ fuzzBin.fuzzPackagedModule = PackageFuzzModule(ctx, fuzzBin.fuzzPackagedModule)
installBase := "fuzz"
@@ -345,7 +345,7 @@
fuzzBin.binaryDecorator.baseInstaller.install(ctx, file)
}
-func PackageFuzzModule(ctx android.ModuleContext, fuzzPackagedModule fuzz.FuzzPackagedModule, pctx android.PackageContext) fuzz.FuzzPackagedModule {
+func PackageFuzzModule(ctx android.ModuleContext, fuzzPackagedModule fuzz.FuzzPackagedModule) fuzz.FuzzPackagedModule {
fuzzPackagedModule.Corpus = android.PathsForModuleSrc(ctx, fuzzPackagedModule.FuzzProperties.Corpus)
fuzzPackagedModule.Corpus = append(fuzzPackagedModule.Corpus, android.PathsForModuleSrc(ctx, fuzzPackagedModule.FuzzProperties.Device_common_corpus)...)
diff --git a/cc/library.go b/cc/library.go
index ad8128e..be27b01 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -34,6 +34,8 @@
// LibraryProperties is a collection of properties shared by cc library rules/cc.
type LibraryProperties struct {
+ // local file name to pass to the linker as -exported_symbols_list
+ Exported_symbols_list *string `android:"path,arch_variant"`
// local file name to pass to the linker as -unexported_symbols_list
Unexported_symbols_list *string `android:"path,arch_variant"`
// local file name to pass to the linker as -force_symbols_not_weak_list
@@ -1049,10 +1051,14 @@
linkerDeps = append(linkerDeps, flags.LdFlagsDeps...)
linkerDeps = append(linkerDeps, ndkSharedLibDeps(ctx)...)
+ exportedSymbols := ctx.ExpandOptionalSource(library.Properties.Exported_symbols_list, "exported_symbols_list")
unexportedSymbols := ctx.ExpandOptionalSource(library.Properties.Unexported_symbols_list, "unexported_symbols_list")
forceNotWeakSymbols := ctx.ExpandOptionalSource(library.Properties.Force_symbols_not_weak_list, "force_symbols_not_weak_list")
forceWeakSymbols := ctx.ExpandOptionalSource(library.Properties.Force_symbols_weak_list, "force_symbols_weak_list")
if !ctx.Darwin() {
+ if exportedSymbols.Valid() {
+ ctx.PropertyErrorf("exported_symbols_list", "Only supported on Darwin")
+ }
if unexportedSymbols.Valid() {
ctx.PropertyErrorf("unexported_symbols_list", "Only supported on Darwin")
}
@@ -1063,6 +1069,10 @@
ctx.PropertyErrorf("force_symbols_weak_list", "Only supported on Darwin")
}
} else {
+ if exportedSymbols.Valid() {
+ flags.Local.LdFlags = append(flags.Local.LdFlags, "-Wl,-exported_symbols_list,"+exportedSymbols.String())
+ linkerDeps = append(linkerDeps, exportedSymbols.Path())
+ }
if unexportedSymbols.Valid() {
flags.Local.LdFlags = append(flags.Local.LdFlags, "-Wl,-unexported_symbols_list,"+unexportedSymbols.String())
linkerDeps = append(linkerDeps, unexportedSymbols.Path())
diff --git a/cc/linkable.go b/cc/linkable.go
index d0f03c5..78ea71c 100644
--- a/cc/linkable.go
+++ b/cc/linkable.go
@@ -291,8 +291,8 @@
}
// SharedDepTag returns the dependency tag for any C++ shared libraries.
-func SharedDepTag(fromStatic bool) blueprint.DependencyTag {
- return libraryDependencyTag{Kind: sharedLibraryDependency, fromStatic: fromStatic}
+func SharedDepTag() blueprint.DependencyTag {
+ return libraryDependencyTag{Kind: sharedLibraryDependency}
}
// StaticDepTag returns the dependency tag for any C++ static libraries.
diff --git a/cc/llndk_library.go b/cc/llndk_library.go
index 162dd54..8cc3852 100644
--- a/cc/llndk_library.go
+++ b/cc/llndk_library.go
@@ -63,23 +63,52 @@
}
func makeLlndkVars(ctx android.MakeVarsContext) {
- // Make uses LLNDK_MOVED_TO_APEX_LIBRARIES to generate the linker config.
- movedToApexLlndkLibraries := make(map[string]bool)
- ctx.VisitAllModules(func(module android.Module) {
- if library := moduleLibraryInterface(module); library != nil && library.hasLLNDKStubs() {
- if library.isLLNDKMovedToApex() {
- name := library.implementationModuleName(module.(*Module).BaseModuleName())
- movedToApexLlndkLibraries[name] = true
- }
- }
- })
- ctx.Strict("LLNDK_MOVED_TO_APEX_LIBRARIES",
- strings.Join(android.SortedKeys(movedToApexLlndkLibraries), " "))
}
func init() {
RegisterLlndkLibraryTxtType(android.InitRegistrationContext)
+ android.RegisterParallelSingletonType("movedToApexLlndkLibraries", movedToApexLlndkLibrariesFactory)
+}
+
+func movedToApexLlndkLibrariesFactory() android.Singleton {
+ return &movedToApexLlndkLibraries{}
+}
+
+type movedToApexLlndkLibraries struct {
+ movedToApexLlndkLibraries []string
+}
+
+func (s *movedToApexLlndkLibraries) GenerateBuildActions(ctx android.SingletonContext) {
+ // Make uses LLNDK_MOVED_TO_APEX_LIBRARIES to generate the linker config.
+ movedToApexLlndkLibrariesMap := make(map[string]bool)
+ ctx.VisitAllModules(func(module android.Module) {
+ if library := moduleLibraryInterface(module); library != nil && library.hasLLNDKStubs() {
+ if library.isLLNDKMovedToApex() {
+ name := library.implementationModuleName(module.(*Module).BaseModuleName())
+ movedToApexLlndkLibrariesMap[name] = true
+ }
+ }
+ })
+ s.movedToApexLlndkLibraries = android.SortedKeys(movedToApexLlndkLibrariesMap)
+
+ var sb strings.Builder
+ for i, l := range s.movedToApexLlndkLibraries {
+ if i > 0 {
+ sb.WriteRune(' ')
+ }
+ sb.WriteString(l)
+ sb.WriteString(".so")
+ }
+ android.WriteFileRule(ctx, MovedToApexLlndkLibrariesFile(ctx), sb.String())
+}
+
+func MovedToApexLlndkLibrariesFile(ctx android.PathContext) android.WritablePath {
+ return android.PathForIntermediates(ctx, "moved_to_apex_llndk_libraries.txt")
+}
+
+func (s *movedToApexLlndkLibraries) MakeVars(ctx android.MakeVarsContext) {
+ ctx.Strict("LLNDK_MOVED_TO_APEX_LIBRARIES", strings.Join(s.movedToApexLlndkLibraries, " "))
}
func RegisterLlndkLibraryTxtType(ctx android.RegistrationContext) {
diff --git a/cc/makevars.go b/cc/makevars.go
index 4cb98e7..ca97b76 100644
--- a/cc/makevars.go
+++ b/cc/makevars.go
@@ -186,8 +186,6 @@
if len(deviceTargets) > 1 {
makeVarsToolchain(ctx, "2ND_", deviceTargets[1])
}
-
- makeLlndkVars(ctx)
}
func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string,
diff --git a/cc/stub_library.go b/cc/stub_library.go
index e746a33..5911be0 100644
--- a/cc/stub_library.go
+++ b/cc/stub_library.go
@@ -26,9 +26,13 @@
android.RegisterParallelSingletonType("stublibraries", stubLibrariesSingleton)
}
+func stubLibrariesSingleton() android.Singleton {
+ return &stubLibraries{}
+}
+
type stubLibraries struct {
- stubLibraryMap map[string]bool
- stubVendorLibraryMap map[string]bool
+ stubLibraries []string
+ vendorStubLibraries []string
apiListCoverageXmlPaths []string
}
@@ -51,13 +55,15 @@
func (s *stubLibraries) GenerateBuildActions(ctx android.SingletonContext) {
// Visit all generated soong modules and store stub library file names.
+ stubLibraryMap := make(map[string]bool)
+ vendorStubLibraryMap := make(map[string]bool)
ctx.VisitAllModules(func(module android.Module) {
if m, ok := module.(*Module); ok {
if IsStubTarget(m) {
if name := getInstalledFileName(ctx, m); name != "" {
- s.stubLibraryMap[name] = true
+ stubLibraryMap[name] = true
if m.InVendor() {
- s.stubVendorLibraryMap[name] = true
+ vendorStubLibraryMap[name] = true
}
}
}
@@ -68,19 +74,20 @@
}
}
})
+ s.stubLibraries = android.SortedKeys(stubLibraryMap)
+ s.vendorStubLibraries = android.SortedKeys(vendorStubLibraryMap)
+
+ android.WriteFileRule(ctx, StubLibrariesFile(ctx), strings.Join(s.stubLibraries, " "))
}
-func stubLibrariesSingleton() android.Singleton {
- return &stubLibraries{
- stubLibraryMap: make(map[string]bool),
- stubVendorLibraryMap: make(map[string]bool),
- }
+func StubLibrariesFile(ctx android.PathContext) android.WritablePath {
+ return android.PathForIntermediates(ctx, "stub_libraries.txt")
}
func (s *stubLibraries) MakeVars(ctx android.MakeVarsContext) {
// Convert stub library file names into Makefile variable.
- ctx.Strict("STUB_LIBRARIES", strings.Join(android.SortedKeys(s.stubLibraryMap), " "))
- ctx.Strict("SOONG_STUB_VENDOR_LIBRARIES", strings.Join(android.SortedKeys(s.stubVendorLibraryMap), " "))
+ ctx.Strict("STUB_LIBRARIES", strings.Join(s.stubLibraries, " "))
+ ctx.Strict("SOONG_STUB_VENDOR_LIBRARIES", strings.Join(s.vendorStubLibraries, " "))
// Export the list of API XML files to Make.
sort.Strings(s.apiListCoverageXmlPaths)
diff --git a/cmd/release_config/release_config/main.go b/cmd/release_config/release_config/main.go
index d06b2b7..7013d6b 100644
--- a/cmd/release_config/release_config/main.go
+++ b/cmd/release_config/release_config/main.go
@@ -95,7 +95,7 @@
if allMake {
// Write one makefile per release config, using the canonical release name.
for _, c := range configs.GetSortedReleaseConfigs() {
- if c.Name != targetRelease {
+ if c.Name != targetRelease && !c.DisallowLunchUse {
makefilePath = filepath.Join(outputDir, fmt.Sprintf("release_config-%s-%s.varmk", product, c.Name))
err = config.WriteMakefile(makefilePath, c.Name, configs)
if err != nil {
diff --git a/cmd/release_config/release_config_lib/flag_artifact.go b/cmd/release_config/release_config_lib/flag_artifact.go
index cb13fdc..f493e1e 100644
--- a/cmd/release_config/release_config_lib/flag_artifact.go
+++ b/cmd/release_config/release_config_lib/flag_artifact.go
@@ -189,7 +189,7 @@
if redacted {
fa.Redact()
flagValue.proto.Value = fa.Value
- fmt.Printf("Redacting flag %s in %s\n", name, flagValue.path)
+ warnf("Redacting flag %s in %s\n", name, flagValue.path)
} else {
// If we are assigning a value, then the flag is no longer redacted.
fa.Redacted = false
diff --git a/cmd/release_config/release_config_lib/release_config.go b/cmd/release_config/release_config_lib/release_config.go
index 719ddc0..873f2fc 100644
--- a/cmd/release_config/release_config_lib/release_config.go
+++ b/cmd/release_config/release_config_lib/release_config.go
@@ -67,6 +67,9 @@
// overrides. Build flag value overrides are an error.
AconfigFlagsOnly bool
+ // True if this release config is not allowed as TARGET_RELEASE.
+ DisallowLunchUse bool
+
// Unmarshalled flag artifacts
FlagArtifacts FlagArtifacts
@@ -93,6 +96,11 @@
// If true, this is a proper release config that can be used in "lunch".
func (config *ReleaseConfig) isConfigListable() bool {
+ // Do not list disallowed release configs.
+ if config.DisallowLunchUse {
+ return false
+ }
+ // Logic based on ReleaseConfigType.
switch config.ReleaseConfigType {
case rc_proto.ReleaseConfigType_RELEASE_CONFIG:
return true
@@ -405,6 +413,7 @@
ValueDirectories: valueDirectories,
PriorStages: SortedMapKeys(config.PriorStagesMap),
ReleaseConfigType: config.ReleaseConfigType.Enum(),
+ DisallowLunchUse: proto.Bool(config.DisallowLunchUse),
}
config.compileInProgress = false
@@ -481,6 +490,9 @@
}
// As it stands this list is not per-product, but conceptually it is, and will be.
data += fmt.Sprintf("ALL_RELEASE_CONFIGS_FOR_PRODUCT :=$= %s\n", strings.Join(configs.GetAllReleaseNames(), " "))
+ if config.DisallowLunchUse {
+ data += fmt.Sprintf("_disallow_lunch_use :=$= true\n")
+ }
data += fmt.Sprintf("_used_files := %s\n", strings.Join(config.GetSortedFileList(), " "))
data += fmt.Sprintf("_ALL_RELEASE_FLAGS :=$= %s\n", strings.Join(names, " "))
for _, pName := range pNames {
diff --git a/cmd/release_config/release_config_lib/release_configs.go b/cmd/release_config/release_config_lib/release_configs.go
index 4f621c7..b0f8cb7 100644
--- a/cmd/release_config/release_config_lib/release_configs.go
+++ b/cmd/release_config/release_config_lib/release_configs.go
@@ -378,6 +378,7 @@
return fmt.Errorf("%s mismatching ReleaseConfigType value %s", path, *releaseConfigType)
}
config.FilesUsedMap[path] = true
+ config.DisallowLunchUse = config.DisallowLunchUse || releaseConfigContribution.proto.GetDisallowLunchUse()
inheritNames := make(map[string]bool)
for _, inh := range config.InheritNames {
inheritNames[inh] = true
diff --git a/cmd/soong_ui/main.go b/cmd/soong_ui/main.go
index c119823..7926292 100644
--- a/cmd/soong_ui/main.go
+++ b/cmd/soong_ui/main.go
@@ -197,7 +197,7 @@
rbeMetricsFile := filepath.Join(logsDir, c.logsPrefix+"rbe_metrics.pb")
soongBuildMetricsFile := filepath.Join(logsDir, c.logsPrefix+"soong_build_metrics.pb")
buildTraceFile := filepath.Join(logsDir, c.logsPrefix+"build.trace.gz")
- executionMetricsFile := filepath.Join(logsDir, c.logsPrefix+"soong_execution_metrics.pb")
+ executionMetricsFile := filepath.Join(logsDir, c.logsPrefix+"execution_metrics.pb")
metricsFiles := []string{
buildErrorFile, // build error strings
diff --git a/filesystem/aconfig_files.go b/filesystem/aconfig_files.go
index c80ae03..492ec69 100644
--- a/filesystem/aconfig_files.go
+++ b/filesystem/aconfig_files.go
@@ -17,26 +17,55 @@
import (
"android/soong/android"
+ "github.com/google/blueprint"
"github.com/google/blueprint/proptools"
)
-func (f *filesystem) buildAconfigFlagsFiles(ctx android.ModuleContext, builder *android.RuleBuilder, specs map[string]android.PackagingSpec, dir android.OutputPath) {
- if !proptools.Bool(f.properties.Gen_aconfig_flags_pb) {
- return
- }
+type installedAconfigFlagsInfo struct {
+ aconfigFiles android.Paths
+}
+var installedAconfigFlagsProvider = blueprint.NewProvider[installedAconfigFlagsInfo]()
+
+type importAconfigDepDag struct {
+ blueprint.BaseDependencyTag
+}
+
+var importAconfigDependencyTag = interPartitionDepTag{}
+
+func (f *filesystem) buildAconfigFlagsFiles(ctx android.ModuleContext, builder *android.RuleBuilder, specs map[string]android.PackagingSpec, dir android.OutputPath) {
var caches []android.Path
for _, ps := range specs {
caches = append(caches, ps.GetAconfigPaths()...)
}
+
+ ctx.VisitDirectDepsWithTag(importAconfigDependencyTag, func(m android.Module) {
+ info, ok := android.OtherModuleProvider(ctx, m, installedAconfigFlagsProvider)
+ if !ok {
+ ctx.ModuleErrorf("expected dependency %s to have an installedAconfigFlagsProvider", m.Name())
+ return
+ }
+ caches = append(caches, info.aconfigFiles...)
+ })
caches = android.SortedUniquePaths(caches)
+ android.SetProvider(ctx, installedAconfigFlagsProvider, installedAconfigFlagsInfo{
+ aconfigFiles: caches,
+ })
+
+ if !proptools.Bool(f.properties.Gen_aconfig_flags_pb) {
+ return
+ }
+
+ container := f.PartitionType()
+
installAconfigFlagsPath := dir.Join(ctx, "etc", "aconfig_flags.pb")
cmd := builder.Command().
BuiltTool("aconfig").
Text(" dump-cache --dedup --format protobuf --out").
Output(installAconfigFlagsPath).
- Textf("--filter container:%s", f.PartitionType())
+ Textf("--filter container:%s+state:ENABLED", container).
+ Textf("--filter container:%s+permission:READ_WRITE", container)
for _, cache := range caches {
cmd.FlagWithInput("--cache ", cache)
}
@@ -49,7 +78,7 @@
outputPath := installAconfigStorageDir.Join(ctx, fileName)
builder.Command().
BuiltTool("aconfig").
- FlagWithArg("create-storage --container ", f.PartitionType()).
+ FlagWithArg("create-storage --container ", container).
FlagWithArg("--file ", fileType).
FlagWithOutput("--out ", outputPath).
FlagWithArg("--cache ", installAconfigFlagsPath.String())
diff --git a/filesystem/bootimg.go b/filesystem/bootimg.go
index 0ffec26..36b1a18 100644
--- a/filesystem/bootimg.go
+++ b/filesystem/bootimg.go
@@ -391,15 +391,6 @@
return output
}
-// Calculates avb_salt from some input for deterministic output.
-func (b *bootimg) salt() string {
- var input []string
- input = append(input, b.properties.Cmdline...)
- input = append(input, proptools.StringDefault(b.properties.Partition_name, b.Name()))
- input = append(input, proptools.String(b.properties.Header_version))
- return sha1sum(input)
-}
-
func (b *bootimg) buildPropFile(ctx android.ModuleContext) (android.Path, android.Paths) {
var sb strings.Builder
var deps android.Paths
@@ -420,7 +411,6 @@
addStr("avb_add_hash_footer_args", "") // TODO(jiyong): add --rollback_index
partitionName := proptools.StringDefault(b.properties.Partition_name, b.Name())
addStr("partition_name", partitionName)
- addStr("avb_salt", b.salt())
propFile := android.PathForModuleOut(ctx, "prop")
android.WriteFileRule(ctx, propFile, sb.String())
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go
index 1d32b8f..7ffdf69 100644
--- a/filesystem/filesystem.go
+++ b/filesystem/filesystem.go
@@ -121,6 +121,9 @@
// avbtool. Default used by avbtool is sha1.
Avb_hash_algorithm *string
+ // The security patch passed to as the com.android.build.<type>.security_patch avb property.
+ Security_patch *string
+
// Whether or not to use forward-error-correction codes when signing with AVB. Defaults to true.
Use_fec *bool
@@ -178,6 +181,11 @@
// Install aconfig_flags.pb file for the modules installed in this partition.
Gen_aconfig_flags_pb *bool
+ // List of names of other filesystem partitions to import their aconfig flags from.
+ // This is used for the system partition to import system_ext's aconfig flags, as currently
+ // those are considered one "container": aosp/3261300
+ Import_aconfig_flags_from []string
+
Fsverity fsverityProperties
// If this property is set to true, the filesystem will call ctx.UncheckedModule(), causing
@@ -306,6 +314,9 @@
if f.properties.Android_filesystem_deps.System_ext != nil {
ctx.AddDependency(ctx.Module(), interPartitionDependencyTag, proptools.String(f.properties.Android_filesystem_deps.System_ext))
}
+ for _, partition := range f.properties.Import_aconfig_flags_from {
+ ctx.AddDependency(ctx.Module(), importAconfigDependencyTag, partition)
+ }
}
type fsType int
@@ -465,7 +476,7 @@
}
func (f *filesystem) appendToEntry(ctx android.ModuleContext, installedFile android.Path) {
- partitionBaseDir := android.PathForModuleOut(ctx, "root", proptools.String(f.properties.Base_dir)).String() + "/"
+ partitionBaseDir := android.PathForModuleOut(ctx, f.rootDirString(), proptools.String(f.properties.Base_dir)).String() + "/"
relPath, inTargetPartition := strings.CutPrefix(installedFile.String(), partitionBaseDir)
if inTargetPartition {
@@ -555,8 +566,12 @@
builder.Command().Textf("cp -prf %s/* %s", rebasedDir, installPath)
}
+func (f *filesystem) rootDirString() string {
+ return f.partitionName()
+}
+
func (f *filesystem) buildImageUsingBuildImage(ctx android.ModuleContext) android.Path {
- rootDir := android.PathForModuleOut(ctx, "root").OutputPath
+ rootDir := android.PathForModuleOut(ctx, f.rootDirString()).OutputPath
rebasedDir := rootDir
if f.properties.Base_dir != nil {
rebasedDir = rootDir.Join(ctx, *f.properties.Base_dir)
@@ -599,6 +614,7 @@
Input(propFile).
Implicits(toolDeps).
Implicit(fec).
+ FlagWithArg("--build_datetime_file ", ctx.Config().Getenv("BUILD_DATETIME_FILE")).
Output(output).
Text(rootDir.String()) // directory where to find fs_config_files|dirs
@@ -618,11 +634,6 @@
return fcBin
}
-// Calculates avb_salt from entry list (sorted) for deterministic output.
-func (f *filesystem) salt() string {
- return sha1sum(f.entries)
-}
-
func (f *filesystem) buildPropFile(ctx android.ModuleContext) (android.Path, android.Paths) {
var deps android.Paths
var propFileString strings.Builder
@@ -685,10 +696,14 @@
avb_add_hashtree_footer_args += " --rollback_index " + strconv.Itoa(rollbackIndex)
}
avb_add_hashtree_footer_args += fmt.Sprintf(" --prop com.android.build.%s.os_version:%s", f.partitionName(), ctx.Config().PlatformVersionLastStable())
+ // We're not going to add BuildFingerPrintFile as a dep. If it changed, it's likely because
+ // the build number changed, and we don't want to trigger rebuilds solely based on the build
+ // number.
avb_add_hashtree_footer_args += fmt.Sprintf(" --prop com.android.build.%s.fingerprint:{CONTENTS_OF:%s}", f.partitionName(), ctx.Config().BuildFingerprintFile(ctx))
- avb_add_hashtree_footer_args += fmt.Sprintf(" --prop com.android.build.%s.security_patch:%s", f.partitionName(), ctx.Config().PlatformSecurityPatch())
+ if f.properties.Security_patch != nil && proptools.String(f.properties.Security_patch) != "" {
+ avb_add_hashtree_footer_args += fmt.Sprintf(" --prop com.android.build.%s.security_patch:%s", f.partitionName(), proptools.String(f.properties.Security_patch))
+ }
addStr("avb_add_hashtree_footer_args", avb_add_hashtree_footer_args)
- addStr("avb_salt", f.salt())
}
if f.properties.File_contexts != nil && f.properties.Precompiled_file_contexts != nil {
@@ -741,10 +756,9 @@
android.WriteFileRuleVerbatim(ctx, propFilePreProcessing, propFileString.String())
propFile := android.PathForModuleOut(ctx, "prop")
ctx.Build(pctx, android.BuildParams{
- Rule: textFileProcessorRule,
- Input: propFilePreProcessing,
- Output: propFile,
- Implicit: ctx.Config().BuildFingerprintFile(ctx),
+ Rule: textFileProcessorRule,
+ Input: propFilePreProcessing,
+ Output: propFile,
})
return propFile, deps
}
@@ -783,7 +797,7 @@
ctx.PropertyErrorf("include_make_built_files", "include_make_built_files is not supported for compressed cpio image.")
}
- rootDir := android.PathForModuleOut(ctx, "root").OutputPath
+ rootDir := android.PathForModuleOut(ctx, f.rootDirString()).OutputPath
rebasedDir := rootDir
if f.properties.Base_dir != nil {
rebasedDir = rootDir.Join(ctx, *f.properties.Base_dir)
@@ -868,29 +882,10 @@
return
}
- logtagsFilePaths := make(map[string]bool)
- ctx.WalkDeps(func(child, parent android.Module) bool {
- if logtagsInfo, ok := android.OtherModuleProvider(ctx, child, android.LogtagsProviderKey); ok {
- for _, path := range logtagsInfo.Logtags {
- logtagsFilePaths[path.String()] = true
- }
- }
- return true
- })
-
- if len(logtagsFilePaths) == 0 {
- return
- }
-
etcPath := rebasedDir.Join(ctx, "etc")
eventLogtagsPath := etcPath.Join(ctx, "event-log-tags")
builder.Command().Text("mkdir").Flag("-p").Text(etcPath.String())
- cmd := builder.Command().BuiltTool("merge-event-log-tags").
- FlagWithArg("-o ", eventLogtagsPath.String())
-
- for _, path := range android.SortedKeys(logtagsFilePaths) {
- cmd.Text(path)
- }
+ builder.Command().Text("cp").Input(android.MergedLogtagsPath(ctx)).Text(eventLogtagsPath.String())
f.appendToEntry(ctx, eventLogtagsPath)
}
@@ -901,8 +896,10 @@
}
provideModules, _ := f.getLibsForLinkerConfig(ctx)
+ intermediateOutput := android.PathForModuleOut(ctx, "linker.config.pb")
+ linkerconfig.BuildLinkerConfig(ctx, android.PathsForModuleSrc(ctx, f.properties.Linker_config.Linker_config_srcs), provideModules, nil, intermediateOutput)
output := rebasedDir.Join(ctx, "etc", "linker.config.pb")
- linkerconfig.BuildLinkerConfig(ctx, builder, android.PathsForModuleSrc(ctx, f.properties.Linker_config.Linker_config_srcs), provideModules, nil, output)
+ builder.Command().Text("cp").Input(intermediateOutput).Output(output)
f.appendToEntry(ctx, output)
}
@@ -1092,6 +1089,12 @@
}
thisPartition := f.PartitionType()
if thisPartition != "vendor" && thisPartition != "product" {
+ if f.properties.Android_filesystem_deps.System != nil {
+ ctx.PropertyErrorf("android_filesystem_deps.system", "only vendor or product partitions can use android_filesystem_deps")
+ }
+ if f.properties.Android_filesystem_deps.System_ext != nil {
+ ctx.PropertyErrorf("android_filesystem_deps.system_ext", "only vendor or product partitions can use android_filesystem_deps")
+ }
return
}
ctx.WalkDeps(func(child, parent android.Module) bool {
diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go
index 0ed3870..33cddf8 100644
--- a/filesystem/filesystem_test.go
+++ b/filesystem/filesystem_test.go
@@ -16,7 +16,6 @@
import (
"os"
- "strings"
"testing"
"android/soong/android"
@@ -181,11 +180,9 @@
`)
module := result.ModuleForTests("myfilesystem", "android_common")
- output := module.Output("out/soong/.intermediates/myfilesystem/android_common/root/system/etc/linker.config.pb")
+ output := module.Output("out/soong/.intermediates/myfilesystem/android_common/linker.config.pb")
- fullCommand := output.RuleParams.Command
- startIndex := strings.Index(fullCommand, "conv_linker_config")
- linkerConfigCommand := fullCommand[startIndex:]
+ linkerConfigCommand := output.RuleParams.Command
android.AssertStringDoesContain(t, "linker.config.pb should have libfoo",
linkerConfigCommand, "libfoo.so")
@@ -735,7 +732,7 @@
}
`)
- linkerConfigCmd := result.ModuleForTests("myfilesystem", "android_common").Rule("build_filesystem_image").RuleParams.Command
+ linkerConfigCmd := result.ModuleForTests("myfilesystem", "android_common").Output("out/soong/.intermediates/myfilesystem/android_common/linker.config.pb").RuleParams.Command
android.AssertStringDoesContain(t, "Could not find linker.config.json file in cmd", linkerConfigCmd, "conv_linker_config proto --force -s linker.config.json")
android.AssertStringDoesContain(t, "Could not find stub in `provideLibs`", linkerConfigCmd, "--key provideLibs --value libfoo_has_stubs.so")
}
diff --git a/filesystem/fsverity_metadata.go b/filesystem/fsverity_metadata.go
index 6372c5e..91b8c57 100644
--- a/filesystem/fsverity_metadata.go
+++ b/filesystem/fsverity_metadata.go
@@ -85,6 +85,18 @@
f.appendToEntry(ctx, destPath)
}
+ fsVerityBaseDir := rootDir.String()
+ if f.PartitionType() == "system_ext" {
+ // Use the equivalent of $PRODUCT_OUT as the base dir.
+ // This ensures that the paths in build_manifest.pb contain on-device paths
+ // e.g. system_ext/framework/javalib.jar
+ // and not framework/javalib.jar.
+ //
+ // Although base-dir is outside the rootdir provided for packaging, this action
+ // is hermetic since it uses `manifestGeneratorListPath` to filter the files to be written to build_manifest.pb
+ fsVerityBaseDir = filepath.Dir(rootDir.String())
+ }
+
// STEP 2: generate signed BuildManifest.apk
// STEP 2-1: generate build_manifest.pb
manifestGeneratorListPath := android.PathForModuleOut(ctx, "fsverity_manifest.list")
@@ -96,7 +108,7 @@
builder.Command().
BuiltTool("fsverity_manifest_generator").
FlagWithInput("--fsverity-path ", fsverityPath).
- FlagWithArg("--base-dir ", rootDir.String()).
+ FlagWithArg("--base-dir ", fsVerityBaseDir).
FlagWithArg("--output ", manifestPbPath.String()).
FlagWithInput("@", manifestGeneratorListPath)
diff --git a/filesystem/system_image.go b/filesystem/system_image.go
index 60a5133..874d20d 100644
--- a/filesystem/system_image.go
+++ b/filesystem/system_image.go
@@ -16,6 +16,7 @@
import (
"android/soong/android"
+ "android/soong/cc"
"android/soong/linkerconfig"
"strings"
@@ -48,9 +49,45 @@
return
}
- provideModules, requireModules := s.getLibsForLinkerConfig(ctx)
output := rebasedDir.Join(ctx, "etc", "linker.config.pb")
- linkerconfig.BuildLinkerConfig(ctx, builder, android.PathsForModuleSrc(ctx, s.filesystem.properties.Linker_config.Linker_config_srcs), provideModules, requireModules, output)
+ if s.filesystem.properties.Linker_config.Linker_config_srcs != nil {
+ provideModules, requireModules := s.getLibsForLinkerConfig(ctx)
+ intermediateOutput := android.PathForModuleOut(ctx, "linker.config.pb")
+ linkerconfig.BuildLinkerConfig(ctx, android.PathsForModuleSrc(ctx, s.filesystem.properties.Linker_config.Linker_config_srcs), provideModules, requireModules, intermediateOutput)
+ builder.Command().Text("cp").Input(intermediateOutput).Output(output)
+ } else {
+ // TODO: This branch is the logic that make uses for the linker config file, which is
+ // different than linkerconfig.BuildLinkerConfig used above. Keeping both branches for now
+ // because microdroid uses the other method and is in theory happy with it. But we should
+ // consider deduping them.
+ stubLibraries := cc.StubLibrariesFile(ctx)
+ llndkMovedToApexLibraries := cc.MovedToApexLlndkLibrariesFile(ctx)
+ outputStep1 := android.PathForModuleOut(ctx, "linker.config.pb.step1")
+ builder.Command().
+ BuiltTool("conv_linker_config").
+ Text("proto --force").
+ FlagWithInput("-s ", android.PathForSource(ctx, "system/core/rootdir/etc/linker.config.json")).
+ FlagWithOutput("-o ", outputStep1)
+ builder.Temporary(outputStep1)
+ builder.Command().
+ BuiltTool("conv_linker_config").
+ Text("systemprovide").
+ FlagWithInput("--source ", outputStep1).
+ FlagWithArg("--output ", output.String()).
+ Textf(`--value "$(cat %s)"`, stubLibraries).
+ Implicit(stubLibraries).
+ FlagWithArg("--system ", rebasedDir.String())
+ builder.Command().
+ BuiltTool("conv_linker_config").
+ Text("append").
+ FlagWithArg("--source ", output.String()).
+ FlagWithOutput("--output ", output).
+ FlagWithArg("--key ", "requireLibs").
+ Textf(`--value "$(cat %s)"`, llndkMovedToApexLibraries).
+ Implicit(llndkMovedToApexLibraries)
+ // TODO: Make also supports adding an extra append command with PRODUCT_EXTRA_STUB_LIBRARIES,
+ // but that variable appears to have no usages.
+ }
s.appendToEntry(ctx, output)
}
diff --git a/fsgen/config.go b/fsgen/config.go
index 31f721b..a217600 100644
--- a/fsgen/config.go
+++ b/fsgen/config.go
@@ -110,7 +110,6 @@
// filesystem module.
commonPartitionDirs = []string{
// From generic_rootdirs in build/make/target/product/generic/Android.bp
- "acct",
"apex",
"bootstrap-apex",
"config",
diff --git a/fsgen/filesystem_creator.go b/fsgen/filesystem_creator.go
index b9fddca..35d2e44 100644
--- a/fsgen/filesystem_creator.go
+++ b/fsgen/filesystem_creator.go
@@ -266,6 +266,11 @@
)
fsProps.Base_dir = proptools.StringPtr("system")
fsProps.Dirs = proptools.NewSimpleConfigurable(commonPartitionDirs)
+ fsProps.Security_patch = proptools.StringPtr(ctx.Config().PlatformSecurityPatch())
+
+ if ctx.DeviceConfig().SystemExtPath() == "system_ext" {
+ fsProps.Import_aconfig_flags_from = []string{generatedModuleNameForPartition(ctx.Config(), "system_ext")}
+ }
case "system_ext":
if partitionVars.ProductFsverityGenerateMetadata {
fsProps.Fsverity.Inputs = []string{
@@ -275,12 +280,14 @@
}
fsProps.Fsverity.Libs = []string{":framework-res{.export-package.apk}"}
}
+ fsProps.Security_patch = proptools.StringPtr(ctx.Config().PlatformSecurityPatch())
case "product":
fsProps.Gen_aconfig_flags_pb = proptools.BoolPtr(true)
fsProps.Android_filesystem_deps.System = proptools.StringPtr(generatedModuleNameForPartition(ctx.Config(), "system"))
if ctx.DeviceConfig().SystemExtPath() == "system_ext" {
fsProps.Android_filesystem_deps.System_ext = proptools.StringPtr(generatedModuleNameForPartition(ctx.Config(), "system_ext"))
}
+ fsProps.Security_patch = proptools.StringPtr(ctx.Config().PlatformSecurityPatch())
case "vendor":
fsProps.Gen_aconfig_flags_pb = proptools.BoolPtr(true)
fsProps.Symlinks = []filesystem.SymlinkDefinition{
@@ -297,6 +304,7 @@
if ctx.DeviceConfig().SystemExtPath() == "system_ext" {
fsProps.Android_filesystem_deps.System_ext = proptools.StringPtr(generatedModuleNameForPartition(ctx.Config(), "system_ext"))
}
+ fsProps.Security_patch = proptools.StringPtr(partitionVars.VendorSecurityPatch)
case "odm":
fsProps.Symlinks = []filesystem.SymlinkDefinition{
filesystem.SymlinkDefinition{
@@ -304,6 +312,7 @@
Name: proptools.StringPtr("lib/modules"),
},
}
+ fsProps.Security_patch = proptools.StringPtr(partitionVars.OdmSecurityPatch)
case "userdata":
fsProps.Base_dir = proptools.StringPtr("data")
case "ramdisk":
@@ -358,6 +367,12 @@
Target: proptools.StringPtr("prop.default"),
Name: proptools.StringPtr("default.prop"),
}), "root")
+ case "system_dlkm":
+ fsProps.Security_patch = proptools.StringPtr(partitionVars.SystemDlkmSecurityPatch)
+ case "vendor_dlkm":
+ fsProps.Security_patch = proptools.StringPtr(partitionVars.VendorDlkmSecurityPatch)
+ case "odm_dlkm":
+ fsProps.Security_patch = proptools.StringPtr(partitionVars.OdmDlkmSecurityPatch)
}
}
@@ -562,9 +577,11 @@
Name *string
Board_info_files []string
Bootloader_board_name *string
+ Stem *string
}{
- Name: proptools.StringPtr(generatedModuleName(ctx.Config(), "android-info.prop")),
+ Name: proptools.StringPtr(generatedModuleName(ctx.Config(), "android_info.prop")),
Board_info_files: partitionVars.BoardInfoFiles,
+ Stem: proptools.StringPtr("android_info.txt"),
}
if len(androidInfoProps.Board_info_files) == 0 {
androidInfoProps.Bootloader_board_name = proptools.StringPtr(partitionVars.BootLoaderBoardName)
@@ -596,6 +613,43 @@
vendorBuildProp.HideFromMake()
}
+func createRecoveryBuildProp(ctx android.LoadHookContext) string {
+ moduleName := generatedModuleName(ctx.Config(), "recovery-prop.default")
+
+ var vendorBuildProp *string
+ if android.InList("vendor", generatedPartitions(ctx)) {
+ vendorBuildProp = proptools.StringPtr(":" + generatedModuleName(ctx.Config(), "vendor-build.prop"))
+ }
+
+ recoveryBuildProps := &struct {
+ Name *string
+ System_build_prop *string
+ Vendor_build_prop *string
+ Odm_build_prop *string
+ Product_build_prop *string
+ System_ext_build_prop *string
+
+ Recovery *bool
+ No_full_install *bool
+ Visibility []string
+ }{
+ Name: proptools.StringPtr(moduleName),
+ System_build_prop: proptools.StringPtr(":system-build.prop"),
+ Vendor_build_prop: vendorBuildProp,
+ Odm_build_prop: proptools.StringPtr(":odm-build.prop"),
+ Product_build_prop: proptools.StringPtr(":product-build.prop"),
+ System_ext_build_prop: proptools.StringPtr(":system_ext-build.prop"),
+
+ Recovery: proptools.BoolPtr(true),
+ No_full_install: proptools.BoolPtr(true),
+ Visibility: []string{"//visibility:public"},
+ }
+
+ ctx.CreateModule(android.RecoveryBuildPropModuleFactory, recoveryBuildProps)
+
+ return moduleName
+}
+
// createLinkerConfigSourceFilegroups creates filegroup modules to generate linker.config.pb for the following partitions
// 1. vendor: Using PRODUCT_VENDOR_LINKER_CONFIG_FRAGMENTS (space separated file list)
// 1. product: Using PRODUCT_PRODUCT_LINKER_CONFIG_FRAGMENTS (space separated file list)
@@ -709,6 +763,9 @@
}
fsProps.Is_auto_generated = proptools.BoolPtr(true)
+ if partitionType != "system" {
+ fsProps.Mount_point = proptools.StringPtr(partitionType)
+ }
partitionSpecificFsProps(ctx, fsProps, partitionVars, partitionType)
diff --git a/fsgen/fsgen_mutators.go b/fsgen/fsgen_mutators.go
index 20e4c3e..de0a1cb 100644
--- a/fsgen/fsgen_mutators.go
+++ b/fsgen/fsgen_mutators.go
@@ -165,6 +165,7 @@
// Add common resources `prebuilt_res` module as dep of recovery partition
(*fsGenState.fsDeps["recovery"])[fmt.Sprintf("recovery-resources-common-%s", getDpi(ctx))] = defaultDepCandidateProps(ctx.Config())
(*fsGenState.fsDeps["recovery"])[getRecoveryFontModuleName(ctx)] = defaultDepCandidateProps(ctx.Config())
+ (*fsGenState.fsDeps["recovery"])[createRecoveryBuildProp(ctx)] = defaultDepCandidateProps(ctx.Config())
return &fsGenState
}).(*FsGenState)
diff --git a/java/base.go b/java/base.go
index 215285f..18a875b 100644
--- a/java/base.go
+++ b/java/base.go
@@ -109,6 +109,10 @@
// if not blank, used as prefix to generate repackage rule
Jarjar_prefix *string
+ // Number of shards for jarjar. It needs to be an integer represented as a string.
+ // TODO(b/383559945) change it to int, once Configurable supports the type.
+ Jarjar_shards proptools.Configurable[string]
+
// If not blank, set the java version passed to javac as -source and -target
Java_version *string
@@ -1273,7 +1277,7 @@
localHeaderJars, combinedHeaderJarFile := j.compileJavaHeader(ctx, uniqueJavaFiles, srcJars, deps, flags, jarName,
extraCombinedJars)
- combinedHeaderJarFile, jarjared := j.jarjarIfNecessary(ctx, combinedHeaderJarFile, jarName, "turbine")
+ combinedHeaderJarFile, jarjared := j.jarjarIfNecessary(ctx, combinedHeaderJarFile, jarName, "turbine", false)
if jarjared {
localHeaderJars = android.Paths{combinedHeaderJarFile}
transitiveStaticLibsHeaderJars = nil
@@ -1409,7 +1413,7 @@
shardingHeaderJars = localHeaderJars
var jarjared bool
- j.headerJarFile, jarjared = j.jarjarIfNecessary(ctx, combinedHeaderJarFile, jarName, "turbine")
+ j.headerJarFile, jarjared = j.jarjarIfNecessary(ctx, combinedHeaderJarFile, jarName, "turbine", false)
if jarjared {
// jarjar modifies transitive static dependencies, use the combined header jar and drop the transitive
// static libs header jars.
@@ -1442,20 +1446,27 @@
// build.
flags = enableErrorproneFlags(flags)
} else if hasErrorproneableFiles && ctx.Config().RunErrorProne() && j.properties.Errorprone.Enabled == nil {
- // Otherwise, if the RUN_ERROR_PRONE environment variable is set, create
- // a new jar file just for compiling with the errorprone compiler to.
- // This is because we don't want to cause the java files to get completely
- // rebuilt every time the state of the RUN_ERROR_PRONE variable changes.
- // We also don't want to run this if errorprone is enabled by default for
- // this module, or else we could have duplicated errorprone messages.
- errorproneFlags := enableErrorproneFlags(flags)
- errorprone := android.PathForModuleOut(ctx, "errorprone", jarName)
- errorproneAnnoSrcJar := android.PathForModuleOut(ctx, "errorprone", "anno.srcjar")
+ if ctx.Config().RunErrorProneInline() {
+ // On CI, we're not going to toggle back/forth between errorprone and non-errorprone
+ // builds, so it's faster if we don't compile the module twice and instead always
+ // compile the module with errorprone.
+ flags = enableErrorproneFlags(flags)
+ } else {
+ // Otherwise, if the RUN_ERROR_PRONE environment variable is set, create
+ // a new jar file just for compiling with the errorprone compiler to.
+ // This is because we don't want to cause the java files to get completely
+ // rebuilt every time the state of the RUN_ERROR_PRONE variable changes.
+ // We also don't want to run this if errorprone is enabled by default for
+ // this module, or else we could have duplicated errorprone messages.
+ errorproneFlags := enableErrorproneFlags(flags)
+ errorprone := android.PathForModuleOut(ctx, "errorprone", jarName)
+ errorproneAnnoSrcJar := android.PathForModuleOut(ctx, "errorprone", "anno.srcjar")
- transformJavaToClasses(ctx, errorprone, -1, uniqueJavaFiles, srcJars, errorproneAnnoSrcJar, errorproneFlags, nil,
- "errorprone", "errorprone")
+ transformJavaToClasses(ctx, errorprone, -1, uniqueJavaFiles, srcJars, errorproneAnnoSrcJar, errorproneFlags, nil,
+ "errorprone", "errorprone")
- extraJarDeps = append(extraJarDeps, errorprone)
+ extraJarDeps = append(extraJarDeps, errorprone)
+ }
}
if enableSharding {
@@ -1636,7 +1647,7 @@
}
// jarjar implementation jar if necessary
- jarjarFile, jarjarred := j.jarjarIfNecessary(ctx, outputFile, jarName, "")
+ jarjarFile, jarjarred := j.jarjarIfNecessary(ctx, outputFile, jarName, "", true)
if jarjarred {
localImplementationJars = android.Paths{jarjarFile}
completeStaticLibsImplementationJars = depset.New(depset.PREORDER, localImplementationJars, nil)
@@ -1645,7 +1656,7 @@
// jarjar resource jar if necessary
if combinedResourceJar != nil {
- resourceJarJarFile, jarjarred := j.jarjarIfNecessary(ctx, combinedResourceJar, jarName, "resource")
+ resourceJarJarFile, jarjarred := j.jarjarIfNecessary(ctx, combinedResourceJar, jarName, "resource", false)
combinedResourceJar = resourceJarJarFile
if jarjarred {
localResourceJars = android.Paths{resourceJarJarFile}
@@ -2934,12 +2945,23 @@
return repackagedJarjarFile, true
}
-func (j *Module) jarjarIfNecessary(ctx android.ModuleContext, infile android.Path, jarName, info string) (android.Path, bool) {
+func (j *Module) jarjarIfNecessary(ctx android.ModuleContext, infile android.Path, jarName, info string, useShards bool) (android.Path, bool) {
if j.expandJarjarRules == nil {
return infile, false
}
jarjarFile := android.PathForModuleOut(ctx, "jarjar", info, jarName)
- TransformJarJar(ctx, jarjarFile, infile, j.expandJarjarRules)
+
+ totalShards := 1
+ if useShards {
+ totalShardsStr := j.properties.Jarjar_shards.GetOrDefault(ctx, "1")
+ ts, err := strconv.Atoi(totalShardsStr)
+ if err != nil {
+ ctx.PropertyErrorf("jarjar_shards", "jarjar_shards must be an integer represented as a string")
+ return infile, false
+ }
+ totalShards = ts
+ }
+ TransformJarJarWithShards(ctx, jarjarFile, infile, j.expandJarjarRules, totalShards)
return jarjarFile, true
}
diff --git a/java/builder.go b/java/builder.go
index 01fbbdd..88058e0 100644
--- a/java/builder.go
+++ b/java/builder.go
@@ -168,7 +168,7 @@
"${config.JavaCmd}",
},
Rspfile: "$out.rsp",
- RspfileContent: "$in",
+ RspfileContent: "$in_newline",
Restat: true,
},
&remoteexec.REParams{Labels: map[string]string{"type": "tool", "name": "turbine"},
@@ -238,12 +238,12 @@
// for newly repackaged classes. Dropping @UnsupportedAppUsage on repackaged classes
// avoids adding new hiddenapis after jarjar'ing.
" -DremoveAndroidCompatAnnotations=true" +
- " -jar ${config.JarjarCmd} process $rulesFile $in $out && " +
+ " -jar ${config.JarjarCmd} process $rulesFile $in $out $total_shards $shard_index && " +
// Turn a missing output file into a ninja error
`[ -e ${out} ] || (echo "Missing output file"; exit 1)`,
CommandDeps: []string{"${config.JavaCmd}", "${config.JarjarCmd}", "$rulesFile"},
},
- "rulesFile")
+ "rulesFile", "total_shards", "shard_index")
packageCheck = pctx.AndroidStaticRule("packageCheck",
blueprint.RuleParams{
@@ -459,7 +459,7 @@
const srcJarArgsLimit = 32 * 1024
if len(srcJarArgs) > srcJarArgsLimit {
srcJarRspFile := android.PathForModuleOut(ctx, "turbine", "srcjars.rsp")
- android.WriteFileRule(ctx, srcJarRspFile, srcJarArgs)
+ android.WriteFileRule(ctx, srcJarRspFile, strings.Join(srcJars.Strings(), "\n"))
srcJarArgs = "@" + srcJarRspFile.String()
implicits = append(implicits, srcJarRspFile)
rbeInputs = append(rbeInputs, srcJarRspFile)
@@ -491,7 +491,7 @@
const classpathLimit = 32 * 1024
if len(classpathFlags) > classpathLimit {
classpathRspFile := android.PathForModuleOut(ctx, dir, "classpath.rsp")
- android.WriteFileRule(ctx, classpathRspFile, classpathFlags)
+ android.WriteFileRule(ctx, classpathRspFile, strings.Join(classpath.Strings(), "\n"))
classpathFlags = "@" + classpathRspFile.String()
implicits = append(implicits, classpathRspFile)
rspFiles = append(rspFiles, classpathRspFile)
@@ -750,16 +750,58 @@
func TransformJarJar(ctx android.ModuleContext, outputFile android.WritablePath,
classesJar android.Path, rulesFile android.Path) {
+ TransformJarJarWithShards(ctx, outputFile, classesJar, rulesFile, 1)
+}
+
+func TransformJarJarWithShards(ctx android.ModuleContext, outputFile android.WritablePath,
+ classesJar android.Path, rulesFile android.Path, totalShards int) {
+
+ // If the total number of shards is 1, just run jarjar as-is, with `total_shards` = 1
+ // and `shard_index` == 0, which effectively disables sharding
+ if totalShards == 1 {
+ ctx.Build(pctx, android.BuildParams{
+ Rule: jarjar,
+ Description: "jarjar",
+ Output: outputFile,
+ Input: classesJar,
+ Implicit: rulesFile,
+ Args: map[string]string{
+ "rulesFile": rulesFile.String(),
+ "total_shards": "1",
+ "shard_index": "0",
+ },
+ })
+ return
+ }
+
+ // Otherwise, run multiple jarjar instances and use merge_zips to combine the output.
+ tempJars := make([]android.Path, 0)
+ totalStr := strconv.Itoa(totalShards)
+ for i := 0; i < totalShards; i++ {
+ iStr := strconv.Itoa(i)
+ tempOut := android.PathForOutput(ctx, outputFile.String()+"-"+iStr+".jar")
+ ctx.Build(pctx, android.BuildParams{
+ Rule: jarjar,
+ Description: "jarjar (" + iStr + "/" + totalStr + ")",
+ Output: tempOut,
+ Input: classesJar,
+ Implicit: rulesFile,
+ Args: map[string]string{
+ "rulesFile": rulesFile.String(),
+ "total_shards": totalStr,
+ "shard_index": iStr,
+ },
+ })
+ tempJars = append(tempJars, tempOut)
+ }
+
ctx.Build(pctx, android.BuildParams{
- Rule: jarjar,
- Description: "jarjar",
+ Rule: combineJar,
+ Description: "merge jarjar shards",
Output: outputFile,
- Input: classesJar,
- Implicit: rulesFile,
- Args: map[string]string{
- "rulesFile": rulesFile.String(),
- },
+ Inputs: tempJars,
})
+
}
func CheckJarPackages(ctx android.ModuleContext, outputFile android.WritablePath,
diff --git a/java/config/config.go b/java/config/config.go
index 7c29722..19d6952 100644
--- a/java/config/config.go
+++ b/java/config/config.go
@@ -42,6 +42,9 @@
InstrumentFrameworkModules = []string{
"framework",
"framework-minus-apex",
+ // TODO(b/383559945) Remove "framework-minus-apex_jarjar-sharded" once
+ // we remove this module.
+ "framework-minus-apex_jarjar-sharded",
"ims-common",
"telephony-common",
"services",
diff --git a/java/fuzz.go b/java/fuzz.go
index dba8815..79cd042 100644
--- a/java/fuzz.go
+++ b/java/fuzz.go
@@ -107,7 +107,7 @@
}
func (j *JavaFuzzTest) GenerateAndroidBuildActions(ctx android.ModuleContext) {
- j.fuzzPackagedModule = cc.PackageFuzzModule(ctx, j.fuzzPackagedModule, pctx)
+ j.fuzzPackagedModule = cc.PackageFuzzModule(ctx, j.fuzzPackagedModule)
_, sharedDeps := cc.CollectAllSharedDependencies(ctx)
for _, dep := range sharedDeps {
diff --git a/java/legacy_core_platform_api_usage.go b/java/legacy_core_platform_api_usage.go
index 4be7d04..6128ce3 100644
--- a/java/legacy_core_platform_api_usage.go
+++ b/java/legacy_core_platform_api_usage.go
@@ -28,6 +28,9 @@
"FloralClocks",
"framework-jobscheduler",
"framework-minus-apex",
+ // TODO(b/383559945) Remove "framework-minus-apex_jarjar-sharded" once
+ // we remove this module.
+ "framework-minus-apex_jarjar-sharded",
"framework-minus-apex-headers",
"framework-minus-apex-intdefs",
"FrameworksCoreTests",
diff --git a/linkerconfig/linkerconfig.go b/linkerconfig/linkerconfig.go
index d422871..7684db2 100644
--- a/linkerconfig/linkerconfig.go
+++ b/linkerconfig/linkerconfig.go
@@ -76,9 +76,7 @@
input := android.PathForModuleSrc(ctx, android.String(l.properties.Src))
output := android.PathForModuleOut(ctx, "linker.config.pb").OutputPath
- builder := android.NewRuleBuilder(pctx, ctx)
- BuildLinkerConfig(ctx, builder, android.Paths{input}, nil, nil, output)
- builder.Build("conv_linker_config", "Generate linker config protobuf "+output.String())
+ BuildLinkerConfig(ctx, android.Paths{input}, nil, nil, output)
l.outputFilePath = output
l.installDirPath = android.PathForModuleInstall(ctx, "etc")
@@ -90,10 +88,15 @@
ctx.SetOutputFiles(android.Paths{l.outputFilePath}, "")
}
-func BuildLinkerConfig(ctx android.ModuleContext, builder *android.RuleBuilder,
- inputs android.Paths, provideModules []android.Module, requireModules []android.Module, output android.OutputPath) {
-
+func BuildLinkerConfig(
+ ctx android.ModuleContext,
+ inputs android.Paths,
+ provideModules []android.Module,
+ requireModules []android.Module,
+ output android.WritablePath,
+) {
// First, convert the input json to protobuf format
+ builder := android.NewRuleBuilder(pctx, ctx)
interimOutput := android.PathForModuleOut(ctx, "temp.pb")
cmd := builder.Command().
BuiltTool("conv_linker_config").
@@ -157,6 +160,7 @@
builder.Temporary(interimOutput)
builder.DeleteTemporaryFiles()
+ builder.Build("conv_linker_config_"+output.String(), "Generate linker config protobuf "+output.String())
}
// linker_config generates protobuf file from json file. This protobuf file will be used from
diff --git a/rust/builder.go b/rust/builder.go
index a1e17fc..e5434ef 100644
--- a/rust/builder.go
+++ b/rust/builder.go
@@ -30,11 +30,11 @@
rustc = pctx.AndroidStaticRule("rustc",
blueprint.RuleParams{
Command: "$envVars $rustcCmd " +
- "-C linker=${config.RustLinker} " +
- "-C link-args=\"${crtBegin} ${earlyLinkFlags} ${linkFlags} ${crtEnd}\" " +
+ "-C linker=${RustcLinkerCmd} " +
+ "-C link-args=\"--android-clang-bin=${config.ClangCmd} ${crtBegin} ${earlyLinkFlags} ${linkFlags} ${crtEnd}\" " +
"--emit link -o $out --emit dep-info=$out.d.raw $in ${libFlags} $rustcFlags" +
" && grep ^$out: $out.d.raw > $out.d",
- CommandDeps: []string{"$rustcCmd"},
+ CommandDeps: []string{"$rustcCmd", "${RustcLinkerCmd}", "${config.ClangCmd}"},
// Rustc deps-info writes out make compatible dep files: https://github.com/rust-lang/rust/issues/7633
// Rustc emits unneeded dependency lines for the .d and input .rs files.
// Those extra lines cause ninja warning:
@@ -102,10 +102,10 @@
`KYTHE_CANONICALIZE_VNAME_PATHS=prefer-relative ` +
`$rustExtractor $envVars ` +
`$rustcCmd ` +
- `-C linker=${config.RustLinker} ` +
- `-C link-args="${crtBegin} ${linkFlags} ${crtEnd}" ` +
+ `-C linker=${RustcLinkerCmd} ` +
+ `-C link-args="--android-clang-bin=${config.ClangCmd} ${crtBegin} ${linkFlags} ${crtEnd}" ` +
`$in ${libFlags} $rustcFlags`,
- CommandDeps: []string{"$rustExtractor", "$kytheVnames"},
+ CommandDeps: []string{"$rustExtractor", "$kytheVnames", "${RustcLinkerCmd}", "${config.ClangCmd}"},
Rspfile: "${out}.rsp",
RspfileContent: "$in",
},
@@ -119,6 +119,7 @@
func init() {
pctx.HostBinToolVariable("SoongZipCmd", "soong_zip")
+ pctx.HostBinToolVariable("RustcLinkerCmd", "rustc_linker")
cc.TransformRlibstoStaticlib = TransformRlibstoStaticlib
}
@@ -411,6 +412,7 @@
implicits = append(implicits, deps.SharedLibDeps...)
implicits = append(implicits, deps.srcProviderFiles...)
implicits = append(implicits, deps.AfdoProfiles...)
+ implicits = append(implicits, deps.LinkerDeps...)
implicits = append(implicits, deps.CrtBegin...)
implicits = append(implicits, deps.CrtEnd...)
diff --git a/rust/config/global.go b/rust/config/global.go
index 7b79fca..66ffc0b 100644
--- a/rust/config/global.go
+++ b/rust/config/global.go
@@ -121,7 +121,7 @@
pctx.StaticVariable("RustBin", "${RustPath}/bin")
pctx.ImportAs("cc_config", "android/soong/cc/config")
- pctx.StaticVariable("RustLinker", "${cc_config.ClangBin}/clang++")
+ pctx.StaticVariable("ClangCmd", "${cc_config.ClangBin}/clang++")
pctx.StaticVariable("DeviceGlobalLinkFlags", strings.Join(deviceGlobalLinkFlags, " "))
diff --git a/rust/fuzz.go b/rust/fuzz.go
index 68becb5..9e8efd7 100644
--- a/rust/fuzz.go
+++ b/rust/fuzz.go
@@ -130,7 +130,7 @@
}
func (fuzz *fuzzDecorator) install(ctx ModuleContext) {
- fuzz.fuzzPackagedModule = cc.PackageFuzzModule(ctx, fuzz.fuzzPackagedModule, pctx)
+ fuzz.fuzzPackagedModule = cc.PackageFuzzModule(ctx, fuzz.fuzzPackagedModule)
installBase := "fuzz"
diff --git a/rust/library.go b/rust/library.go
index ffc8ab0..14a2b65 100644
--- a/rust/library.go
+++ b/rust/library.go
@@ -64,6 +64,18 @@
// path to include directories to export to cc_* modules, only relevant for static/shared variants.
Export_include_dirs []string `android:"path,arch_variant"`
+ // Version script to pass to the linker. By default this will replace the
+ // implicit rustc emitted version script to mirror expected behavior in CC.
+ // This is only relevant for rust_ffi_shared modules which are exposing a
+ // versioned C API.
+ Version_script *string `android:"path,arch_variant"`
+
+ // A version_script formatted text file with additional symbols to export
+ // for rust shared or dylibs which the rustc compiler does not automatically
+ // export, e.g. additional symbols from whole_static_libs. Unlike
+ // Version_script, this is not meant to imply a stable API.
+ Extra_exported_symbols *string `android:"path,arch_variant"`
+
// Whether this library is part of the Rust toolchain sysroot.
Sysroot *bool
@@ -539,7 +551,31 @@
flags.LinkFlags = append(flags.LinkFlags, deps.depLinkFlags...)
flags.LinkFlags = append(flags.LinkFlags, deps.linkObjects...)
+ if String(library.Properties.Version_script) != "" {
+ if String(library.Properties.Extra_exported_symbols) != "" {
+ ctx.ModuleErrorf("version_script and extra_exported_symbols cannot both be set.")
+ }
+
+ if library.shared() {
+ // "-Wl,--android-version-script" signals to the rustcLinker script
+ // that the default version script should be removed.
+ flags.LinkFlags = append(flags.LinkFlags, "-Wl,--android-version-script="+android.PathForModuleSrc(ctx, String(library.Properties.Version_script)).String())
+ deps.LinkerDeps = append(deps.LinkerDeps, android.PathForModuleSrc(ctx, String(library.Properties.Version_script)))
+ } else if !library.static() && !library.rlib() {
+ // We include rlibs here because rust_ffi produces rlib variants
+ ctx.PropertyErrorf("version_script", "can only be set for rust_ffi modules")
+ }
+ }
+
+ if String(library.Properties.Extra_exported_symbols) != "" {
+ // Passing a second version script (rustc calculates and emits a
+ // default version script) will concatenate the first version script.
+ flags.LinkFlags = append(flags.LinkFlags, "-Wl,--version-script="+android.PathForModuleSrc(ctx, String(library.Properties.Extra_exported_symbols)).String())
+ deps.LinkerDeps = append(deps.LinkerDeps, android.PathForModuleSrc(ctx, String(library.Properties.Extra_exported_symbols)))
+ }
+
if library.dylib() {
+
// We need prefer-dynamic for now to avoid linking in the static stdlib. See:
// https://github.com/rust-lang/rust/issues/19680
// https://github.com/rust-lang/rust/issues/34909
diff --git a/rust/library_test.go b/rust/library_test.go
index 45c0ed6..256cb35 100644
--- a/rust/library_test.go
+++ b/rust/library_test.go
@@ -441,3 +441,60 @@
libfooStatic := ctx.ModuleForTests("libfoo", "linux_glibc_x86_64_static").Rule("cc")
android.AssertStringDoesContain(t, "cFlags for lib module", libfooStatic.Args["cFlags"], " -Irust_includes ")
}
+
+func TestRustVersionScript(t *testing.T) {
+ ctx := testRust(t, `
+ rust_library {
+ name: "librs",
+ srcs: ["bar.rs"],
+ crate_name: "rs",
+ extra_exported_symbols: "librs.map.txt",
+ }
+ rust_ffi {
+ name: "libffi",
+ srcs: ["foo.rs"],
+ crate_name: "ffi",
+ version_script: "libffi.map.txt",
+ }
+ `)
+
+ //linkFlags
+ librs := ctx.ModuleForTests("librs", "android_arm64_armv8-a_dylib").Rule("rustc")
+ libffi := ctx.ModuleForTests("libffi", "android_arm64_armv8-a_shared").Rule("rustc")
+
+ if !strings.Contains(librs.Args["linkFlags"], "-Wl,--version-script=librs.map.txt") {
+ t.Errorf("missing expected -Wl,--version-script= linker flag for libextended shared lib, linkFlags: %#v",
+ librs.Args["linkFlags"])
+ }
+ if strings.Contains(librs.Args["linkFlags"], "-Wl,--android-version-script=librs.map.txt") {
+ t.Errorf("unexpected -Wl,--android-version-script= linker flag for libextended shared lib, linkFlags: %#v",
+ librs.Args["linkFlags"])
+ }
+
+ if !strings.Contains(libffi.Args["linkFlags"], "-Wl,--android-version-script=libffi.map.txt") {
+ t.Errorf("missing -Wl,--android-version-script= linker flag for libreplaced shared lib, linkFlags: %#v",
+ libffi.Args["linkFlags"])
+ }
+ if strings.Contains(libffi.Args["linkFlags"], "-Wl,--version-script=libffi.map.txt") {
+ t.Errorf("unexpected -Wl,--version-script= linker flag for libextended shared lib, linkFlags: %#v",
+ libffi.Args["linkFlags"])
+ }
+}
+
+func TestRustVersionScriptPropertyErrors(t *testing.T) {
+ testRustError(t, "version_script: can only be set for rust_ffi modules", `
+ rust_library {
+ name: "librs",
+ srcs: ["bar.rs"],
+ crate_name: "rs",
+ version_script: "libbar.map.txt",
+ }`)
+ testRustError(t, "version_script and extra_exported_symbols", `
+ rust_ffi {
+ name: "librs",
+ srcs: ["bar.rs"],
+ crate_name: "rs",
+ version_script: "libbar.map.txt",
+ extra_exported_symbols: "libbar.map.txt",
+ }`)
+}
diff --git a/rust/proc_macro.go b/rust/proc_macro.go
index 1ff6637..28ed68b 100644
--- a/rust/proc_macro.go
+++ b/rust/proc_macro.go
@@ -67,6 +67,7 @@
func (procMacro *procMacroDecorator) compilerFlags(ctx ModuleContext, flags Flags) Flags {
flags = procMacro.baseCompiler.compilerFlags(ctx, flags)
flags.RustFlags = append(flags.RustFlags, "--extern proc_macro")
+ flags.RustFlags = append(flags.RustFlags, "-C metadata="+ctx.ModuleName())
return flags
}
diff --git a/rust/rust.go b/rust/rust.go
index cd4bd43..0c48154 100644
--- a/rust/rust.go
+++ b/rust/rust.go
@@ -427,6 +427,7 @@
StaticLibs android.Paths
ProcMacros RustLibraries
AfdoProfiles android.Paths
+ LinkerDeps android.Paths
// depFlags and depLinkFlags are rustc and linker (clang) flags.
depFlags []string
@@ -1692,7 +1693,7 @@
}
for _, lib := range deps.SharedLibs {
- depTag := cc.SharedDepTag(mod.Static())
+ depTag := cc.SharedDepTag()
name, version := cc.StubsLibNameAndVersion(lib)
variations := []blueprint.Variation{
@@ -1838,6 +1839,13 @@
return false
}
+ if mod.Static() && cc.IsSharedDepTag(depTag) {
+ // shared_lib dependency from a static lib is considered as crossing
+ // the APEX boundary because the dependency doesn't actually is
+ // linked; the dependency is used only during the compilation phase.
+ return false
+ }
+
return true
}
diff --git a/rust/sanitize.go b/rust/sanitize.go
index 4c82de5..b8f922f 100644
--- a/rust/sanitize.go
+++ b/rust/sanitize.go
@@ -281,7 +281,7 @@
} else {
variations = append(variations,
blueprint.Variation{Mutator: "link", Variation: "shared"})
- depTag = cc.SharedDepTag(mod.Static())
+ depTag = cc.SharedDepTag()
deps = []string{config.LibclangRuntimeLibrary(mod.toolchain(mctx), "asan")}
}
} else if mod.IsSanitizerEnabled(cc.Hwasan) {
@@ -296,7 +296,7 @@
// library during final link if necessary
variations = append(variations,
blueprint.Variation{Mutator: "link", Variation: "shared"})
- depTag = cc.SharedDepTag(mod.Static())
+ depTag = cc.SharedDepTag()
deps = []string{config.LibclangRuntimeLibrary(mod.toolchain(mctx), "hwasan")}
}
diff --git a/scripts/Android.bp b/scripts/Android.bp
index 00b3ca5..d39c84a 100644
--- a/scripts/Android.bp
+++ b/scripts/Android.bp
@@ -319,3 +319,11 @@
main: "extra_install_zips_file_list.py",
srcs: ["extra_install_zips_file_list.py"],
}
+
+python_binary_host {
+ name: "rustc_linker",
+ main: "rustc_linker.py",
+ srcs: [
+ "rustc_linker.py",
+ ],
+}
diff --git a/scripts/gen_build_prop.py b/scripts/gen_build_prop.py
index 47bbf59..430e613 100644
--- a/scripts/gen_build_prop.py
+++ b/scripts/gen_build_prop.py
@@ -108,7 +108,7 @@
def generate_common_build_props(args):
print("####################################")
- print("# from generate_common_build_props")
+ print("# from generate-common-build-props")
print("# These properties identify this partition image.")
print("####################################")
@@ -243,9 +243,15 @@
print(f"# end build properties")
def write_properties_from_file(file):
+ # Make and Soong use different intermediate files to build vendor/build.prop.
+ # Although the sysprop contents are same, the absolute paths of these
+ # intermediate files are different.
+ # Print the filename for the intermediate files (files in OUT_DIR).
+ # This helps with validating mk->soong migration of android partitions.
+ filename = os.path.basename(file.name) if file.name.startswith(os.environ.get("OUT_DIR")) else file.name
print()
print("####################################")
- print(f"# from {file.name}")
+ print(f"# from {filename}")
print("####################################")
print(file.read(), end="")
diff --git a/scripts/rustc_linker.py b/scripts/rustc_linker.py
new file mode 100755
index 0000000..3f60708
--- /dev/null
+++ b/scripts/rustc_linker.py
@@ -0,0 +1,57 @@
+#!/usr/bin/env python3
+#
+# Copyright (C) 2024 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""
+This script is used as a replacement for the Rust linker to allow fine-grained
+control over the what gets emitted to the linker.
+"""
+
+import os
+import shutil
+import subprocess
+import sys
+import argparse
+
+replacementVersionScript = None
+
+argparser = argparse.ArgumentParser()
+argparser.add_argument('--android-clang-bin', required=True)
+args = argparser.parse_known_args()
+clang_args = [args[0].android_clang_bin] + args[1]
+
+for i, arg in enumerate(clang_args):
+ if arg.startswith('-Wl,--android-version-script='):
+ replacementVersionScript = arg.split("=")[1]
+ del clang_args[i]
+ break
+
+if replacementVersionScript:
+ versionScriptFound = False
+ for i, arg in enumerate(clang_args):
+ if arg.startswith('-Wl,--version-script='):
+ clang_args[i] ='-Wl,--version-script=' + replacementVersionScript
+ versionScriptFound = True
+ break
+
+ if not versionScriptFound:
+ # If rustc did not emit a version script, just append the arg
+ clang_args.append('-Wl,--version-script=' + replacementVersionScript)
+try:
+ subprocess.run(clang_args, encoding='utf-8', check=True)
+except subprocess.CalledProcessError as e:
+ sys.exit(-1)
+
diff --git a/sysprop/sysprop_library.go b/sysprop/sysprop_library.go
index 84f20c5..77d5853 100644
--- a/sysprop/sysprop_library.go
+++ b/sysprop/sysprop_library.go
@@ -680,7 +680,7 @@
Sysprop_srcs: m.properties.Srcs,
Scope: scope,
Check_api: proptools.StringPtr(ctx.ModuleName()),
- Installable: proptools.BoolPtr(false),
+ Installable: m.properties.Installable,
Crate_name: m.rustCrateName(),
Rustlibs: []string{
"liblog_rust",
diff --git a/ui/execution_metrics/execution_metrics.go b/ui/execution_metrics/execution_metrics.go
index 4ea251f..db78449 100644
--- a/ui/execution_metrics/execution_metrics.go
+++ b/ui/execution_metrics/execution_metrics.go
@@ -204,8 +204,7 @@
if c.MetricsAggregationDir == "" {
return nil
}
- msg := c.GetMetrics()
- msg.CommandArgs = args
+ msg := c.GetMetrics(args)
if _, err := os.Stat(filepath.Dir(path)); err != nil {
if err = os.MkdirAll(filepath.Dir(path), 0775); err != nil {
@@ -219,7 +218,14 @@
return os.WriteFile(path, data, 0644)
}
-func (c *ExecutionMetrics) GetMetrics() *soong_metrics_proto.AggregatedFileList {
+func (c *ExecutionMetrics) GetMetrics(args []string) *soong_metrics_proto.ExecutionMetrics {
+ return &soong_metrics_proto.ExecutionMetrics{
+ CommandArgs: args,
+ ChangedFiles: c.getChangedFiles(),
+ }
+}
+
+func (c *ExecutionMetrics) getChangedFiles() *soong_metrics_proto.AggregatedFileList {
fl := c.fileList
if fl == nil {
return nil
diff --git a/ui/metrics/metrics_proto/metrics.pb.go b/ui/metrics/metrics_proto/metrics.pb.go
index 0aa51b1..8cbc568 100644
--- a/ui/metrics/metrics_proto/metrics.pb.go
+++ b/ui/metrics/metrics_proto/metrics.pb.go
@@ -2080,6 +2080,64 @@
return nil
}
+// This is created by soong_ui from SoongExexcutionMetrics files.
+type ExecutionMetrics struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The arguments provided on the command line.
+ CommandArgs []string `protobuf:"bytes,1,rep,name=command_args,json=commandArgs" json:"command_args,omitempty"`
+ // Changed files detected by the build.
+ ChangedFiles *AggregatedFileList `protobuf:"bytes,2,opt,name=changed_files,json=changedFiles" json:"changed_files,omitempty"`
+}
+
+func (x *ExecutionMetrics) Reset() {
+ *x = ExecutionMetrics{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_metrics_proto_msgTypes[19]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ExecutionMetrics) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ExecutionMetrics) ProtoMessage() {}
+
+func (x *ExecutionMetrics) ProtoReflect() protoreflect.Message {
+ mi := &file_metrics_proto_msgTypes[19]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ExecutionMetrics.ProtoReflect.Descriptor instead.
+func (*ExecutionMetrics) Descriptor() ([]byte, []int) {
+ return file_metrics_proto_rawDescGZIP(), []int{19}
+}
+
+func (x *ExecutionMetrics) GetCommandArgs() []string {
+ if x != nil {
+ return x.CommandArgs
+ }
+ return nil
+}
+
+func (x *ExecutionMetrics) GetChangedFiles() *AggregatedFileList {
+ if x != nil {
+ return x.ChangedFiles
+ }
+ return nil
+}
+
// This is created by soong_ui from the various
// android.find_input_delta_proto.FileList metrics provided to it by
// find_input_delta.
@@ -2088,8 +2146,6 @@
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- // The arguments provided on the command line.
- CommandArgs []string `protobuf:"bytes,1,rep,name=command_args,json=commandArgs" json:"command_args,omitempty"`
// The (possibly truncated list of) added files.
Additions []string `protobuf:"bytes,2,rep,name=additions" json:"additions,omitempty"`
// The (possibly truncated list of) changed files.
@@ -2105,7 +2161,7 @@
func (x *AggregatedFileList) Reset() {
*x = AggregatedFileList{}
if protoimpl.UnsafeEnabled {
- mi := &file_metrics_proto_msgTypes[19]
+ mi := &file_metrics_proto_msgTypes[20]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2118,7 +2174,7 @@
func (*AggregatedFileList) ProtoMessage() {}
func (x *AggregatedFileList) ProtoReflect() protoreflect.Message {
- mi := &file_metrics_proto_msgTypes[19]
+ mi := &file_metrics_proto_msgTypes[20]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2131,14 +2187,7 @@
// Deprecated: Use AggregatedFileList.ProtoReflect.Descriptor instead.
func (*AggregatedFileList) Descriptor() ([]byte, []int) {
- return file_metrics_proto_rawDescGZIP(), []int{19}
-}
-
-func (x *AggregatedFileList) GetCommandArgs() []string {
- if x != nil {
- return x.CommandArgs
- }
- return nil
+ return file_metrics_proto_rawDescGZIP(), []int{20}
}
func (x *AggregatedFileList) GetAdditions() []string {
@@ -2194,7 +2243,7 @@
func (x *FileCount) Reset() {
*x = FileCount{}
if protoimpl.UnsafeEnabled {
- mi := &file_metrics_proto_msgTypes[20]
+ mi := &file_metrics_proto_msgTypes[21]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2207,7 +2256,7 @@
func (*FileCount) ProtoMessage() {}
func (x *FileCount) ProtoReflect() protoreflect.Message {
- mi := &file_metrics_proto_msgTypes[20]
+ mi := &file_metrics_proto_msgTypes[21]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2220,7 +2269,7 @@
// Deprecated: Use FileCount.ProtoReflect.Descriptor instead.
func (*FileCount) Descriptor() ([]byte, []int) {
- return file_metrics_proto_rawDescGZIP(), []int{20}
+ return file_metrics_proto_rawDescGZIP(), []int{21}
}
func (x *FileCount) GetExtension() string {
@@ -2272,7 +2321,7 @@
func (x *OptimizedBuildMetrics_TargetOptimizationResult) Reset() {
*x = OptimizedBuildMetrics_TargetOptimizationResult{}
if protoimpl.UnsafeEnabled {
- mi := &file_metrics_proto_msgTypes[21]
+ mi := &file_metrics_proto_msgTypes[22]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2285,7 +2334,7 @@
func (*OptimizedBuildMetrics_TargetOptimizationResult) ProtoMessage() {}
func (x *OptimizedBuildMetrics_TargetOptimizationResult) ProtoReflect() protoreflect.Message {
- mi := &file_metrics_proto_msgTypes[21]
+ mi := &file_metrics_proto_msgTypes[22]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2352,7 +2401,7 @@
func (x *OptimizedBuildMetrics_TargetOptimizationResult_OutputArtifact) Reset() {
*x = OptimizedBuildMetrics_TargetOptimizationResult_OutputArtifact{}
if protoimpl.UnsafeEnabled {
- mi := &file_metrics_proto_msgTypes[22]
+ mi := &file_metrics_proto_msgTypes[23]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2365,7 +2414,7 @@
func (*OptimizedBuildMetrics_TargetOptimizationResult_OutputArtifact) ProtoMessage() {}
func (x *OptimizedBuildMetrics_TargetOptimizationResult_OutputArtifact) ProtoReflect() protoreflect.Message {
- mi := &file_metrics_proto_msgTypes[22]
+ mi := &file_metrics_proto_msgTypes[23]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2808,33 +2857,40 @@
0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69,
0x7a, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x5f, 0x6d,
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x69, 0x6e,
- 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x22, 0xe6, 0x01,
- 0x0a, 0x12, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65,
- 0x4c, 0x69, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f,
- 0x61, 0x72, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x6d,
- 0x61, 0x6e, 0x64, 0x41, 0x72, 0x67, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x69, 0x74,
- 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x64, 0x64, 0x69,
- 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73,
- 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12,
- 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03,
- 0x28, 0x09, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a,
- 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01,
- 0x28, 0x0d, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x12, 0x36,
- 0x0a, 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e,
- 0x2e, 0x73, 0x6f, 0x6f, 0x6e, 0x67, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x6d, 0x65, 0x74,
- 0x72, 0x69, 0x63, 0x73, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x06,
- 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0x8b, 0x01, 0x0a, 0x09, 0x46, 0x69, 0x6c, 0x65, 0x43,
- 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
- 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
- 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18,
- 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73,
- 0x12, 0x24, 0x0a, 0x0d, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
- 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x63,
- 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x69,
- 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x74,
- 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x28, 0x5a, 0x26, 0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x2f,
- 0x73, 0x6f, 0x6f, 0x6e, 0x67, 0x2f, 0x75, 0x69, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73,
- 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x22, 0x83, 0x01,
+ 0x0a, 0x10, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x72, 0x69,
+ 0x63, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x61, 0x72,
+ 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e,
+ 0x64, 0x41, 0x72, 0x67, 0x73, 0x12, 0x4c, 0x0a, 0x0d, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64,
+ 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x73,
+ 0x6f, 0x6f, 0x6e, 0x67, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69,
+ 0x63, 0x73, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x6c,
+ 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x0c, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x46, 0x69,
+ 0x6c, 0x65, 0x73, 0x22, 0xc9, 0x01, 0x0a, 0x12, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74,
+ 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64,
+ 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61,
+ 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e,
+ 0x67, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67,
+ 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18,
+ 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73,
+ 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x18,
+ 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x65, 0x6c, 0x74,
+ 0x61, 0x12, 0x36, 0x0a, 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28,
+ 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x6f, 0x6f, 0x6e, 0x67, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f,
+ 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x75, 0x6e,
+ 0x74, 0x52, 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x22,
+ 0x8b, 0x01, 0x0a, 0x09, 0x46, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a,
+ 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x61,
+ 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09,
+ 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x6d, 0x6f, 0x64,
+ 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d,
+ 0x52, 0x0d, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12,
+ 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01,
+ 0x28, 0x0d, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x28, 0x5a,
+ 0x26, 0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x2f, 0x73, 0x6f, 0x6f, 0x6e, 0x67, 0x2f, 0x75,
+ 0x69, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63,
+ 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
}
var (
@@ -2850,7 +2906,7 @@
}
var file_metrics_proto_enumTypes = make([]protoimpl.EnumInfo, 5)
-var file_metrics_proto_msgTypes = make([]protoimpl.MessageInfo, 23)
+var file_metrics_proto_msgTypes = make([]protoimpl.MessageInfo, 24)
var file_metrics_proto_goTypes = []interface{}{
(MetricsBase_BuildVariant)(0), // 0: soong_build_metrics.MetricsBase.BuildVariant
(MetricsBase_Arch)(0), // 1: soong_build_metrics.MetricsBase.Arch
@@ -2876,10 +2932,11 @@
(*CriticalPathInfo)(nil), // 21: soong_build_metrics.CriticalPathInfo
(*JobInfo)(nil), // 22: soong_build_metrics.JobInfo
(*OptimizedBuildMetrics)(nil), // 23: soong_build_metrics.OptimizedBuildMetrics
- (*AggregatedFileList)(nil), // 24: soong_build_metrics.AggregatedFileList
- (*FileCount)(nil), // 25: soong_build_metrics.FileCount
- (*OptimizedBuildMetrics_TargetOptimizationResult)(nil), // 26: soong_build_metrics.OptimizedBuildMetrics.TargetOptimizationResult
- (*OptimizedBuildMetrics_TargetOptimizationResult_OutputArtifact)(nil), // 27: soong_build_metrics.OptimizedBuildMetrics.TargetOptimizationResult.OutputArtifact
+ (*ExecutionMetrics)(nil), // 24: soong_build_metrics.ExecutionMetrics
+ (*AggregatedFileList)(nil), // 25: soong_build_metrics.AggregatedFileList
+ (*FileCount)(nil), // 26: soong_build_metrics.FileCount
+ (*OptimizedBuildMetrics_TargetOptimizationResult)(nil), // 27: soong_build_metrics.OptimizedBuildMetrics.TargetOptimizationResult
+ (*OptimizedBuildMetrics_TargetOptimizationResult_OutputArtifact)(nil), // 28: soong_build_metrics.OptimizedBuildMetrics.TargetOptimizationResult.OutputArtifact
}
var file_metrics_proto_depIdxs = []int32{
0, // 0: soong_build_metrics.MetricsBase.target_build_variant:type_name -> soong_build_metrics.MetricsBase.BuildVariant
@@ -2915,15 +2972,16 @@
22, // 30: soong_build_metrics.CriticalPathInfo.long_running_jobs:type_name -> soong_build_metrics.JobInfo
10, // 31: soong_build_metrics.OptimizedBuildMetrics.analysis_perf:type_name -> soong_build_metrics.PerfInfo
10, // 32: soong_build_metrics.OptimizedBuildMetrics.packaging_perf:type_name -> soong_build_metrics.PerfInfo
- 26, // 33: soong_build_metrics.OptimizedBuildMetrics.target_result:type_name -> soong_build_metrics.OptimizedBuildMetrics.TargetOptimizationResult
- 25, // 34: soong_build_metrics.AggregatedFileList.counts:type_name -> soong_build_metrics.FileCount
- 10, // 35: soong_build_metrics.OptimizedBuildMetrics.TargetOptimizationResult.packaging_perf:type_name -> soong_build_metrics.PerfInfo
- 27, // 36: soong_build_metrics.OptimizedBuildMetrics.TargetOptimizationResult.output_artifact:type_name -> soong_build_metrics.OptimizedBuildMetrics.TargetOptimizationResult.OutputArtifact
- 37, // [37:37] is the sub-list for method output_type
- 37, // [37:37] is the sub-list for method input_type
- 37, // [37:37] is the sub-list for extension type_name
- 37, // [37:37] is the sub-list for extension extendee
- 0, // [0:37] is the sub-list for field type_name
+ 27, // 33: soong_build_metrics.OptimizedBuildMetrics.target_result:type_name -> soong_build_metrics.OptimizedBuildMetrics.TargetOptimizationResult
+ 25, // 34: soong_build_metrics.ExecutionMetrics.changed_files:type_name -> soong_build_metrics.AggregatedFileList
+ 26, // 35: soong_build_metrics.AggregatedFileList.counts:type_name -> soong_build_metrics.FileCount
+ 10, // 36: soong_build_metrics.OptimizedBuildMetrics.TargetOptimizationResult.packaging_perf:type_name -> soong_build_metrics.PerfInfo
+ 28, // 37: soong_build_metrics.OptimizedBuildMetrics.TargetOptimizationResult.output_artifact:type_name -> soong_build_metrics.OptimizedBuildMetrics.TargetOptimizationResult.OutputArtifact
+ 38, // [38:38] is the sub-list for method output_type
+ 38, // [38:38] is the sub-list for method input_type
+ 38, // [38:38] is the sub-list for extension type_name
+ 38, // [38:38] is the sub-list for extension extendee
+ 0, // [0:38] is the sub-list for field type_name
}
func init() { file_metrics_proto_init() }
@@ -3161,7 +3219,7 @@
}
}
file_metrics_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*AggregatedFileList); i {
+ switch v := v.(*ExecutionMetrics); i {
case 0:
return &v.state
case 1:
@@ -3173,7 +3231,7 @@
}
}
file_metrics_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*FileCount); i {
+ switch v := v.(*AggregatedFileList); i {
case 0:
return &v.state
case 1:
@@ -3185,7 +3243,7 @@
}
}
file_metrics_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*OptimizedBuildMetrics_TargetOptimizationResult); i {
+ switch v := v.(*FileCount); i {
case 0:
return &v.state
case 1:
@@ -3197,6 +3255,18 @@
}
}
file_metrics_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*OptimizedBuildMetrics_TargetOptimizationResult); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_metrics_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*OptimizedBuildMetrics_TargetOptimizationResult_OutputArtifact); i {
case 0:
return &v.state
@@ -3215,7 +3285,7 @@
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_metrics_proto_rawDesc,
NumEnums: 5,
- NumMessages: 23,
+ NumMessages: 24,
NumExtensions: 0,
NumServices: 0,
},
diff --git a/ui/metrics/metrics_proto/metrics.proto b/ui/metrics/metrics_proto/metrics.proto
index 8437b65..69067ab 100644
--- a/ui/metrics/metrics_proto/metrics.proto
+++ b/ui/metrics/metrics_proto/metrics.proto
@@ -452,13 +452,19 @@
}
}
+// This is created by soong_ui from SoongExexcutionMetrics files.
+message ExecutionMetrics {
+ // The arguments provided on the command line.
+ repeated string command_args = 1;
+
+ // Changed files detected by the build.
+ optional AggregatedFileList changed_files = 2;
+}
+
// This is created by soong_ui from the various
// android.find_input_delta_proto.FileList metrics provided to it by
// find_input_delta.
message AggregatedFileList {
- // The arguments provided on the command line.
- repeated string command_args = 1;
-
// The (possibly truncated list of) added files.
repeated string additions = 2;
@@ -473,6 +479,8 @@
// Counts by extension.
repeated FileCount counts = 6;
+
+ reserved 1;
}
message FileCount {