Skip to content

Commit

Permalink
* merge activate and bootstrap
Browse files Browse the repository at this point in the history
* run activate in an external env from the Xcode connector
* fix pip install nits
  • Loading branch information
Rob Walker committed Oct 20, 2020
1 parent 4f1e854 commit c18a9d8
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 53 deletions.
2 changes: 1 addition & 1 deletion examples/common/QRCode/repo
35 changes: 0 additions & 35 deletions scripts/activate.sh

This file was deleted.

1 change: 1 addition & 0 deletions scripts/activate.sh
18 changes: 14 additions & 4 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@
#

if [[ -n ${BASH_SOURCE[0]} ]]; then
CHIP_ROOT=$(cd "${BASH_SOURCE[0]%/*}/.." && pwd)
me=${BASH_SOURCE[0]##*/}
else
CHIP_ROOT=$(cd "${0%/*}/.." && pwd)
me=${0##*/}
fi

if [[ ! -d ${CHIP_ROOT} ]]; then
if [[ -n ${BASH_SOURCE[0]} ]]; then
CHIP_ROOT=$(cd "${BASH_SOURCE[0]%/*}/.." && pwd)
else
CHIP_ROOT=$(cd "${0%/*}/.." && pwd)
fi
fi

export PW_BRANDING_BANNER="$CHIP_ROOT/.chip-banner.txt"
Expand All @@ -32,10 +40,12 @@ git submodule update --init

export PW_VIRTUALENV_SETUP_PY_ROOTS="$CHIP_ROOT/integrations/mobly"

export PATH # https://bugs.chromium.org/p/pigweed/issues/detail?id=281

# shellcheck source=/dev/null
source "$CHIP_ROOT/third_party/pigweed/repo/bootstrap.sh"
source "$CHIP_ROOT/third_party/pigweed/repo/$me"

#TODO - remove this once native python building is solved for
# psutil (one of mobly's dependencies which CHIP does
# not actually need, so --no-deps is OK)
pip install --no-deps portpicker mobly
pip install --quiet --upgrade --no-deps portpicker mobly
15 changes: 9 additions & 6 deletions src/darwin/Framework/chip_xcode_build_connector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,18 @@ updirs() {
(
cd "$CHIP_ROOT" # pushd and popd because we need the env vars from activate

ENV=$(updirs chip_xcode_build_connector_env.sh)
[[ -n $ENV ]] && . "$ENV"
if ENV=$(updirs chip_xcode_build_connector_env.sh 2>/dev/null);
then
. "$ENV"
fi

[[ -n $CHIP_NO_SUBMODULES ]] || git submodule update --init
if [[ -z $CHIP_NO_ACTIVATE ]]; then
if [[ -z $CHIP_NO_BOOTSTRAP ]]; then
# first run bootstrap in an external env to build everything
env -i PW_ENVSETUP_NO_BANNER=1 PW_ENVSETUP_QUIET=1 bash -c '. scripts/activate.sh'
set +ex
echo PW_ENVSETUP_QUIET=1 . scripts/activate.sh >&2
PW_ENVSETUP_QUIET=1 . scripts/activate.sh
(($? != 0)) && echo "Please source $CHIP_ROOT/scripts/bootstrap.sh before building" && exit 1
# now source activate for env vars
PW_ENVSETUP_NO_BANNER=1 PW_ENVSETUP_QUIET=1 . scripts/activate.sh
set -ex
fi

Expand Down
2 changes: 1 addition & 1 deletion third_party/bluez/repo
Submodule repo updated from e8f8a5 to b8c156
2 changes: 1 addition & 1 deletion third_party/cirque/repo
Submodule repo updated 3 files
+0 −0 BUILD
+1 −5 cirque/common/utils.py
+1 −1 version
2 changes: 1 addition & 1 deletion third_party/ot-br-posix/repo
2 changes: 1 addition & 1 deletion third_party/qpg_sdk/repo
Submodule repo updated from d99de2 to e1214f

0 comments on commit c18a9d8

Please sign in to comment.