aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2019-02-14 20:00:56 -0800
committerDan Willemsen <dwillemsen@google.com>2019-02-14 20:07:02 -0800
commit91219731308116f8ace04176f80e31656df593e0 (patch)
treee6595e8755252f12f7da9779ce9c637e6b968049 /ui
parentbf920d5264fe31373c20b70a755c063946c4c0aa (diff)
downloadbuild_soong-91219731308116f8ace04176f80e31656df593e0.tar.gz
build_soong-91219731308116f8ace04176f80e31656df593e0.tar.bz2
build_soong-91219731308116f8ace04176f80e31656df593e0.zip
Stop calling our host $PATH prebuilts toybox
There's more than just toybox in this group now, so let's rename our variables to something closer to the desired behavior, rather than the first user. Test: treehugger Change-Id: I76d4407792061c8110b194cfe73f1ddc84dbc22f
Diffstat (limited to 'ui')
-rw-r--r--ui/build/path.go7
-rw-r--r--ui/build/paths/config.go126
2 files changed, 68 insertions, 65 deletions
diff --git a/ui/build/path.go b/ui/build/path.go
index ee72cfd4..52941335 100644
--- a/ui/build/path.go
+++ b/ui/build/path.go
@@ -147,10 +147,11 @@ func SetupPath(ctx Context, config Config) {
myPath, _ = filepath.Abs(myPath)
- // Use the toybox prebuilts on linux
+ // We put some prebuilts in $PATH, since it's infeasible to add dependencies for all of
+ // them.
if runtime.GOOS == "linux" {
- toyboxPath, _ := filepath.Abs("prebuilts/build-tools/toybox/linux-x86")
- myPath = toyboxPath + string(os.PathListSeparator) + myPath
+ prebuiltsPath, _ := filepath.Abs("prebuilts/build-tools/path/" + runtime.GOOS + "-x86")
+ myPath = prebuiltsPath + string(os.PathListSeparator) + myPath
}
config.Environment().Set("PATH", myPath)
diff --git a/ui/build/paths/config.go b/ui/build/paths/config.go
index b9713fee..b20f37c4 100644
--- a/ui/build/paths/config.go
+++ b/ui/build/paths/config.go
@@ -26,9 +26,9 @@ type PathConfig struct {
// Whether to exit with an error instead of invoking the underlying tool.
Error bool
- // Whether we use a toybox prebuilt for this tool. Since we don't have
- // toybox for Darwin, we'll use the host version instead.
- Toybox bool
+ // Whether we use a linux-specific prebuilt for this tool. On Darwin,
+ // we'll allow the host executable instead.
+ LinuxOnlyPrebuilt bool
}
var Allowed = PathConfig{
@@ -59,11 +59,11 @@ var Missing = PathConfig{
Error: true,
}
-var Toybox = PathConfig{
- Symlink: false,
- Log: true,
- Error: true,
- Toybox: true,
+var LinuxOnlyPrebuilt = PathConfig{
+ Symlink: false,
+ Log: true,
+ Error: true,
+ LinuxOnlyPrebuilt: true,
}
func GetConfig(name string) PathConfig {
@@ -125,58 +125,60 @@ var Configuration = map[string]PathConfig{
"ld.gold": Forbidden,
"pkg-config": Forbidden,
+ // On Linux we'll use one-true-awk instead.
+ "awk": LinuxOnlyPrebuilt,
+
// On Linux we'll use the toybox versions of these instead.
- "awk": Toybox, // Strictly one-true-awk, but...
- "basename": Toybox,
- "cat": Toybox,
- "chmod": Toybox,
- "cmp": Toybox,
- "cp": Toybox,
- "comm": Toybox,
- "cut": Toybox,
- "dirname": Toybox,
- "du": Toybox,
- "echo": Toybox,
- "env": Toybox,
- "expr": Toybox,
- "head": Toybox,
- "getconf": Toybox,
- "hostname": Toybox,
- "id": Toybox,
- "ln": Toybox,
- "ls": Toybox,
- "md5sum": Toybox,
- "mkdir": Toybox,
- "mktemp": Toybox,
- "mv": Toybox,
- "od": Toybox,
- "paste": Toybox,
- "pgrep": Toybox,
- "pkill": Toybox,
- "ps": Toybox,
- "pwd": Toybox,
- "readlink": Toybox,
- "rm": Toybox,
- "rmdir": Toybox,
- "setsid": Toybox,
- "sha1sum": Toybox,
- "sha256sum": Toybox,
- "sha512sum": Toybox,
- "sleep": Toybox,
- "sort": Toybox,
- "stat": Toybox,
- "tail": Toybox,
- "tee": Toybox,
- "touch": Toybox,
- "true": Toybox,
- "uname": Toybox,
- "uniq": Toybox,
- "unix2dos": Toybox,
- "wc": Toybox,
- "whoami": Toybox,
- "which": Toybox,
- "xargs": Toybox,
- "xxd": Toybox,
+ "basename": LinuxOnlyPrebuilt,
+ "cat": LinuxOnlyPrebuilt,
+ "chmod": LinuxOnlyPrebuilt,
+ "cmp": LinuxOnlyPrebuilt,
+ "cp": LinuxOnlyPrebuilt,
+ "comm": LinuxOnlyPrebuilt,
+ "cut": LinuxOnlyPrebuilt,
+ "dirname": LinuxOnlyPrebuilt,
+ "du": LinuxOnlyPrebuilt,
+ "echo": LinuxOnlyPrebuilt,
+ "env": LinuxOnlyPrebuilt,
+ "expr": LinuxOnlyPrebuilt,
+ "head": LinuxOnlyPrebuilt,
+ "getconf": LinuxOnlyPrebuilt,
+ "hostname": LinuxOnlyPrebuilt,
+ "id": LinuxOnlyPrebuilt,
+ "ln": LinuxOnlyPrebuilt,
+ "ls": LinuxOnlyPrebuilt,
+ "md5sum": LinuxOnlyPrebuilt,
+ "mkdir": LinuxOnlyPrebuilt,
+ "mktemp": LinuxOnlyPrebuilt,
+ "mv": LinuxOnlyPrebuilt,
+ "od": LinuxOnlyPrebuilt,
+ "paste": LinuxOnlyPrebuilt,
+ "pgrep": LinuxOnlyPrebuilt,
+ "pkill": LinuxOnlyPrebuilt,
+ "ps": LinuxOnlyPrebuilt,
+ "pwd": LinuxOnlyPrebuilt,
+ "readlink": LinuxOnlyPrebuilt,
+ "rm": LinuxOnlyPrebuilt,
+ "rmdir": LinuxOnlyPrebuilt,
+ "setsid": LinuxOnlyPrebuilt,
+ "sha1sum": LinuxOnlyPrebuilt,
+ "sha256sum": LinuxOnlyPrebuilt,
+ "sha512sum": LinuxOnlyPrebuilt,
+ "sleep": LinuxOnlyPrebuilt,
+ "sort": LinuxOnlyPrebuilt,
+ "stat": LinuxOnlyPrebuilt,
+ "tail": LinuxOnlyPrebuilt,
+ "tee": LinuxOnlyPrebuilt,
+ "touch": LinuxOnlyPrebuilt,
+ "true": LinuxOnlyPrebuilt,
+ "uname": LinuxOnlyPrebuilt,
+ "uniq": LinuxOnlyPrebuilt,
+ "unix2dos": LinuxOnlyPrebuilt,
+ "wc": LinuxOnlyPrebuilt,
+ "whoami": LinuxOnlyPrebuilt,
+ "which": LinuxOnlyPrebuilt,
+ "xargs": LinuxOnlyPrebuilt,
+ "xxd": LinuxOnlyPrebuilt,
}
func init() {
@@ -185,10 +187,10 @@ func init() {
Configuration["sw_vers"] = Allowed
Configuration["xcrun"] = Allowed
- // We don't have toybox prebuilts for darwin, so allow the
- // host versions.
+ // We don't have darwin prebuilts for some tools (like toybox),
+ // so allow the host versions.
for name, config := range Configuration {
- if config.Toybox {
+ if config.LinuxOnlyPrebuilt {
Configuration[name] = Allowed
}
}