From 8439a141a7788173443582aa1b1b2232dedec2d7 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Tue, 15 Feb 2022 15:32:57 -0800 Subject: [PATCH] Compare tidy_disabled_srcs list by string values * Cannot use android.Path as key because some srcs and and tidy_disabled_srcs items could have the same path string but different android.Paths objects. Bug: 219783146 Test: make tidy-soong_subset Change-Id: I82e25ec9678ce998feccf361d69ae66dae0905de --- cc/builder.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cc/builder.go b/cc/builder.go index ee3ea2dd1..8e6f7cd52 100644 --- a/cc/builder.go +++ b/cc/builder.go @@ -464,12 +464,12 @@ func transformSourceToObj(ctx ModuleContext, subdir string, srcFiles, noTidySrcs // Source files are one-to-one with tidy, coverage, or kythe files, if enabled. objFiles := make(android.Paths, len(srcFiles)) var tidyFiles android.Paths - noTidySrcsMap := make(map[android.Path]bool) + noTidySrcsMap := make(map[string]bool) var tidyVars string if flags.tidy { tidyFiles = make(android.Paths, 0, len(srcFiles)) for _, path := range noTidySrcs { - noTidySrcsMap[path] = true + noTidySrcsMap[path.String()] = true } tidyTimeout := ctx.Config().Getenv("TIDY_TIMEOUT") if len(tidyTimeout) > 0 { @@ -675,7 +675,7 @@ func transformSourceToObj(ctx ModuleContext, subdir string, srcFiles, noTidySrcs } // Even with tidy, some src file could be skipped by noTidySrcsMap. - if tidy && !noTidySrcsMap[srcFile] { + if tidy && !noTidySrcsMap[srcFile.String()] { tidyFile := android.ObjPathWithExt(ctx, subdir, srcFile, "tidy") tidyDepFile := android.ObjPathWithExt(ctx, subdir, srcFile, "tidy.dep") tidyFiles = append(tidyFiles, tidyFile)