Skip to content

Commit

Permalink
Add bootstrap variant that skips CIPD (#5344)
Browse files Browse the repository at this point in the history
* Update Pigweed submodule

git -C third_party/pigweed/repo log bbe291b3..c02188cf6

* Switch bootstrap to use config file

* Allow bootstrapping without CIPD

To bootstrap without CIPD use '. scripts/no_cipd_bootstrap.sh'.

Co-authored-by: Michael Spang <spang@google.com>
  • Loading branch information
mohrr and mspang authored Apr 10, 2021
1 parent a369e89 commit 5cda0bd
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 13 deletions.
1 change: 1 addition & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
"$dir_pw_unit_test/py",
"$dir_pw_watch/py",
"integrations/mobly:chip_mobly",
"scripts:requirements",
"third_party/happy",
]
}
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ include(${PIGWEED_ROOT}/pw_protobuf_compiler/proto.cmake)
pw_set_backend(pw_log pw_log_basic)
pw_set_backend(pw_assert pw_assert_log)
pw_set_backend(pw_sys_io pw_sys_io.nrfconnect)
set(dir_pw_third_party_nanopb PRESENT CACHE STRING ${CHIP_ROOT}/third_party/nanopb/repo FORCE)
set(dir_pw_third_party_nanopb "${CHIP_ROOT}/third_party/nanopb/repo" CACHE STRING "" FORCE)

add_subdirectory(third_party/connectedhomeip/examples/platform/nrfconnect/pw_sys_io)
add_subdirectory(third_party/connectedhomeip/third_party/nanopb/repo)
Expand Down
4 changes: 3 additions & 1 deletion examples/pigweed-app/esp32/main/component.mk
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ COMPONENT_ADD_INCLUDEDIRS += ../third_party/connectedhomeip/third_party/pigweed/
../../../platform/esp32 \
../../../common/pigweed \
../../../common/pigweed/esp32 \
../build/chip/gen/third_party/connectedhomeip/third_party/pigweed/repo/pw_rpc/protos \
../build/chip/gen/third_party/connectedhomeip/third_party/pigweed/repo/pw_rpc/protos.proto_library/nanopb_rpc \
../build/chip/gen/third_party/connectedhomeip/third_party/pigweed/repo/pw_rpc/protos.proto_library/nanopb \
../build/chip/gen/third_party/connectedhomeip/third_party/pigweed/repo/pw_rpc/protos.proto_library/pwpb \
../../../../src/lib/support \

COMPONENT_EXTRA_INCLUDES := ${IDF_PATH}/components/freertos/include/freertos/ \
Expand Down
2 changes: 1 addition & 1 deletion examples/pigweed-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ include(${PIGWEED_ROOT}/pw_protobuf_compiler/proto.cmake)
pw_set_backend(pw_log pw_log_basic)
pw_set_backend(pw_assert pw_assert_log)
pw_set_backend(pw_sys_io pw_sys_io.nrfconnect)
set(dir_pw_third_party_nanopb PRESENT CACHE STRING ${CHIP_ROOT}/third_party/nanopb/repo FORCE)
set(dir_pw_third_party_nanopb "${CHIP_ROOT}/third_party/nanopb/repo" CACHE STRING "" FORCE)

add_subdirectory(third_party/connectedhomeip/examples/platform/nrfconnect/pw_sys_io)
add_subdirectory(third_party/connectedhomeip/third_party/nanopb/repo)
Expand Down
21 changes: 21 additions & 0 deletions scripts/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) 2021 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.

import("//build_overrides/pigweed.gni")

import("$dir_pw_build/python.gni")

