Revert "Sandbox soong_build by changing to root directory"

This reverts commit 05c25ccb4a.

Reason for revert: broke absolute OUT_DIR
Bug: 146437378

Change-Id: I523ed79d40e1c1ef040212ba794a7a084abea75d
This commit is contained in:
Colin Cross
2020-01-10 18:51:04 +00:00
parent 05c25ccb4a
commit 47e4f9e1e8
23 changed files with 130 additions and 208 deletions

View File

@@ -16,6 +16,7 @@ package cc
import (
"fmt"
"os"
"path/filepath"
"strings"
@@ -254,8 +255,16 @@ func processHeadersWithVersioner(ctx android.ModuleContext, srcDir, outDir andro
depsPath := android.PathForSource(ctx, "bionic/libc/versioner-dependencies")
depsGlob := ctx.Glob(filepath.Join(depsPath.String(), "**/*"), nil)
for i, path := range depsGlob {
if ctx.IsSymlink(path) {
dest := ctx.Readlink(path)
fileInfo, err := os.Lstat(path.String())
if err != nil {
ctx.ModuleErrorf("os.Lstat(%q) failed: %s", path.String, err)
}
if fileInfo.Mode()&os.ModeSymlink == os.ModeSymlink {
dest, err := os.Readlink(path.String())
if err != nil {
ctx.ModuleErrorf("os.Readlink(%q) failed: %s",
path.String, err)
}
// Additional .. to account for the symlink itself.
depsGlob[i] = android.PathForSource(
ctx, filepath.Clean(filepath.Join(path.String(), "..", dest)))