From 18e6719e9f0be6df65f638ff8ca7a3525b945e8e Mon Sep 17 00:00:00 2001 From: Mitch Phillips Date: Mon, 24 Feb 2020 08:26:20 -0800 Subject: [PATCH] [cc_fuzz] Don't build infra-disable targets in `m haiku`. `make haiku` shouldn't build fuzz targets that are disabled on the continuous fuzzing infra. This should reduce pressure on the repackager. Bug: N/A Test: make haiku && verify that example_fuzzer isn't there. Change-Id: I6a687a3ab8cbb1eb75113e96aba2c4f9f8058010 --- cc/fuzz.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cc/fuzz.go b/cc/fuzz.go index ee24300c4..6a9b7096a 100644 --- a/cc/fuzz.go +++ b/cc/fuzz.go @@ -367,8 +367,6 @@ func (s *fuzzPackager) GenerateBuildActions(ctx android.SingletonContext) { return } - s.fuzzTargets[module.Name()] = true - hostOrTargetString := "target" if ccModule.Host() { hostOrTargetString = "host" @@ -458,6 +456,17 @@ func (s *fuzzPackager) GenerateBuildActions(ctx android.SingletonContext) { builder.Build(pctx, ctx, "create-"+fuzzZip.String(), "Package "+module.Name()+" for "+archString+"-"+hostOrTargetString) + // Don't add modules to 'make haiku' that are set to not be exported to the + // fuzzing infrastructure. + if config := fuzzModule.Properties.Fuzz_config; config != nil { + if ccModule.Host() && !BoolDefault(config.Fuzz_on_haiku_host, true) { + return + } else if !BoolDefault(config.Fuzz_on_haiku_device, true) { + return + } + } + + s.fuzzTargets[module.Name()] = true archDirs[archOs] = append(archDirs[archOs], fileToZip{fuzzZip, ""}) })