From 950689a9c2237afa862c523a2f6abff48c47ba61 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Wed, 21 Jun 2023 15:07:21 -0700 Subject: [PATCH] Handle RepoMappingManifest actions These are essentially FileWrite actions, like SourceSymlinkManifest. However, currently aquery appears to give non-deterministic results for the file content. Emit an empty file for now to avoid the non-determinism. Fixes: 288292933 Bug: 287539324 Test: Presubmits Change-Id: Ieaf8aff0d58d2d69087e4e34dc99074a015e700c --- android/bazel_handler.go | 6 ++++++ bazel/aquery.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/android/bazel_handler.go b/android/bazel_handler.go index d5ccfcad8..5d93f06b8 100644 --- a/android/bazel_handler.go +++ b/android/bazel_handler.go @@ -1270,6 +1270,12 @@ func (c *bazelSingleton) GenerateBuildActions(ctx SingletonContext) { // because this would cause circular dependency. So, until we move aquery processing // to the 'android' package, we need to handle special cases here. switch buildStatement.Mnemonic { + case "RepoMappingManifest": + // It appears RepoMappingManifest files currently have + // non-deterministic content. Just emit empty files for + // now because they're unused. + out := PathForBazelOut(ctx, buildStatement.OutputPaths[0]) + WriteFileRuleVerbatim(ctx, out, "") case "FileWrite", "SourceSymlinkManifest": out := PathForBazelOut(ctx, buildStatement.OutputPaths[0]) WriteFileRuleVerbatim(ctx, out, buildStatement.FileContents) diff --git a/bazel/aquery.go b/bazel/aquery.go index 95e52ae73..480158c11 100644 --- a/bazel/aquery.go +++ b/bazel/aquery.go @@ -677,7 +677,7 @@ func (a *aqueryArtifactHandler) actionToBuildStatement(actionEntry *analysis_v2_ if len(actionEntry.Arguments) < 1 { return a.templateExpandActionBuildStatement(actionEntry) } - case "FileWrite", "SourceSymlinkManifest": + case "FileWrite", "SourceSymlinkManifest", "RepoMappingManifest": return a.fileWriteActionBuildStatement(actionEntry) case "SymlinkTree": return a.symlinkTreeActionBuildStatement(actionEntry)