From dd651faac35bd8882576f377d49fd8d6fb27d00b Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Thu, 13 Jun 2019 04:48:54 +0000 Subject: [PATCH 1/3] Fix a few missing dependencies in APEX building I found these while trying to build an aosp_arm system image with RBE, which only makes the sources that you depend on available to every rule. The hardcoded prebuilts/sdk path is a bit unfortunate, but that's currently hardcoded as a default in the script as well. Bug: 130111713 Test: treehugger Test: build a system image with RBE Change-Id: I4415563017e053749788b0a537a48d61a2161935 --- apex/apex.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apex/apex.go b/apex/apex.go index 41a21c92c..f119778ac 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -61,7 +61,7 @@ var ( `--key ${key} ${opt_flags} ${image_dir} ${out} `, CommandDeps: []string{"${apexer}", "${avbtool}", "${e2fsdroid}", "${merge_zips}", "${mke2fs}", "${resize2fs}", "${sefcontext_compile}", - "${soong_zip}", "${zipalign}", "${aapt2}"}, + "${soong_zip}", "${zipalign}", "${aapt2}", "prebuilts/sdk/current/public/android.jar"}, Description: "APEX ${image_dir} => ${out}", }, "tool_path", "image_dir", "copy_commands", "manifest", "file_contexts", "canned_fs_config", "key", "opt_flags") @@ -1062,6 +1062,10 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext, apexType ap Description: "signapk", Output: a.outputFiles[apexType], Input: unsignedOutputFile, + Implicits: []android.Path{ + a.container_certificate_file, + a.container_private_key_file, + }, Args: map[string]string{ "certificates": a.container_certificate_file.String() + " " + a.container_private_key_file.String(), "flags": "-a 4096", //alignment From b085b9b9073b73d8583b01132b965972b405b6fc Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Thu, 13 Jun 2019 04:55:09 +0000 Subject: [PATCH 2/3] Actually depend on the headers from renderscript Instead of having all the object compilations depend on a stamp file, instead depend on the headers, which are already available in the build graph. This allows my RBE builds to just find the headers, instead of having to walk the graph to find the other outputs. Test: treehugger Test: build a system image with RBE Change-Id: I0a310229be26d7bd399e074a4350d5be038f8661 --- cc/rs.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cc/rs.go b/cc/rs.go index 5421b9252..fbc6bfba4 100644 --- a/cc/rs.go +++ b/cc/rs.go @@ -72,11 +72,12 @@ func rsGenerateCpp(ctx android.ModuleContext, rsFiles android.Paths, rsFlags str stampFile := android.PathForModuleGen(ctx, "rs", "rs.stamp") depFiles := make(android.WritablePaths, 0, len(rsFiles)) genFiles := make(android.WritablePaths, 0, 2*len(rsFiles)) + headers := make(android.Paths, 0, len(rsFiles)) for _, rsFile := range rsFiles { depFiles = append(depFiles, rsGeneratedDepFile(ctx, rsFile)) - genFiles = append(genFiles, - rsGeneratedCppFile(ctx, rsFile), - rsGeneratedHFile(ctx, rsFile)) + headerFile := rsGeneratedHFile(ctx, rsFile) + genFiles = append(genFiles, rsGeneratedCppFile(ctx, rsFile), headerFile) + headers = append(headers, headerFile) } ctx.Build(pctx, android.BuildParams{ @@ -92,7 +93,7 @@ func rsGenerateCpp(ctx android.ModuleContext, rsFiles android.Paths, rsFlags str }, }) - return android.Paths{stampFile} + return headers } func rsFlags(ctx ModuleContext, flags Flags, properties *BaseCompilerProperties) Flags { From 1cfbdbe1b2100b59e97e4811e130573150fc1f2a Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Thu, 13 Jun 2019 04:59:17 +0000 Subject: [PATCH 3/3] Add another jar used by kotlinc Bug: 130111713 Test: treehugger Change-Id: If25be6047625cec4ed9802142876cfd8e9ccd3eb --- java/config/kotlin.go | 1 + java/kotlin.go | 1 + 2 files changed, 2 insertions(+) diff --git a/java/config/kotlin.go b/java/config/kotlin.go index 7cea0429e..fd8e3dbe9 100644 --- a/java/config/kotlin.go +++ b/java/config/kotlin.go @@ -32,6 +32,7 @@ func init() { pctx.SourcePathVariable("KotlinScriptRuntimeJar", "external/kotlinc/lib/kotlin-script-runtime.jar") pctx.SourcePathVariable("KotlinTrove4jJar", "external/kotlinc/lib/trove4j.jar") pctx.SourcePathVariable("KotlinKaptJar", "external/kotlinc/lib/kotlin-annotation-processing.jar") + pctx.SourcePathVariable("KotlinAnnotationJar", "external/kotlinc/lib/annotations-13.0.jar") pctx.SourcePathVariable("KotlinStdlibJar", KotlinStdlibJar) // These flags silence "Illegal reflective access" warnings when running kotlinc in OpenJDK9 diff --git a/java/kotlin.go b/java/kotlin.go index 33167bafd..83069072c 100644 --- a/java/kotlin.go +++ b/java/kotlin.go @@ -44,6 +44,7 @@ var kotlinc = pctx.AndroidGomaStaticRule("kotlinc", "${config.KotlinScriptRuntimeJar}", "${config.KotlinStdlibJar}", "${config.KotlinTrove4jJar}", + "${config.KotlinAnnotationJar}", "${config.GenKotlinBuildFileCmd}", "${config.SoongZipCmd}", "${config.ZipSyncCmd}",