Skip to content

Commit

Permalink
Roll up third_party/pigweed/repo to ToT
Browse files Browse the repository at this point in the history
  • Loading branch information
szatmz committed Nov 30, 2020
1 parent f99ac87 commit c87ab64
Show file tree
Hide file tree
Showing 18 changed files with 77 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
# Build System
out/

# Environment directory
.environment/

# Temporary Directories
.tmp/

Expand Down
9 changes: 9 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import("//build_overrides/nlassert.gni")
import("//build_overrides/nlio.gni")
import("//build_overrides/nlunit_test.gni")
import("//build_overrides/pigweed.gni")
import("$dir_pw_build/python.gni")

# This build file should not be used in superproject builds.
assert(chip_root == "//")
Expand All @@ -32,6 +33,14 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
(host_cpu == "x64" || host_cpu == "arm64")
}

# Python packages for supporting specific targets.
pw_python_group("python_packages") {
python_deps = [
"integrations/mobly/py",
"third_party/happy",
]
}

# This is a real toolchain. Build CHIP.
group("default") {
deps = [ ":all" ]
Expand Down
3 changes: 2 additions & 1 deletion build/chip/chip_test.gni
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import("//build_overrides/chip.gni")
import("//build_overrides/pigweed.gni")
import("$dir_pw_build/python_action.gni")

import("${chip_root}/build/chip/tests.gni")
import("${chip_root}/src/platform/device.gni")
Expand All @@ -35,7 +36,7 @@ if (chip_link_tests) {
output_dir = _test_output_dir
}

pw_python_script(_test_name + "_run") {
pw_python_action(_test_name + "_run") {
deps = [ ":${_test_name}" ]
inputs = [ pw_unit_test_AUTOMATIC_RUNNER ]
script = "$dir_pw_unit_test/py/pw_unit_test/test_runner.py"
Expand Down
File renamed without changes.
25 changes: 25 additions & 0 deletions integrations/mobly/py/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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.

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

import("$dir_pw_build/python.gni")

pw_python_package("py") {
setup = [ "setup.py" ]
sources = [
"chip_mobly/__init__.py",
"chip_mobly/pigweed_device.py",
]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 6 additions & 2 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ _bootstrap_or_activate() {
EOF
)"

PW_PROJECT_ROOT="$_CHIP_ROOT"
export PW_PROJECT_ROOT

PW_ROOT="$_CHIP_ROOT/third_party/pigweed/repo"
export PW_ROOT

Expand All @@ -65,8 +68,9 @@ EOF
--install-dir "$_PW_ACTUAL_ENVIRONMENT_ROOT" \
--virtualenv-requirements "$_CHIP_ROOT/scripts/requirements.txt" \
--cipd-package-file "$_CHIP_ROOT/scripts/pigweed.json" \
--virtualenv-setup-py-root "$_CHIP_ROOT/third_party/pigweed" \
--virtualenv-setup-py-root "$_CHIP_ROOT/integrations/mobly"
--virtualenv-gn-target "$PW_ROOT#:target_support_packages.install" \
--virtualenv-gn-target "$PW_ROOT#:python.install" \
--virtualenv-gn-target "$_CHIP_ROOT#:python_packages.install"
pw_finalize bootstrap "$_SETUP_SH"
else
pw_activate
Expand Down
3 changes: 3 additions & 0 deletions scripts/examples/nrfconnect_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
# limitations under the License.
#

# Run bootstrap to set up e.g. Pigweed correctly
source "$(dirname "$0")/../../scripts/bootstrap.sh"

cd "$(dirname "$0")/../../examples"

APP="$1"
Expand Down
4 changes: 4 additions & 0 deletions scripts/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ mobly

# zephyr
west>=0.8.0

# happy tests
lockfile
psutil >= 5.7.3
3 changes: 2 additions & 1 deletion scripts/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ cryptography==3.2.1 # via -r requirements.in
docopt==0.6.2 # via pykwalify
future==0.18.2 # via -r requirements.in, mobly
idna==2.10 # via requests
lockfile==0.12.2 # via -r requirements.in
mobly==1.10 # via -r requirements.in
packaging==20.4 # via west
pip-tools==5.3.1 # via -r requirements.in
portpicker==1.3.1 # via -r requirements.in, mobly
psutil==5.7.2 # via mobly
psutil==5.7.3 # via -r requirements.in, mobly
pycparser==2.20 # via cffi
pyelftools==0.26 # via -r requirements.in
pykwalify==1.7.0 # via west
Expand Down
4 changes: 0 additions & 4 deletions scripts/tests/happy_test_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@
args = parser.parse_args()
# GN will run Python in venv, which will break happy test
if args.ci:
if test_environ.get("VIRTUAL_ENV", None) != None:
del test_environ["VIRTUAL_ENV"]
test_environ["PATH"] = ":".join([s for s in test_environ.get(
"PATH", "").split(":") if not os.path.realpath(s).startswith(os.path.realpath(os.path.join(CHIP_PATH, "third_party/pigweed/repo")))])
test_environ["HAPPY_LOG_DIR"] = "/tmp/happy_test_logs"
test_environ["TEST_BIN_DIR"] = args.bin_dir
test_environ["HAPPY_MAIN_CONFIG_FILE"] = os.path.realpath(
Expand Down
3 changes: 2 additions & 1 deletion src/controller/python/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import("//build_overrides/chip.gni")
import("//build_overrides/pigweed.gni")
import("$dir_pw_build/python.gni")

import("${chip_root}/build/chip/tools.gni")
import("${dir_pw_unit_test}/test.gni")
Expand Down Expand Up @@ -54,7 +55,7 @@ shared_library("ChipDeviceCtrl") {
configs += [ ":controller_wno_deprecate" ]
}

pw_python_script("python") {
pw_python_action("python") {
script = "build-chip-wheel.py"

_py_manifest_files = [
Expand Down
20 changes: 20 additions & 0 deletions third_party/happy/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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.

import("//build_overrides/pigweed.gni")
import("$dir_pw_build/python.gni")

pw_python_package("happy") {
setup = [ "repo/setup.py" ]
}
2 changes: 1 addition & 1 deletion third_party/pigweed/repo
Submodule repo updated from fa1fc6 to 595343

0 comments on commit c87ab64

Please sign in to comment.