Merge "Added haiku presubmit packaging" into main
This commit is contained in:
32
cc/fuzz.go
32
cc/fuzz.go
@@ -29,6 +29,7 @@ import (
|
|||||||
func init() {
|
func init() {
|
||||||
android.RegisterModuleType("cc_fuzz", LibFuzzFactory)
|
android.RegisterModuleType("cc_fuzz", LibFuzzFactory)
|
||||||
android.RegisterParallelSingletonType("cc_fuzz_packaging", fuzzPackagingFactory)
|
android.RegisterParallelSingletonType("cc_fuzz_packaging", fuzzPackagingFactory)
|
||||||
|
android.RegisterParallelSingletonType("cc_fuzz_presubmit_packaging", fuzzPackagingFactoryPresubmit)
|
||||||
}
|
}
|
||||||
|
|
||||||
type FuzzProperties struct {
|
type FuzzProperties struct {
|
||||||
@@ -356,9 +357,10 @@ func NewFuzzer(hod android.HostOrDeviceSupported) *Module {
|
|||||||
// their architecture & target/host specific zip file.
|
// their architecture & target/host specific zip file.
|
||||||
type ccRustFuzzPackager struct {
|
type ccRustFuzzPackager struct {
|
||||||
fuzz.FuzzPackager
|
fuzz.FuzzPackager
|
||||||
fuzzPackagingArchModules string
|
fuzzPackagingArchModules string
|
||||||
fuzzTargetSharedDepsInstallPairs string
|
fuzzTargetSharedDepsInstallPairs string
|
||||||
allFuzzTargetsName string
|
allFuzzTargetsName string
|
||||||
|
onlyIncludePresubmits bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func fuzzPackagingFactory() android.Singleton {
|
func fuzzPackagingFactory() android.Singleton {
|
||||||
@@ -367,6 +369,18 @@ func fuzzPackagingFactory() android.Singleton {
|
|||||||
fuzzPackagingArchModules: "SOONG_FUZZ_PACKAGING_ARCH_MODULES",
|
fuzzPackagingArchModules: "SOONG_FUZZ_PACKAGING_ARCH_MODULES",
|
||||||
fuzzTargetSharedDepsInstallPairs: "FUZZ_TARGET_SHARED_DEPS_INSTALL_PAIRS",
|
fuzzTargetSharedDepsInstallPairs: "FUZZ_TARGET_SHARED_DEPS_INSTALL_PAIRS",
|
||||||
allFuzzTargetsName: "ALL_FUZZ_TARGETS",
|
allFuzzTargetsName: "ALL_FUZZ_TARGETS",
|
||||||
|
onlyIncludePresubmits: false,
|
||||||
|
}
|
||||||
|
return fuzzPackager
|
||||||
|
}
|
||||||
|
|
||||||
|
func fuzzPackagingFactoryPresubmit() android.Singleton {
|
||||||
|
|
||||||
|
fuzzPackager := &ccRustFuzzPackager{
|
||||||
|
fuzzPackagingArchModules: "SOONG_PRESUBMIT_FUZZ_PACKAGING_ARCH_MODULES",
|
||||||
|
fuzzTargetSharedDepsInstallPairs: "PRESUBMIT_FUZZ_TARGET_SHARED_DEPS_INSTALL_PAIRS",
|
||||||
|
allFuzzTargetsName: "ALL_PRESUBMIT_FUZZ_TARGETS",
|
||||||
|
onlyIncludePresubmits: true,
|
||||||
}
|
}
|
||||||
return fuzzPackager
|
return fuzzPackager
|
||||||
}
|
}
|
||||||
@@ -390,7 +404,6 @@ func (s *ccRustFuzzPackager) GenerateBuildActions(ctx android.SingletonContext)
|
|||||||
if !ok || ccModule.PreventInstall() {
|
if !ok || ccModule.PreventInstall() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Discard non-fuzz targets.
|
// Discard non-fuzz targets.
|
||||||
if ok := fuzz.IsValid(ccModule.FuzzModuleStruct()); !ok {
|
if ok := fuzz.IsValid(ccModule.FuzzModuleStruct()); !ok {
|
||||||
return
|
return
|
||||||
@@ -407,6 +420,9 @@ func (s *ccRustFuzzPackager) GenerateBuildActions(ctx android.SingletonContext)
|
|||||||
} else if ccModule.Host() {
|
} else if ccModule.Host() {
|
||||||
hostOrTargetString = "host"
|
hostOrTargetString = "host"
|
||||||
}
|
}
|
||||||
|
if s.onlyIncludePresubmits == true {
|
||||||
|
hostOrTargetString = "presubmit-" + hostOrTargetString
|
||||||
|
}
|
||||||
|
|
||||||
fpm := fuzz.FuzzPackagedModule{}
|
fpm := fuzz.FuzzPackagedModule{}
|
||||||
if ok {
|
if ok {
|
||||||
@@ -431,6 +447,14 @@ func (s *ccRustFuzzPackager) GenerateBuildActions(ctx android.SingletonContext)
|
|||||||
// The executable.
|
// The executable.
|
||||||
files = append(files, fuzz.FileToZip{SourceFilePath: android.OutputFileForModule(ctx, ccModule, "unstripped")})
|
files = append(files, fuzz.FileToZip{SourceFilePath: android.OutputFileForModule(ctx, ccModule, "unstripped")})
|
||||||
|
|
||||||
|
if s.onlyIncludePresubmits == true {
|
||||||
|
if fpm.FuzzProperties.Fuzz_config == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !BoolDefault(fpm.FuzzProperties.Fuzz_config.Use_for_presubmit, false){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
archDirs[archOs], ok = s.BuildZipFile(ctx, module, fpm, files, builder, archDir, archString, hostOrTargetString, archOs, archDirs)
|
archDirs[archOs], ok = s.BuildZipFile(ctx, module, fpm, files, builder, archDir, archString, hostOrTargetString, archOs, archDirs)
|
||||||
if !ok {
|
if !ok {
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user