Clean OUT_DIR

Otherwise Make and soong_ui disagree about where the soong.variables
file should be. For example, when "OUT_DIR=out/":

Error dumping make vars: Failed to parse make line: "make: Nothing to be done for `out/soong/soong.variables'."

We would need to pass out//soong/soong.variables into make, since it
doesn't attempt to match clean/unclean paths.

Bug: 37553659
Test: OUT_DIR=out/ m -j
Change-Id: Iebeea4868b96b11e8b08735f272e22be5db1d701
This commit is contained in:
Dan Willemsen
2017-05-12 13:50:19 -07:00
parent 67a5c132c5
commit 02f3add3a3

View File

@@ -51,7 +51,9 @@ func NewConfig(ctx Context, args ...string) Config {
}
// Make sure OUT_DIR is set appropriately
if _, ok := ret.environ.Get("OUT_DIR"); !ok {
if outDir, ok := ret.environ.Get("OUT_DIR"); ok {
ret.environ.Set("OUT_DIR", filepath.Clean(outDir))
} else {
outDir := "out"
if baseDir, ok := ret.environ.Get("OUT_DIR_COMMON_BASE"); ok {
if wd, err := os.Getwd(); err != nil {