Merge "Add the ability to source RBE related scripts from envsetup.sh" am: 10935cf315 am: 85382dcfec am: 955e561ffa am: 1023e9f615

Original change: https://android-review.googlesource.com/c/platform/build/+/1763565

Change-Id: I2bd1d35db99b204e4bb406609b0d0fbc33b03f2c
This commit is contained in:
Treehugger Robot
2021-07-13 21:15:15 +00:00
committed by Automerger Merge Worker
2 changed files with 15 additions and 2 deletions

View File

@@ -1875,6 +1875,16 @@ function showcommands() {
fi
}
# Source necessary setup scripts needed to run the build with Remote Execution.
function source_rbe() {
local T=$(gettop)
if [[ "x$USE_RBE" != "x" && "$USE_RBE" != "false" ]]; then
. $T/make/rbesetup.sh --skip-envsetup
fi
}
validate_current_shell
source_vendorsetup
source_rbe
addcompletions

View File

@@ -24,8 +24,11 @@ function _source_env_setup_script() {
}
# This function needs to run first as the remaining defining functions may be
# using the envsetup.sh defined functions.
_source_env_setup_script || return
# using the envsetup.sh defined functions. Skip this part if this script is already
# being invoked from envsetup.sh.
if [[ "$1" != "--skip-envsetup" ]]; then
_source_env_setup_script || return
fi
# This function prefixes the given command with appropriate variables needed
# for the build to be executed with RBE.