pw_python_requirements("requirements") {
files = [ "requirements.txt" ]
}
11 changes: 8 additions & 3 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ _bootstrap_or_activate() {
local _BOOTSTRAP_NAME="${_BOOTSTRAP_PATH##*/}"
local _CHIP_ROOT="$(cd "${_BOOTSTRAP_PATH%/*}/.." && pwd)"

local _CONFIG_FILE="scripts/environment.json"

if [ "$_BOOTSTRAP_NAME" = "no_cipd_bootstrap.sh" ]; then
_CONFIG_FILE="scripts/environment_no_cipd.json"
_BOOTSTRAP_NAME="bootstrap.sh"
fi

if [ "$_BOOTSTRAP_NAME" = "bootstrap.sh" ] ||
[ ! -f "$_CHIP_ROOT/third_party/pigweed/repo/pw_env_setup/util.sh" ]; then
git submodule update --init
Expand Down Expand Up @@ -66,9 +73,7 @@ EOF
[ ! -s "$_SETUP_SH" ]; then
pw_bootstrap --shell-file "$_SETUP_SH" \
--install-dir "$_PW_ACTUAL_ENVIRONMENT_ROOT" \
--virtualenv-requirements "$_CHIP_ROOT/scripts/requirements.txt" \
--cipd-package-file "$_CHIP_ROOT/scripts/pigweed.json" \
--virtualenv-gn-target "$_CHIP_ROOT#:python_packages.install"
--config-file "$_CHIP_ROOT/$_CONFIG_FILE"
pw_finalize bootstrap "$_SETUP_SH"
else
pw_activate
Expand Down
7 changes: 7 additions & 0 deletions scripts/environment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"cipd_package_files": ["scripts/pigweed.json"],
"virtualenv": {
"gn_root": ".",
"gn_targets": [":python_packages.install"]
}
}
6 changes: 6 additions & 0 deletions scripts/environment_no_cipd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"virtualenv": {
"gn_root": ".",
"gn_targets": [":python_packages.install"]
}
}
1 change: 1 addition & 0 deletions scripts/no_cipd_bootstrap.sh
16 changes: 10 additions & 6 deletions scripts/pigweed.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"path": "gn/gn/${os}-${arch=amd64,arm64}",
"tags": ["git_revision:d7cf6238e07f87b51118f9823a1ec024c1f1932b"]
"tags": ["git_revision:64b3b9401c1c3ed5f3c43c1cac00b91f83597ab8"]
},
{
"path": "infra/ninja/${os}-${arch=amd64}",
Expand All @@ -13,8 +13,8 @@
},
{
"_comment": "TODO(pwbug/93): Package Bazel for Windows.",
"path": "pigweed/third_party/bazel/${os=linux,mac}-${arch=amd64}",
"tags": ["version:3.2.0"]
"path": "fuchsia/third_party/bazel/${os=linux,mac}-${arch=amd64}",
"tags": ["version:4.0.0"]
},
{
"path": "pigweed/third_party/bloaty-embedded/${os=linux,mac}-${arch=amd64}",
Expand Down Expand Up @@ -62,11 +62,11 @@
},
{
"path": "pigweed/host_tools/${os}-${arch=amd64}",
"tags": ["git_revision:01145c97424e9158fd9b96b957176de4bb7e8f0c"]
"tags": ["git_revision:2f56efcee3192685898200f6049538ebd809ae36"]
},
{
"path": "infra/goma/client/${os}-${arch=amd64}",
"tags": ["git_revision:be1b7f4547023e809b636dc9572c976ccb33dcac"]
"path": "infra/rbe/client/${os=linux,windows}-${arch=amd64}",
"tags": ["git_revision:3b3042c16accd40f0d3f7e40002f9ad2099cfe94"]
},
{
"path": "fuchsia/third_party/qemu/${os=linux,mac}-${arch}",
Expand All @@ -81,5 +81,9 @@
"path": "fuchsia/third_party/kythe-libs/${os=linux}-${arch=amd64}",
"subdir": "kythe",
"tags": ["version:2020-08-05"]
},
{
"path": "infra/3pp/tools/renode/${os=linux}-${arch=amd64}",
"tags": ["version:2@renode-1.11.0+20210306gite7897c1"]
}
]
2 changes: 1 addition & 1 deletion third_party/pigweed/repo
Submodule repo updated 462 files

0 comments on commit 5cda0bd

Please sign in to comment.