Merge "apex: run host_apex_verifier" into main am: 19b81d777d am: 2b33af39c0

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2972873

Change-Id: Ieac7904745e4bfcb8be646fce2a444cec7839ebf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2024-09-04 17:23:18 +00:00
committed by Automerger Merge Worker

View File

@@ -83,6 +83,7 @@ func init() {
pctx.HostBinToolVariable("assemble_vintf", "assemble_vintf") pctx.HostBinToolVariable("assemble_vintf", "assemble_vintf")
pctx.HostBinToolVariable("apex_elf_checker", "apex_elf_checker") pctx.HostBinToolVariable("apex_elf_checker", "apex_elf_checker")
pctx.HostBinToolVariable("aconfig", "aconfig") pctx.HostBinToolVariable("aconfig", "aconfig")
pctx.HostBinToolVariable("host_apex_verifier", "host_apex_verifier")
} }
type createStorageStruct struct { type createStorageStruct struct {
@@ -249,6 +250,13 @@ var (
Description: "run apex_linkerconfig_validation", Description: "run apex_linkerconfig_validation",
}, "image_dir") }, "image_dir")
apexHostVerifierRule = pctx.StaticRule("apexHostVerifierRule", blueprint.RuleParams{
Command: `${host_apex_verifier} --deapexer=${deapexer} --debugfs=${debugfs_static} ` +
`--fsckerofs=${fsck_erofs} --apex=${in} && touch ${out}`,
CommandDeps: []string{"${host_apex_verifier}", "${deapexer}", "${debugfs_static}", "${fsck_erofs}"},
Description: "run host_apex_verifier",
})
assembleVintfRule = pctx.StaticRule("assembleVintfRule", blueprint.RuleParams{ assembleVintfRule = pctx.StaticRule("assembleVintfRule", blueprint.RuleParams{
Command: `rm -f $out && VINTF_IGNORE_TARGET_FCM_VERSION=true ${assemble_vintf} -i $in -o $out`, Command: `rm -f $out && VINTF_IGNORE_TARGET_FCM_VERSION=true ${assemble_vintf} -i $in -o $out`,
CommandDeps: []string{"${assemble_vintf}"}, CommandDeps: []string{"${assemble_vintf}"},
@@ -954,6 +962,9 @@ func (a *apexBundle) buildApex(ctx android.ModuleContext) {
validations = append(validations, validations = append(validations,
runApexElfCheckerUnwanted(ctx, unsignedOutputFile.OutputPath, a.properties.Unwanted_transitive_deps)) runApexElfCheckerUnwanted(ctx, unsignedOutputFile.OutputPath, a.properties.Unwanted_transitive_deps))
} }
if !a.testApex && android.InList(a.payloadFsType, []fsType{ext4, erofs}) {
validations = append(validations, runApexHostVerifier(ctx, unsignedOutputFile.OutputPath))
}
ctx.Build(pctx, android.BuildParams{ ctx.Build(pctx, android.BuildParams{
Rule: rule, Rule: rule,
Description: "signapk", Description: "signapk",
@@ -1248,3 +1259,13 @@ func runApexElfCheckerUnwanted(ctx android.ModuleContext, apexFile android.Outpu
}) })
return timestamp return timestamp
} }
func runApexHostVerifier(ctx android.ModuleContext, apexFile android.OutputPath) android.Path {
timestamp := android.PathForModuleOut(ctx, "host_apex_verifier.timestamp")
ctx.Build(pctx, android.BuildParams{
Rule: apexHostVerifierRule,
Input: apexFile,
Output: timestamp,
})
return timestamp
}