Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Merge "Copy reclient binaries into the out directory itself" into main
Browse files Browse the repository at this point in the history
  • Loading branch information
gkousik authored and Gerrit Code Review committed Oct 1, 2023
2 parents 517308b + 798080b commit 0d9b3a9
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions cogsetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,25 @@ function _create_out_symlink_for_cog() {
# 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}"

# Copy the binaries out of live.
cp $TOP/prebuilts/remoteexecution-client/live/* $NONCOG_RECLIENT_BIN_DIR
# Create the non cog directory and setup live symlink.
mkdir -p ${NONCOG_RECLIENT_BIN_DIR}

if [ `ls ${NONCOG_RECLIENT_BIN_DIR} | wc -l` -lt 8 ]; then
# Not all binaries exist, copy them from the Cog directory.
local TOP=$(gettop)
cp ${TOP}/prebuilts/remoteexecution-client/live/* ${NONCOG_RECLIENT_BIN_DIR}
fi

# Finally set the RBE_DIR env var to point to the out-of-cog directory.
export RBE_DIR=$NONCOG_RECLIENT_BIN_DIR
ln -sfn ${RECLIENT_VERSION} ${NONCOG_RECLIENT_BIN_DIR_BASE}/live
export RBE_DIR="${NONCOG_RECLIENT_BIN_DIR_BASE}/live"
}

# This function sets up the build environment to be appropriate for Cog.
Expand Down

0 comments on commit 0d9b3a9

Please sign in to comment.