diff options
-rw-r--r-- | Android.bp | 1 | ||||
-rw-r--r-- | android/config.go | 14 | ||||
-rw-r--r-- | android/paths.go | 147 | ||||
-rw-r--r-- | android/variable.go | 22 | ||||
-rw-r--r-- | cc/config/arm64_device.go | 1 | ||||
-rw-r--r-- | cc/gen.go | 2 | ||||
-rw-r--r-- | cmd/sbox/sbox.go | 15 | ||||
-rw-r--r-- | java/aar.go | 10 | ||||
-rw-r--r-- | java/androidmk.go | 4 | ||||
-rw-r--r-- | java/app.go | 5 | ||||
-rw-r--r-- | java/app_test.go | 3 | ||||
-rw-r--r-- | java/dex.go | 14 | ||||
-rw-r--r-- | java/java.go | 20 | ||||
-rw-r--r-- | java/java_test.go | 4 | ||||
-rw-r--r-- | scripts/microfactory.bash | 2 | ||||
-rw-r--r-- | ui/build/cleanbuild.go | 1 | ||||
-rw-r--r-- | ui/build/config.go | 11 | ||||
-rw-r--r-- | ui/build/dumpvars.go | 5 |
18 files changed, 262 insertions, 19 deletions
@@ -37,6 +37,7 @@ bootstrap_go_package { "blueprint-bootstrap", "soong", "soong-env", + "soong-lineage", ], srcs: [ "android/androidmk.go", diff --git a/android/config.go b/android/config.go index fafed6b0..906d8f6d 100644 --- a/android/config.go +++ b/android/config.go @@ -27,6 +27,8 @@ import ( "github.com/google/blueprint/bootstrap" "github.com/google/blueprint/proptools" + + "lineage/soong/android" ) var Bool = proptools.Bool @@ -468,6 +470,14 @@ func (c *config) ResourceOverlays() []string { return *c.productVariables.ResourceOverlays } +func (c *config) JavaSourceOverlays() string { + return String(c.productVariables.Lineage.Java_Source_Overlays) +} + +func (c *config) JavaSourceOverlayModuleWhitelist() []string { + return android.LineageConfig.JavaSourceOverlayModuleWhitelist +} + func (c *config) PlatformVersionName() string { return String(c.productVariables.Platform_version_name) } @@ -776,6 +786,10 @@ func (c *deviceConfig) DeviceKernelHeaderDirs() []string { return c.config.productVariables.DeviceKernelHeaders } +func (c *deviceConfig) SpecificCameraParametersLibrary() string { + return String(c.config.productVariables.Lineage.Specific_camera_parameter_library) +} + func (c *deviceConfig) NativeCoverageEnabled() bool { return Bool(c.config.productVariables.NativeCoverage) } diff --git a/android/paths.go b/android/paths.go index 91dd9a6d..a9992d0d 100644 --- a/android/paths.go +++ b/android/paths.go @@ -535,6 +535,31 @@ func pathForSource(ctx PathContext, pathComponents ...string) (SourcePath, error return ret, nil } +// pathForSourceRelaxed creates a SourcePath from pathComponents, but does not check that it exists. +// It differs from pathForSource in that the path is allowed to exist outside of the PathContext. +func pathForSourceRelaxed(ctx PathContext, pathComponents ...string) (SourcePath, error) { + p := filepath.Join(pathComponents...) + ret := SourcePath{basePath{p, ctx.Config(), ""}} + + abs, err := filepath.Abs(ret.String()) + if err != nil { + return ret, err + } + buildroot, err := filepath.Abs(ctx.Config().buildDir) + if err != nil { + return ret, err + } + if strings.HasPrefix(abs, buildroot) { + return ret, fmt.Errorf("source path %s is in output", abs) + } + + if pathtools.IsGlob(ret.String()) { + return ret, fmt.Errorf("path may not contain a glob: %s", ret.String()) + } + + return ret, nil +} + // existsWithDependencies returns true if the path exists, and adds appropriate dependencies to rerun if the // path does not exist. func existsWithDependencies(ctx PathContext, path SourcePath) (exists bool, err error) { @@ -584,6 +609,128 @@ func PathForSource(ctx PathContext, pathComponents ...string) SourcePath { return path } +// PathForSourceRelaxed joins the provided path components. Unlike PathForSource, +// the result is allowed to exist outside of the source dir. +// On error, it will return a usable, but invalid SourcePath, and report a ModuleError. +func PathForSourceRelaxed(ctx PathContext, pathComponents ...string) SourcePath { + path, err := pathForSourceRelaxed(ctx, pathComponents...) + if err != nil { + reportPathError(ctx, err) + } + + if modCtx, ok := ctx.(ModuleContext); ok && ctx.Config().AllowMissingDependencies() { + exists, err := existsWithDependencies(ctx, path) + if err != nil { + reportPathError(ctx, err) + } + if !exists { + modCtx.AddMissingDependencies([]string{path.String()}) + } + } else if exists, _, err := ctx.Fs().Exists(path.String()); err != nil { + reportPathErrorf(ctx, "%s: %s", path, err.Error()) + } else if !exists { + reportPathErrorf(ctx, "source path %s does not exist", path) + } + return path +} + +func ApplySourceOverlays(ctx ModuleContext, directives string, allowedModules []string, srcFiles []Path) []Path { + // Multiple overlay directives should be white space separated. + // Individual directive format is: + // <modulename>|<overlaydir>|<globwithinoverlaydir> + // Example: + // org.lineageos.hardware|device/oneplus/msm8998-common/lineagehw|**/*.java + // If there is a file match by multiple directives, the first wins. + + // Create map of expanded glob paths (globwithinoverlaydir component only) + // to full android.Path mappings. + overlayMap := make(map[string]Path) + + // Split directives string into distinct directives. + for _, directive := range strings.Fields(directives) { + // Split directive string into whitespace fields. + fields := strings.SplitN(directive, "|", 3) + if len(fields) != 3 { + ctx.ModuleErrorf("could not parse source overlay directive %s", directive) + continue + } + + // Name the per-directive fields. + module, dir, glob := fields[0], fields[1], fields[2] + + // Skip overlay directives that don't apply to this module. + if module != ctx.ModuleName() { + continue + } + + // Check whether sources overlays are permitted for this module. + allowed := false + for _, allowedModule := range allowedModules { + if allowedModule == module { + allowed = true + break + } + } + if !allowed { + // Source overlays for this module are not + // allowed, skip. + ctx.ModuleErrorf("not allowed to sources overlay module %s", module) + return srcFiles + } + + addPathsToOverlayMap(ctx, dir, glob, overlayMap) + } + + // Calculate the length of the path to the module root dir (including trailing slash). + modulePathLen := len(ctx.ModuleDir()) + 1 + + // Replace entries in srcFiles where the path within the module matches a key in overlayMap. + for i := range srcFiles { + srcFilePath := srcFiles[i].String() + if len(srcFilePath) < modulePathLen { + continue + } + pathWithinModule := srcFilePath[modulePathLen:] + if overlayFile, found := overlayMap[pathWithinModule]; found { + srcFiles[i] = overlayFile + delete(overlayMap, pathWithinModule) + } + } + // and create new srcFiles entries for those that don't. + for _, path := range overlayMap { + srcFiles = append(srcFiles, path) + } + + return srcFiles +} + +func addPathsToOverlayMap(ctx ModuleContext, dir, glob string, overlayMap map[string]Path) { + // Glob dir/glob to establish which overlay files exist. + globPath := filepath.Join(dir, glob) + paths, err := ctx.GlobWithDeps(globPath, nil) + if err != nil { + ctx.ModuleErrorf("unable to glob %s: %s", globPath, err.Error()) + return + } + // Add globbed paths to overlayMap. If an overlay already exists, it is + // not overwritten. + for _, path := range paths { + // Skip directories. + if strings.HasSuffix(path, "/") { + continue + } + // Ensure that the globbed match points to something inside the module. + if !strings.HasPrefix(path, dir+"/") { + continue + } + // Note: the preceding checks tells us that len(path) > len(dir)+1 + pathWithinModule := path[len(dir)+1:] // Account for trailing slash. + if _, found := overlayMap[pathWithinModule]; !found { + overlayMap[pathWithinModule] = PathForSourceRelaxed(ctx, path) + } + } +} + // ExistentPathForSource returns an OptionalPath with the SourcePath if the // path exists, or an empty OptionalPath if it doesn't exist. Dependencies are added // so that the ninja file will be regenerated if the state of the path changes. diff --git a/android/variable.go b/android/variable.go index f4aaec7a..6af4f7e1 100644 --- a/android/variable.go +++ b/android/variable.go @@ -20,6 +20,8 @@ import ( "runtime" "strings" + "lineage/soong/android" + "github.com/google/blueprint/proptools" ) @@ -114,6 +116,9 @@ type variableProperties struct { Static_libs []string Srcs []string } + + // include Lineage variables + Lineage android.Product_variables } `android:"arch_variant"` } @@ -230,6 +235,9 @@ type productVariables struct { PgoAdditionalProfileDirs []string `json:",omitempty"` VendorVars map[string]map[string]string `json:",omitempty"` + + // include Lineage variables + Lineage android.ProductVariables } func boolPtr(v bool) *bool { @@ -289,7 +297,14 @@ func variableMutator(mctx BottomUpMutatorContext) { a := module.base() variableValues := reflect.ValueOf(&a.variableProperties.Product_variables).Elem() zeroValues := reflect.ValueOf(zeroProductVariables.Product_variables) + valStruct := reflect.ValueOf(mctx.Config().productVariables) + + doVariableMutation(mctx, a, variableValues, zeroValues, valStruct) + +} +func doVariableMutation(mctx BottomUpMutatorContext, a *ModuleBase, variableValues reflect.Value, zeroValues reflect.Value, + valStruct reflect.Value) { for i := 0; i < variableValues.NumField(); i++ { variableValue := variableValues.Field(i) zeroValue := zeroValues.Field(i) @@ -297,8 +312,11 @@ func variableMutator(mctx BottomUpMutatorContext) { property := "product_variables." + proptools.PropertyNameForField(name) // Check that the variable was set for the product - val := reflect.ValueOf(mctx.Config().productVariables).FieldByName(name) - if !val.IsValid() || val.Kind() != reflect.Ptr || val.IsNil() { + val := valStruct.FieldByName(name) + if val.IsValid() && val.Kind() == reflect.Struct { + doVariableMutation(mctx, a, variableValue, zeroValue, val) + continue + } else if !val.IsValid() || val.Kind() != reflect.Ptr || val.IsNil() { continue } diff --git a/cc/config/arm64_device.go b/cc/config/arm64_device.go index 00c29f53..8be33a85 100644 --- a/cc/config/arm64_device.go +++ b/cc/config/arm64_device.go @@ -86,6 +86,7 @@ func init() { "cortex-a73", "cortex-a75", "kryo", + "kryo300", "exynos-m1", "exynos-m2", "denver64") @@ -25,7 +25,7 @@ import ( ) func init() { - pctx.SourcePathVariable("lexCmd", "prebuilts/misc/${config.HostPrebuiltTag}/flex/flex-2.5.39") + pctx.SourcePathVariable("lexCmd", "prebuilts/build-tools/${config.HostPrebuiltTag}/bin/flex") pctx.SourcePathVariable("yaccCmd", "prebuilts/build-tools/${config.HostPrebuiltTag}/bin/bison") pctx.SourcePathVariable("yaccDataDir", "prebuilts/build-tools/common/bison") diff --git a/cmd/sbox/sbox.go b/cmd/sbox/sbox.go index 0af18863..fabe08d4 100644 --- a/cmd/sbox/sbox.go +++ b/cmd/sbox/sbox.go @@ -31,6 +31,7 @@ var ( rawCommand string outputRoot string keepOutDir bool + copyAllOutput bool depfileOut string ) @@ -43,6 +44,8 @@ func init() { "root of directory to copy outputs into") flag.BoolVar(&keepOutDir, "keep-out-dir", false, "whether to keep the sandbox directory when done") + flag.BoolVar(©AllOutput, "copy-all-output", false, + "whether to copy all output files") flag.StringVar(&depfileOut, "depfile-out", "", "file path of the depfile to generate. This value will replace '__SBOX_DEPFILE__' in the command and will be treated as an output but won't be added to __SBOX_OUT_FILES__") @@ -113,7 +116,7 @@ func run() error { // the contents of the __SBOX_OUT_FILES__ variable outputsVarEntries := flag.Args() - if len(outputsVarEntries) == 0 { + if !copyAllOutput && len(outputsVarEntries) == 0 { usageViolation("at least one output file must be given") } @@ -222,7 +225,7 @@ func run() error { missingOutputErrors = append(missingOutputErrors, fmt.Sprintf("%s: not a file", filePath)) } } - if len(missingOutputErrors) > 0 { + if !copyAllOutput && len(missingOutputErrors) > 0 { // find all created files for making a more informative error message createdFiles := findAllFilesUnder(tempDir) @@ -254,8 +257,14 @@ func run() error { keepOutDir = true return errors.New(errorMessage) } + var filePathList []string + if copyAllOutput { + filePathList = findAllFilesUnder(tempDir) + } else { + filePathList = allOutputs + } // the created files match the declared files; now move them - for _, filePath := range allOutputs { + for _, filePath := range filePathList { tempPath := filepath.Join(tempDir, filePath) destPath := filePath if len(outputRoot) != 0 { diff --git a/java/aar.go b/java/aar.go index 66f1cab6..ca936847 100644 --- a/java/aar.go +++ b/java/aar.go @@ -147,7 +147,7 @@ func (a *aapt) aapt2Flags(ctx android.ModuleContext, sdkVersion string) (flags [ if !hasVersionName { var versionName string - if ctx.ModuleName() == "framework-res" { + if ctx.ModuleName() == "framework-res" || ctx.ModuleName() == "org.lineageos.platform-res" { // Some builds set AppsDefaultVersionName() to include the build number ("O-123456"). aapt2 copies the // version name of framework-res into app manifests as compileSdkVersionCodename, which confuses things // if it contains the build number. Use the PlatformVersionName instead. @@ -168,6 +168,9 @@ func (a *aapt) deps(ctx android.BottomUpMutatorContext, sdkVersion string) { if sdkDep.frameworkResModule != "" { ctx.AddDependency(ctx.Module(), frameworkResTag, sdkDep.frameworkResModule) } + if sdkDep.lineageResModule != "" { + ctx.AddDependency(ctx.Module(), lineageResTag, sdkDep.lineageResModule) + } } } @@ -224,7 +227,7 @@ func aaptLibs(ctx android.ModuleContext, sdkVersion string) (transitiveStaticLib } switch ctx.OtherModuleDependencyTag(module) { - case libTag, frameworkResTag: + case libTag, frameworkResTag, lineageResTag: if exportPackage != nil { sharedLibs = append(sharedLibs, exportPackage) } @@ -386,6 +389,9 @@ func (a *AARImport) DepsMutator(ctx android.BottomUpMutatorContext) { if sdkDep.useModule && sdkDep.frameworkResModule != "" { ctx.AddDependency(ctx.Module(), frameworkResTag, sdkDep.frameworkResModule) } + if sdkDep.useModule && sdkDep.lineageResModule != "" { + ctx.AddDependency(ctx.Module(), lineageResTag, sdkDep.lineageResModule) + } } ctx.AddDependency(ctx.Module(), libTag, a.properties.Libs...) diff --git a/java/androidmk.go b/java/androidmk.go index b85ecb40..c78e8e3c 100644 --- a/java/androidmk.go +++ b/java/androidmk.go @@ -188,7 +188,7 @@ func (app *AndroidApp) AndroidMk() android.AndroidMkData { fmt.Fprintln(w, "LOCAL_SOONG_PROGUARD_DICT :=", app.proguardDictionary.String()) } - if app.Name() == "framework-res" { + if app.Name() == "framework-res" || app.Name() == "org.lineageos.platform-res" { fmt.Fprintln(w, "LOCAL_MODULE_PATH := $(TARGET_OUT_JAVA_LIBRARIES)") // Make base_rules.mk not put framework-res in a subdirectory called // framework_res. @@ -225,7 +225,7 @@ func (a *AndroidLibrary) AndroidMk() android.AndroidMkData { fmt.Fprintln(w, "LOCAL_SOONG_PROGUARD_DICT :=", a.proguardDictionary.String()) } - if a.Name() == "framework-res" { + if a.Name() == "framework-res" || a.Name() == "org.lineageos.platform-res" { fmt.Fprintln(w, "LOCAL_MODULE_PATH := $(TARGET_OUT_JAVA_LIBRARIES)") // Make base_rules.mk not put framework-res in a subdirectory called // framework_res. diff --git a/java/app.go b/java/app.go index ae0592a6..d7d93717 100644 --- a/java/app.go +++ b/java/app.go @@ -136,7 +136,7 @@ func (a *AndroidApp) GenerateAndroidBuildActions(ctx android.ModuleContext) { a.Module.extraProguardFlagFiles = append(a.Module.extraProguardFlagFiles, staticLibProguardFlagFiles...) a.Module.extraProguardFlagFiles = append(a.Module.extraProguardFlagFiles, a.proguardOptionsFile) - if ctx.ModuleName() != "framework-res" { + if ctx.ModuleName() != "framework-res" && ctx.ModuleName() != "org.lineageos.platform-res" { a.Module.compile(ctx, a.aaptSrcJar) } @@ -175,6 +175,9 @@ func (a *AndroidApp) GenerateAndroidBuildActions(ctx android.ModuleContext) { if ctx.ModuleName() == "framework-res" { // framework-res.apk is installed as system/framework/framework-res.apk ctx.InstallFile(android.PathForModuleInstall(ctx, "framework"), ctx.ModuleName()+".apk", a.outputFile) + } else if ctx.ModuleName() == "org.lineageos.platform-res" { + // org.lineageos.platform-res.apk is installed as system/framework/org.lineageos.platform-res.apk + ctx.InstallFile(android.PathForModuleInstall(ctx, "framework"), ctx.ModuleName()+".apk", a.outputFile) } else if Bool(a.appProperties.Privileged) { ctx.InstallFile(android.PathForModuleInstall(ctx, "priv-app"), ctx.ModuleName()+".apk", a.outputFile) } else { diff --git a/java/app_test.go b/java/app_test.go index 6770119e..c1f2114b 100644 --- a/java/app_test.go +++ b/java/app_test.go @@ -74,8 +74,11 @@ func TestApp(t *testing.T) { expectedLinkImplicits := []string{"AndroidManifest.xml"} frameworkRes := ctx.ModuleForTests("framework-res", "android_common") + lineageRes := ctx.ModuleForTests("org.lineageos.platform-res", "android_common") expectedLinkImplicits = append(expectedLinkImplicits, frameworkRes.Output("package-res.apk").Output.String()) + expectedLinkImplicits = append(expectedLinkImplicits, + lineageRes.Output("package-res.apk").Output.String()) // Test the mapping from input files to compiled output file names compile := foo.Output(compiledResourceFiles[0]) diff --git a/java/dex.go b/java/dex.go index 66e71b59..642dee4a 100644 --- a/java/dex.go +++ b/java/dex.go @@ -238,14 +238,16 @@ func (j *Module) compileDex(ctx android.ModuleContext, flags javaBuilderFlags, if useR8 { // TODO(ccross): if this is an instrumentation test of an obfuscated app, use the // dictionary of the app and move the app from libraryjars to injars. - j.proguardDictionary = android.PathForModuleOut(ctx, "proguard_dictionary") + proguardDictionary := android.PathForModuleOut(ctx, "proguard_dictionary") + j.proguardDictionary = proguardDictionary r8Flags, r8Deps := j.r8Flags(ctx, flags) ctx.Build(pctx, android.BuildParams{ - Rule: r8, - Description: "r8", - Output: javalibJar, - Input: classesJar, - Implicits: r8Deps, + Rule: r8, + Description: "r8", + Output: javalibJar, + ImplicitOutput: proguardDictionary, + Input: classesJar, + Implicits: r8Deps, Args: map[string]string{ "dxFlags": strings.Join(dxFlags, " "), "r8Flags": strings.Join(r8Flags, " "), diff --git a/java/java.go b/java/java.go index ddfb09a4..b1c3c142 100644 --- a/java/java.go +++ b/java/java.go @@ -302,6 +302,7 @@ var ( bootClasspathTag = dependencyTag{name: "bootclasspath"} systemModulesTag = dependencyTag{name: "system modules"} frameworkResTag = dependencyTag{name: "framework-res"} + lineageResTag = dependencyTag{name: "org.lineageos.platform-res"} kotlinStdlibTag = dependencyTag{name: "kotlin-stdlib"} proguardRaiseTag = dependencyTag{name: "proguard-raise"} ) @@ -313,6 +314,7 @@ type sdkDep struct { systemModules string frameworkResModule string + lineageResModule string jar android.Path aidl android.Path @@ -421,6 +423,7 @@ func decodeSdkDep(ctx android.BaseContext, v string) sdkDep { return sdkDep{ useDefaultLibs: true, frameworkResModule: "framework-res", + lineageResModule: "org.lineageos.platform-res", } // TODO(ccross): re-enable these once we generate stubs, until then // use the stubs in prebuilts/sdk/*current @@ -466,6 +469,12 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) { if ctx.ModuleName() == "framework" { ctx.AddDependency(ctx.Module(), frameworkResTag, "framework-res") } + if ctx.ModuleName() == "org.lineageos.platform-res" { + ctx.AddDependency(ctx.Module(), frameworkResTag, "framework-res") + } + if ctx.ModuleName() == "org.lineageos.platform" || ctx.ModuleName() == "org.lineageos.platform.internal" { + ctx.AddDependency(ctx.Module(), lineageResTag, "org.lineageos.platform-res") + } } ctx.AddDependency(ctx.Module(), libTag, j.properties.Libs...) @@ -618,6 +627,13 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps { // generated by framework-res.apk deps.srcJars = append(deps.srcJars, dep.(*AndroidApp).aaptSrcJar) } + case lineageResTag: + if ctx.ModuleName() == "org.lineageos.platform" || + ctx.ModuleName() == "org.lineageos.platform.internal" { + // org.lineageos.platform.jar has a one-off dependency on the R.java and Manifest.java files + // generated by org.lineageos.platform-res.apk + deps.srcJars = append(deps.srcJars, dep.(*AndroidApp).aaptSrcJar) + } case kotlinStdlibTag: deps.kotlinStdlib = dep.HeaderJars() default: @@ -764,6 +780,10 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path srcFiles = j.genSources(ctx, srcFiles, flags) + // Apply any java source overlays + srcFiles = android.ApplySourceOverlays(ctx, ctx.Config().JavaSourceOverlays(), + ctx.Config().JavaSourceOverlayModuleWhitelist(), srcFiles) + srcJars := srcFiles.FilterByExt(".srcjar") srcJars = append(srcJars, deps.srcJars...) srcJars = append(srcJars, extraSrcJars...) diff --git a/java/java_test.go b/java/java_test.go index fb8cc949..bc16d889 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -117,6 +117,10 @@ func testContext(config android.Config, bp string, name: "framework-res", no_framework_libs: true, } + android_app { + name: "org.lineageos.platform-res", + no_framework_libs: true, + } ` systemModules := []string{ diff --git a/scripts/microfactory.bash b/scripts/microfactory.bash index 65ba55d9..39870d0b 100644 --- a/scripts/microfactory.bash +++ b/scripts/microfactory.bash @@ -59,7 +59,7 @@ function soong_build_go BUILDDIR=$(getoutdir) \ SRCDIR=${TOP} \ BLUEPRINTDIR=${TOP}/build/blueprint \ - EXTRA_ARGS="-pkg-path android/soong=${TOP}/build/soong" \ + EXTRA_ARGS="-pkg-path android/soong=${TOP}/build/soong -pkg-path lineage/soong=${TOP}/vendor/lineage/build/soong" \ build_go $@ } diff --git a/ui/build/cleanbuild.go b/ui/build/cleanbuild.go index 24a8c7a8..d5a54f98 100644 --- a/ui/build/cleanbuild.go +++ b/ui/build/cleanbuild.go @@ -96,6 +96,7 @@ func installClean(ctx Context, config Config, what int) { hostOut("vts"), productOut("*.img"), productOut("*.zip"), + productOut("*.zip.md5sum"), productOut("android-info.txt"), productOut("kernel"), productOut("data"), diff --git a/ui/build/config.go b/ui/build/config.go index 27ed8e9f..f95eb646 100644 --- a/ui/build/config.go +++ b/ui/build/config.go @@ -65,7 +65,11 @@ func NewConfig(ctx Context, args ...string) Config { // Make sure OUT_DIR is set appropriately if outDir, ok := ret.environ.Get("OUT_DIR"); ok { - ret.environ.Set("OUT_DIR", filepath.Clean(outDir)) + outDir := filepath.Clean(outDir) + if (!filepath.IsAbs(outDir)) { + outDir = filepath.Join(os.Getenv("TOP"), outDir) + } + ret.environ.Set("OUT_DIR", outDir) } else { outDir := "out" if baseDir, ok := ret.environ.Get("OUT_DIR_COMMON_BASE"); ok { @@ -74,6 +78,8 @@ func NewConfig(ctx Context, args ...string) Config { } else { outDir = filepath.Join(baseDir, filepath.Base(wd)) } + } else { + outDir = filepath.Join(os.Getenv("TOP"), outDir) } ret.environ.Set("OUT_DIR", outDir) } @@ -282,6 +288,9 @@ func (c *configImpl) configureLocale(ctx Context) { // for others) if inList("C.UTF-8", locales) { c.environ.Set("LANG", "C.UTF-8") + } else if inList("C.utf8", locales) { + // These normalize to the same thing + c.environ.Set("LANG", "C.UTF-8") } else if inList("en_US.UTF-8", locales) { c.environ.Set("LANG", "en_US.UTF-8") } else if inList("en_US.utf8", locales) { diff --git a/ui/build/dumpvars.go b/ui/build/dumpvars.go index a0e1ecad..08646a8f 100644 --- a/ui/build/dumpvars.go +++ b/ui/build/dumpvars.go @@ -88,6 +88,7 @@ func dumpMakeVars(ctx Context, config Config, goals, vars []string, write_soong_ var BannerVars = []string{ "PLATFORM_VERSION_CODENAME", "PLATFORM_VERSION", + "LINEAGE_VERSION", "TARGET_PRODUCT", "TARGET_BUILD_VARIANT", "TARGET_BUILD_TYPE", @@ -112,6 +113,10 @@ var BannerVars = []string{ "TARGET_BUILD_PDK", "PDK_FUSION_PLATFORM_ZIP", "PRODUCT_SOONG_NAMESPACES", + "TARGET_USE_SDCLANG", + "RECOVERY_VARIANT", + "WITH_SU", + "WITH_GMS", } func Banner(make_vars map[string]string) string { |