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,13 +16,13 @@ package android
import (
"fmt"
"os"
"path"
"path/filepath"
"strings"
"text/scanner"
"github.com/google/blueprint"
"github.com/google/blueprint/pathtools"
"github.com/google/blueprint/proptools"
)
@@ -91,8 +91,7 @@ type EarlyModuleContext interface {
Glob(globPattern string, excludes []string) Paths
GlobFiles(globPattern string, excludes []string) Paths
IsSymlink(path Path) bool
Readlink(path Path) string
Fs() pathtools.FileSystem
}
// BaseModuleContext is the same as blueprint.BaseModuleContext except that Config() returns
@@ -1173,22 +1172,6 @@ func (e *earlyModuleContext) GlobFiles(globPattern string, excludes []string) Pa
return pathsForModuleSrcFromFullPath(e, ret, false)
}
func (b *earlyModuleContext) IsSymlink(path Path) bool {
fileInfo, err := b.config.fs.Lstat(path.String())
if err != nil {
b.ModuleErrorf("os.Lstat(%q) failed: %s", path.String(), err)
}
return fileInfo.Mode()&os.ModeSymlink == os.ModeSymlink
}
func (b *earlyModuleContext) Readlink(path Path) string {
dest, err := b.config.fs.Readlink(path.String())
if err != nil {
b.ModuleErrorf("os.Readlink(%q) failed: %s", path.String(), err)
}
return dest
}
func (e *earlyModuleContext) Module() Module {
module, _ := e.EarlyModuleContext.Module().(Module)
return module