commit | 798080b0f3e1964fe6f6340333265b5cfbb36984 | [log] [tgz] |
---|---|---|
author | Kousik Kumar <kousikk@google.com> | Thu Sep 28 17:46:59 2023 +0000 |
committer | Kousik Kumar <kousikk@google.com> | Thu Sep 28 17:46:59 2023 +0000 |
tree | 14a4dfb41ff06d2da8b77fb488b751fc9061c051 | |
parent | 19cd806de1dbf4889f097b2b9b0f3c3b36a2e053 [diff] |
Copy reclient binaries into the out directory itself This is to avoid the problem of multiple source commands / builds run in parallel overwriting the binaries in the reclient dir. TESTED=ran concurrent builds, ensured binaries weren't being overwritten. Bug: b/302378775 NOTE FOR REVIEWERS - original patch and result patch are not identical. PLEASE REVIEW CAREFULLY. Diffs between the patches: fi + local RECLIENT_VERSION=`readlink prebuilts/remoteexecution-client/live` + + local NONCOG_RECLIENT_BIN_DIR_BASE="${OUT_DIR}/.reclient" + local NONCOG_RECLIENT_BIN_DIR="${NONCOG_RECLIENT_BIN_DIR_BASE}/${RECLIENT_VERSION}" + if [ -d "${NONCOG_RECLIENT_BIN_DIR}" ]; then + if [ `ls ${NONCOG_RECLIENT_BIN_DIR} | wc -l` -gt 1 ] ; then + # binaries already exist, only update the symlink to ensure correct + # reclient version is set. + ln -sf ${RECLIENT_VERSION} ${NONCOG_RECLIENT_BIN_DIR_BASE}/live + return + fi + # Create the non cog directory and copy binaries into it. + mkdir -p ${NONCOG_RECLIENT_BIN_DIR} - - # Copy the binaries out of live. - cp $TOP/prebuilts/remoteexecution-client/live/* $NONCOG_RECLIENT_BIN_DIR + cp ${TOP}/prebuilts/remoteexecution-client/live/* ${NONCOG_RECLIENT_BIN_DIR} + ln -sf ${RECLIENT_VERSION} ${NONCOG_RECLIENT_BIN_DIR_BASE}/live - export RBE_DIR=$NONCOG_RECLIENT_BIN_DIR + export RBE_DIR="${NONCOG_RECLIENT_BIN_DIR_BASE}/live" Original patch: diff a/cogsetup.sh b/cogsetup.sh --- a/cogsetup.sh +++ b/cogsetup.sh @@ -39,22 +39,30 @@ # non-cog part of the overall filesystem. This is to workaround the problem # described in b/289391270. function _copy_reclient_binaries_from_cog() { - local NONCOG_RECLIENT_BIN_DIR="${HOME}/.cog/reclient/bin" - if [ ! -d "$NONCOG_RECLIENT_BIN_DIR" ]; then - # Create the non cog directory if it doesn't exist. - mkdir -p ${NONCOG_RECLIENT_BIN_DIR} - else - # Clear out the non cog directory if it does exist. - rm -f ${NONCOG_RECLIENT_BIN_DIR}/* + if [[ "${OUT_DIR}" == "" ]]; then + OUT_DIR="out" fi + local RECLIENT_VERSION=`readlink prebuilts/remoteexecution-client/live` - local TOP=$(gettop) + local NONCOG_RECLIENT_BIN_DIR_BASE="${OUT_DIR}/.reclient" + local NONCOG_RECLIENT_BIN_DIR="${NONCOG_RECLIENT_BIN_DIR_BASE}/${RECLIENT_VERSION}" + if [ -d "${NONCOG_RECLIENT_BIN_DIR}" ]; then + if [ `ls ${NONCOG_RECLIENT_BIN_DIR} | wc -l` -gt 1 ] ; then + # binaries already exist, only update t Change-Id: Ia6cb7faae6366ee7491fcf91777318b772a3ba88
This is the Makefile-based portion of the Android Build System.
For documentation on how to run a build, see Usage.txt
For a list of behavioral changes useful for Android.mk writers see Changes.md
For an outdated reference on Android.mk files, see build-system.html. Our Android.mk files look similar, but are entirely different from the Android.mk files used by the NDK build system. When searching for documentation elsewhere, ensure that it is for the platform build system -- most are not.
This Makefile-based system is in the process of being replaced with Soong, a new build system written in Go. During the transition, all of these makefiles are read by Kati, and generate a ninja file instead of being executed directly. That's combined with a ninja file read by Soong so that the build graph of the two systems can be combined and run as one.