Revert "Clean environment variables to account for sandbox work directory."

This reverts commit 0af8ea14fc.

Reason for revert: <Droidmonitor created revert due to b/363848580. Will be verifying through ABTD before submission.>

Change-Id: Iafba28897ad27df67ef8ae8904454196c482216d
This commit is contained in:
PODISHETTY KUMAR (xWF)
2024-09-02 03:54:36 +00:00
committed by Gerrit Code Review
parent 0af8ea14fc
commit 9543d19b4b
3 changed files with 17 additions and 69 deletions

View File

@@ -57,22 +57,6 @@ func parsePathDir(dir string) []string {
return ret
}
func updatePathForSandbox(config Config) {
wd, err := os.Getwd()
if err != nil {
return
}
var newPath []string
if path, ok := config.Environment().Get("PATH"); ok && path != "" {
entries := strings.Split(path, string(filepath.ListSeparator))
for _, ent := range entries {
newPath = append(newPath, config.sandboxPath(wd, ent))
}
}
config.Environment().Set("PATH", strings.Join(newPath, string(filepath.ListSeparator)))
}
// SetupLitePath is the "lite" version of SetupPath used for dumpvars, or other
// places that does not need the full logging capabilities of path_interposer,
// wants the minimal performance overhead, and still get the benefits of $PATH
@@ -137,7 +121,6 @@ func SetupLitePath(ctx Context, config Config, tmpDir string) {
// Set $PATH to be the directories containing the host tool symlinks, and
// the prebuilts directory for the current host OS.
config.Environment().Set("PATH", myPath)
updatePathForSandbox(config)
config.pathReplaced = true
}
@@ -282,6 +265,5 @@ func SetupPath(ctx Context, config Config) {
// Replace the $PATH variable with the path_interposer symlinks, and
// checked-in prebuilts.
config.Environment().Set("PATH", myPath)
updatePathForSandbox(config)
config.pathReplaced = true
}