diff options
| -rw-r--r-- | android/image.go | 46 | ||||
| -rw-r--r-- | android/module.go | 2 | ||||
| -rw-r--r-- | android/mutator.go | 2 | ||||
| -rwxr-xr-x | bin/soongdbg | 2 | ||||
| -rw-r--r-- | bpf/bpf.go | 8 | ||||
| -rw-r--r-- | cc/config/global.go | 5 | ||||
| -rw-r--r-- | java/ravenwood.go | 8 | ||||
| -rw-r--r-- | scripts/gen_build_prop.py | 2 | ||||
| -rw-r--r-- | ui/build/config.go | 3 | ||||
| -rw-r--r-- | ui/build/rbe.go | 2 | ||||
| -rw-r--r-- | ui/build/sandbox_linux.go | 26 |
11 files changed, 72 insertions, 34 deletions
diff --git a/android/image.go b/android/image.go index 0f0310701..6e5a551df 100644 --- a/android/image.go +++ b/android/image.go @@ -14,7 +14,7 @@ package android -// ImageInterface is implemented by modules that need to be split by the imageMutator. +// ImageInterface is implemented by modules that need to be split by the imageTransitionMutator. type ImageInterface interface { // ImageMutatorBegin is called before any other method in the ImageInterface. ImageMutatorBegin(ctx BaseModuleContext) @@ -81,17 +81,15 @@ const ( DebugRamdiskVariation string = "debug_ramdisk" ) -// imageMutator creates variants for modules that implement the ImageInterface that +// imageTransitionMutator creates variants for modules that implement the ImageInterface that // allow them to build differently for each partition (recovery, core, vendor, etc.). -func imageMutator(ctx BottomUpMutatorContext) { - if ctx.Os() != Android { - return - } +type imageTransitionMutator struct{} - if m, ok := ctx.Module().(ImageInterface); ok { - m.ImageMutatorBegin(ctx) +func (imageTransitionMutator) Split(ctx BaseModuleContext) []string { + var variations []string - var variations []string + if m, ok := ctx.Module().(ImageInterface); ctx.Os() == Android && ok { + m.ImageMutatorBegin(ctx) if m.CoreVariantNeeded(ctx) { variations = append(variations, CoreVariation) @@ -117,15 +115,29 @@ func imageMutator(ctx BottomUpMutatorContext) { extraVariations := m.ExtraImageVariations(ctx) variations = append(variations, extraVariations...) + } - if len(variations) == 0 { - return - } + if len(variations) == 0 { + variations = append(variations, "") + } - mod := ctx.CreateVariations(variations...) - for i, v := range variations { - mod[i].base().setImageVariation(v) - mod[i].(ImageInterface).SetImageVariation(ctx, v) - } + return variations +} + +func (imageTransitionMutator) OutgoingTransition(ctx OutgoingTransitionContext, sourceVariation string) string { + return sourceVariation +} + +func (imageTransitionMutator) IncomingTransition(ctx IncomingTransitionContext, incomingVariation string) string { + if _, ok := ctx.Module().(ImageInterface); ctx.Os() != Android || !ok { + return CoreVariation + } + return incomingVariation +} + +func (imageTransitionMutator) Mutate(ctx BottomUpMutatorContext, variation string) { + ctx.Module().base().setImageVariation(variation) + if m, ok := ctx.Module().(ImageInterface); ok { + m.SetImageVariation(ctx, variation) } } diff --git a/android/module.go b/android/module.go index 5c2b1e1ea..f9fab96a9 100644 --- a/android/module.go +++ b/android/module.go @@ -1914,7 +1914,7 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext) return } cacheKey = &blueprint.BuildActionCacheKey{ - Id: ctx.bp.ModuleId(), + Id: ctx.bp.ModuleCacheKey(), InputHash: hash, } } diff --git a/android/mutator.go b/android/mutator.go index b81dd124a..38fb857dd 100644 --- a/android/mutator.go +++ b/android/mutator.go @@ -149,7 +149,7 @@ var preArch = []RegisterMutatorFunc{ func registerArchMutator(ctx RegisterMutatorsContext) { ctx.BottomUpBlueprint("os", osMutator).Parallel() - ctx.BottomUp("image", imageMutator).Parallel() + ctx.Transition("image", &imageTransitionMutator{}) ctx.BottomUpBlueprint("arch", archMutator).Parallel() } diff --git a/bin/soongdbg b/bin/soongdbg index a73bdf90d..98d31ebc9 100755 --- a/bin/soongdbg +++ b/bin/soongdbg @@ -216,7 +216,7 @@ def print_args(parser): help="jq query for each module metadata") parser.add_argument("--deptags", action="store_true", help="show dependency tags (makes the graph much more complex)") - parser.add_argument("--tag", action="append", + parser.add_argument("--tag", action="append", default=[], help="Limit output to these dependency tags.") group = parser.add_argument_group("output formats", diff --git a/bpf/bpf.go b/bpf/bpf.go index 09262e507..644539426 100644 --- a/bpf/bpf.go +++ b/bpf/bpf.go @@ -148,6 +148,10 @@ func (bpf *bpf) GenerateAndroidBuildActions(ctx android.ModuleContext) { "-no-canonical-prefixes", "-O2", + "-Wall", + "-Werror", + "-Wextra", + "-isystem bionic/libc/include", "-isystem bionic/libc/kernel/uapi", // The architecture doesn't matter here, but asm/types.h is included by linux/types.h. @@ -165,7 +169,7 @@ func (bpf *bpf) GenerateAndroidBuildActions(ctx android.ModuleContext) { cflags = append(cflags, bpf.properties.Cflags...) - if proptools.Bool(bpf.properties.Btf) { + if proptools.BoolDefault(bpf.properties.Btf, true) { cflags = append(cflags, "-g") if runtime.GOOS != "darwin" { cflags = append(cflags, "-fdebug-prefix-map=/proc/self/cwd=") @@ -190,7 +194,7 @@ func (bpf *bpf) GenerateAndroidBuildActions(ctx android.ModuleContext) { }, }) - if proptools.Bool(bpf.properties.Btf) { + if proptools.BoolDefault(bpf.properties.Btf, true) { objStripped := android.ObjPathWithExt(ctx, "", src, "o") ctx.Build(pctx, android.BuildParams{ Rule: stripRule, diff --git a/cc/config/global.go b/cc/config/global.go index bf2502fcf..66196c26b 100644 --- a/cc/config/global.go +++ b/cc/config/global.go @@ -136,11 +136,6 @@ var ( // displaying logs in web browsers. "-fmessage-length=0", - // Disable C++17 "relaxed template template argument matching" as a workaround for - // our out-dated libcxx. - // http://b/341084395 - "-fno-relaxed-template-template-args", - // Using simple template names reduces the size of debug builds. "-gsimple-template-names", diff --git a/java/ravenwood.go b/java/ravenwood.go index 84c285cc7..a52f4053f 100644 --- a/java/ravenwood.go +++ b/java/ravenwood.go @@ -285,6 +285,14 @@ func (r *ravenwoodLibgroup) GenerateAndroidBuildActions(ctx android.ModuleContex installPath := android.PathForModuleInstall(ctx, r.BaseModuleName()) for _, lib := range r.ravenwoodLibgroupProperties.Libs { libModule := ctx.GetDirectDepWithTag(lib, ravenwoodLibContentTag) + if libModule == nil { + if ctx.Config().AllowMissingDependencies() { + ctx.AddMissingDependencies([]string{lib}) + } else { + ctx.PropertyErrorf("lib", "missing dependency %q", lib) + } + continue + } libJar := android.OutputFileForModule(ctx, libModule, "") ctx.InstallFile(installPath, lib+".jar", libJar) } diff --git a/scripts/gen_build_prop.py b/scripts/gen_build_prop.py index 56ce14fef..c0d473585 100644 --- a/scripts/gen_build_prop.py +++ b/scripts/gen_build_prop.py @@ -237,7 +237,7 @@ def generate_build_info(args): print(f"# Do not try to parse description or thumbprint") print(f"ro.build.description?={config['BuildDesc']}") - if "build_thumbprint" in config: + if "BuildThumbprint" in config: print(f"ro.build.thumbprint={config['BuildThumbprint']}") print(f"# end build properties") diff --git a/ui/build/config.go b/ui/build/config.go index 631b76f03..b8fcb6b5d 100644 --- a/ui/build/config.go +++ b/ui/build/config.go @@ -1341,8 +1341,7 @@ func (c *configImpl) rbeDownloadTmpDir() string { } func (c *configImpl) rbeTmpDir() string { - buildTmpDir := shared.TempDirForOutDir(c.SoongOutDir()) - return filepath.Join(buildTmpDir, "rbe") + return filepath.Join(c.SoongOutDir(), "rbe") } func (c *configImpl) rbeCacheDir() string { diff --git a/ui/build/rbe.go b/ui/build/rbe.go index 8fa147f70..0a0f95628 100644 --- a/ui/build/rbe.go +++ b/ui/build/rbe.go @@ -65,7 +65,7 @@ func getRBEVars(ctx Context, config Config) map[string]string { "RBE_platform": "container-image=" + remoteexec.DefaultImage, } if config.StartRBE() { - name, err := config.rbeSockAddr(absPath(ctx, config.TempDir())) + name, err := config.rbeSockAddr(absPath(ctx, config.rbeTmpDir())) if err != nil { ctx.Fatalf("Error retrieving socket address: %v", err) return nil diff --git a/ui/build/sandbox_linux.go b/ui/build/sandbox_linux.go index 5c3fec15e..c38174c69 100644 --- a/ui/build/sandbox_linux.go +++ b/ui/build/sandbox_linux.go @@ -48,7 +48,11 @@ var ( } ) -const nsjailPath = "prebuilts/build-tools/linux-x86/bin/nsjail" +const ( + nsjailPath = "prebuilts/build-tools/linux-x86/bin/nsjail" + abfsSrcDir = "/src" + abfsOutDir = "/src/out" +) var sandboxConfig struct { once sync.Once @@ -145,6 +149,22 @@ func (c *Cmd) sandboxSupported() bool { return sandboxConfig.working } +func (c *Cmd) srcDirArg() string { + if !c.config.UseABFS() { + return sandboxConfig.srcDir + } + + return sandboxConfig.srcDir + ":" + abfsSrcDir +} + +func (c *Cmd) outDirArg() string { + if !c.config.UseABFS() { + return sandboxConfig.outDir + } + + return sandboxConfig.outDir + ":" + abfsOutDir +} + func (c *Cmd) wrapSandbox() { wd, _ := os.Getwd() @@ -188,10 +208,10 @@ func (c *Cmd) wrapSandbox() { "-B", "/tmp", // Mount source - c.config.sandboxConfig.SrcDirMountFlag(), sandboxConfig.srcDir, + c.config.sandboxConfig.SrcDirMountFlag(), c.srcDirArg(), //Mount out dir as read-write - "-B", sandboxConfig.outDir, + "-B", c.outDirArg(), // Disable newcgroup for now, since it may require newer kernels // TODO: try out cgroups |