aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2018-12-04 13:06:02 -0800
committerDan Willemsen <dwillemsen@google.com>2018-12-04 13:06:02 -0800
commit83f97aed9549de6d15b5609bac92970fc591d204 (patch)
tree92316e04630efea3e764e2a3368f9d5b8cc4d9ef /python
parentce16f3bac8ed6719a52cfa77463b8df78ad0c7b5 (diff)
downloadbuild_soong-83f97aed9549de6d15b5609bac92970fc591d204.tar.gz
build_soong-83f97aed9549de6d15b5609bac92970fc591d204.tar.bz2
build_soong-83f97aed9549de6d15b5609bac92970fc591d204.zip
Fix mac build w/echo -n
Soong doesn't wrap everything in bash, but relies on the ninja default of /bin/sh. We should probably improve that in the future, but for now, just fix the build. On Mac, /bin/sh and /bin/bash are both bash, but /bin/sh implies `set -o posix`, and ignores the `-n` flag. Test: treehugger Test: build on a mac Change-Id: Icf41b1c5a1ce9eb0a56e39e68c433fc80b53620f
Diffstat (limited to 'python')
-rw-r--r--python/builder.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/python/builder.go b/python/builder.go
index 7ecd4b5e..cbbe56e4 100644
--- a/python/builder.go
+++ b/python/builder.go
@@ -54,8 +54,10 @@ var (
embeddedPar = pctx.AndroidStaticRule("embeddedPar",
blueprint.RuleParams{
- // `echo -n` to trim the newline, since the python code just wants the name
- Command: `echo -n '$main' > $entryPoint &&` +
+ // `echo -n` to trim the newline, since the python code just wants the name.
+ // /bin/sh (used by ninja) on Mac turns off posix mode, and stops supporting -n.
+ // Explicitly use bash instead.
+ Command: `/bin/bash -c "echo -n '$main' > $entryPoint" &&` +
`$mergeParCmd -p --prefix $launcher -e $entryPoint $out $srcsZips && ` +
`chmod +x $out && (rm -f $entryPoint)`,
CommandDeps: []string{"$mergeParCmd"},