Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83f97aed authored by Dan Willemsen's avatar Dan Willemsen
Browse files

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
parent ce16f3ba
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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"},