build/core/config.mk:60: /pathmap.mk: No such file or directorybuild/core/config.mk:151: /envsetup.mk: No such file or directorybuild/core/config.mk:215: *** No TARGET_CPU_ABI defined by board config: . Stop.
Removing iTerm2 integration from the bash_profile fixes the issue.
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
Still seen on the latest nightlies - I tried to debug and I believe the preexec may be interfering with the android envsetup but I couldn't get any further
Sounds possible. OMZ ran in to a similar issue with a chpwd hook issuing terminal control commands that were screwing up Android build tools by contaminating captured shell function output.
A good approach might be to defensively use [ -t 1 ] to check whether stdout is actually attached to a tty before outputting the control sequences. Or write them directly to /dev/tty instead of to standard out.
Sorry I haven't gotten a chance to look into this more--it's super time consuming to get the environment set up to repro this bug so other things keep taking priority. Does does @apjanke 's trick work? Modify your .bashrc to say
test -t 1 && source ~/.iterm2_shell_integration.bash
From what I recall, some AOSP stuff is implemented as functions to be run inside an interactive shell, not in subshells. So the [ -t 1 ] guard would need to be pushed down in to the integration functions which are producing the output that AOSP doesn't like.
diff --git a/iterm2_shell_integration.bash b/iterm2_shell_integration.bashindex 1e72696..75c88c9 100644--- a/iterm2_shell_integration.bash+++ b/iterm2_shell_integration.bash@@ -45,6 +45,7 @@ if ( [ x"$TERM" != xscreen ] ); then # was just displayed, to allow the DEBUG trap, below, to know that the next # command is likely interactive. function iterm2_preexec_invoke_cmd () {+ [[ -t 1 ]] || return local s=$? last_hist_ent="$(history 1)"; precmd;@@ -158,6 +159,7 @@ if ( [ x"$TERM" != xscreen ] ); then # Execute this to set up preexec and precmd execution. function iterm2_preexec_install () {+ [[ -t 1 ]] || return # *BOTH* of these options need to be set for the DEBUG trap to be invoked # in ( ) subshells. This smells like a bug in bash to me. The null stackederr@@ -190,12 +192,14 @@ if ( [ x"$TERM" != xscreen ] ); then # Runs after interactively edited command but before execution function preexec() {+ [[ -t 1 ]] || return iterm2_begin_osc printf "133;C" iterm2_end_osc } function iterm2_print_state_data() {+ [[ -t 1 ]] || return iterm2_begin_osc printf "1337;RemoteHost=%s@%s" "$USER" "$iterm2_hostname" iterm2_end_osc@@ -209,6 +213,7 @@ if ( [ x"$TERM" != xscreen ] ); then # Usage: iterm2_set_user_var key value function iterm2_set_user_var() {+ [[ -t 1 ]] || return iterm2_begin_osc printf "1337;SetUserVar=%s=%s" "$1" $(printf "%s" "$2" | base64) iterm2_end_osc@@ -221,6 +226,7 @@ if ( [ x"$TERM" != xscreen ] ); then } function iterm2_prompt_prefix() {+ [[ -t 1 ]] || return iterm2_begin_osc printf "133;D;\$?" iterm2_end_osc@@ -233,12 +239,14 @@ if ( [ x"$TERM" != xscreen ] ); then } function iterm2_prompt_suffix() {+ [[ -t 1 ]] || return iterm2_begin_osc printf "133;B" iterm2_end_osc } function iterm2_print_version_number() {+ [[ -t 1 ]] || return iterm2_begin_osc printf "1337;ShellIntegrationVersion=1" iterm2_end_osc
Tried that too - it didn't work since I'm sourcing shell integration when starting the bash session, then trying to setup the android build environment. Once it has been sourced, it will no longer allow me to run "lunch" from the android build environment functions.
I have it down to a simple reproducible case, but I'm not sure how to fix it.
echo 'echo $BUILD_SYSTEM' > pchmod +x p# Note that this prints "build/core"BUILD_SYSTEM=build/core command ./p# Install a trap. This changes the environment that p sees.trap 'george "$_"' DEBUG;function george { true}BUILD_SYSTEM=build/core command ./p
Might be worth mentioning that it is very isolated problem in Android build and until the bash-preexec problem is fixed, there is an easy workaround. The below patch in build of Android build fixes the issue iterm2_shell_integration.patch