diff --git a/examples/common/QRCode/repo b/examples/common/QRCode/repo index 8cbd1f506ac594..455e0b24272f16 160000 --- a/examples/common/QRCode/repo +++ b/examples/common/QRCode/repo @@ -1 +1 @@ -Subproject commit 8cbd1f506ac59406b18d13a199187c2756f2e06f +Subproject commit 455e0b24272f164cfc1b2a1b47fe3903b821dc39 diff --git a/scripts/activate.sh b/scripts/activate.sh deleted file mode 100644 index 84a9fd73243eac..00000000000000 --- a/scripts/activate.sh +++ /dev/null @@ -1,35 +0,0 @@ -# -# Copyright (c) 2020 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -if [[ -n ${BASH_SOURCE[0]} ]]; then - CHIP_ROOT=$(cd "${BASH_SOURCE[0]%/*}/.." && pwd) -else - CHIP_ROOT=$(cd "${0%/*}/.." && pwd) -fi - -export PW_BRANDING_BANNER="$CHIP_ROOT/.chip-banner.txt" -export PW_BRANDING_BANNER_COLOR="bold_white" -export PW_VIRTUALENV_REQUIREMENTS="$CHIP_ROOT/scripts/requirements.txt" - -export PW_VIRTUALENV_SETUP_PY_ROOTS="$CHIP_ROOT/integrations/mobly" - -# shellcheck source=/dev/null -source "$CHIP_ROOT/third_party/pigweed/repo/activate.sh" - -#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 diff --git a/scripts/activate.sh b/scripts/activate.sh new file mode 120000 index 00000000000000..eba538975a899f --- /dev/null +++ b/scripts/activate.sh @@ -0,0 +1 @@ +bootstrap.sh \ No newline at end of file diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 497e2fb614396d..c899dbba6ae20e 100644 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -14,10 +14,18 @@ # limitations under the License. # +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 + 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 export PW_BRANDING_BANNER="$CHIP_ROOT/.chip-banner.txt" @@ -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 diff --git a/src/darwin/Framework/chip_xcode_build_connector.sh b/src/darwin/Framework/chip_xcode_build_connector.sh index c3b0c1adb331b7..2cadbf04fdcaa7 100755 --- a/src/darwin/Framework/chip_xcode_build_connector.sh +++ b/src/darwin/Framework/chip_xcode_build_connector.sh @@ -118,15 +118,17 @@ 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 + # 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