diff options
author | Will Drewry <wad@chromium.org> | 2015-11-15 22:53:10 -0600 |
---|---|---|
committer | Will Drewry <drewry@google.com> | 2015-11-15 21:08:09 -0800 |
commit | a47593ddeb0036d32edd0306e0be279954618370 (patch) | |
tree | 7edf4f24a9c6da221fc66b3b106beb260b7478ad | |
parent | 50e50ee424cfc82cdeedb0b76f0b851090242565 (diff) | |
download | bdk-a47593ddeb0036d32edd0306e0be279954618370.tar.gz |
wrap-common.mk: blind calls to make in envsetup.sh
envsetup.sh uses the build/ system to query the target
product for configuration. When envsetup.sh invokes
make from within a make call, side effects can result
in extremely huge environment variable values.
This change blinds the nested calls to make by unsetting
the relevant GNU Make related environment variables.
Any required variables, like MAKEFLAGS, must be added to
the final make call.
BUG=25369115
TEST=m -p doesn't fail with Argument list too long. And running strace over the buiuld flow doesn't turn up E2BIGs coming back on exec.
Change-Id: Ia4813ab3e4318085349443a137e75140c3e52d38
-rw-r--r-- | build/wrap-common.mk | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/build/wrap-common.mk b/build/wrap-common.mk index db9c614..7a539b0 100644 --- a/build/wrap-common.mk +++ b/build/wrap-common.mk @@ -111,10 +111,11 @@ endef # TODO(wad) Make tee optional define build-product $(Q)(cd "$(2)" && \ + unset MAKEFLAGS MAKEOVERRIDES MAKECMDGOALS MAKELEVEL && \ . build/envsetup.sh && \ add_lunch_combo "$(3)-$(6)" && \ lunch "$(3)-$(6)" && \ - PATH=$(2)/java/bin:$$PATH $(MAKE) $(MAKECMDGOALS) "OUT_DIR=$(5)/out-$(4)" KATI_EMULATE_FIND=false || \ + MAKEFLAGS="$(MAKEFLAGS)" PATH=$(2)/java/bin:$$PATH $(MAKE) $(MAKECMDGOALS) "OUT_DIR=$(5)/out-$(4)" KATI_EMULATE_FIND=false || \ exit $?) 2>&1 | tee "$(5)/last_build.log" endef @@ -126,6 +127,7 @@ endef define build-product-here $(Q)echo "Building in subtree $(7) . . ." $(Q)(cd "$(2)" && \ + unset MAKEFLAGS MAKEOVERRIDES MAKECMDGOALS MAKELEVEL && \ . build/envsetup.sh && \ add_lunch_combo "$(3)-$(6)" && \ lunch "$(3)-$(6)" && \ |