Skip to content

Commit 775cb4d

Browse files
andy31415andreilitvinrestyled-commits
authored
Create CHIP-specific backends for pigweed assert and logs (project-chip#36297)
* Add a matter backend for assertions, to not depend on basic assertions in pigweed itself * No nullptr pass * Add a log backend, update copyrights * Restyle * Switch all backends for log and assert to the new chip backends instead of previous built-in/basic ones. Remove old log backend * Update public to fix linter for gn references * Fix dependencies (this should fix boufalolab compile at least * Remove pw_log_basic as we do not use it anymore * Restyle * Remove one more log_basic usage * Fix typo in log type - application is not defined * Avoid infinite recursion on logging now that PW-logging is not used * Remove echo_pb2 from the console as this is already imported by the pw_system.console it seems * Make PWConsole work again * make linter happy * Clean up all usages of CHIP_USE_PW_LOGGING * Mass rename backends to pw_backends * One more rename * Remove some more includes * Allow to keep going and report failed tetsts in local.py * Do not force fabric admin on BLE ... that seems odd * Switch to no wifi on fabric admin/bridge too * More cleanup for sizes for subprocess * More updates, generally switching to textio did not seem to work well, so just set bufsize to 0 * Update logic: apparently readlines is NOT lazy * Remove unused import * Fix unit tests * Even better display and avoid crashes in pw rpc. Sill need to fix mcore test * Fix flag logic * Make MCOREFS_1_5 less racy: window status is updated several times it seems, so wait for the right status (it starts as not open, then switches to open) * Restyled by autopep8 * Ensure elapsed and time remaining is always updated * Make local.py have a less noisy argument since on failures we generally want to read the files not have them in stdout (except for CI where we only see stdout right now) --------- Co-authored-by: Andrei Litvin <[email protected]> Co-authored-by: Restyled.io <[email protected]>
1 parent 2af51b0 commit 775cb4d

File tree

63 files changed

+525
-331
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+525
-331
lines changed

.github/workflows/tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ jobs:
494494
--target linux-x64-microwave-oven-ipv6only-no-ble-no-wifi-tsan-clang-test \
495495
--target linux-x64-rvc-ipv6only-no-ble-no-wifi-tsan-clang-test \
496496
--target linux-x64-network-manager-ipv6only-no-ble-no-wifi-tsan-clang-test \
497-
--target linux-x64-fabric-admin-rpc-ipv6only-clang \
497+
--target linux-x64-fabric-admin-rpc-ipv6only-no-ble-no-wifi-clang \
498498
--target linux-x64-fabric-bridge-rpc-ipv6only-no-ble-no-wifi-clang \
499499
--target linux-x64-light-data-model-no-unique-id-ipv6only-no-ble-no-wifi-clang \
500500
--target linux-x64-python-bindings \
@@ -511,7 +511,7 @@ jobs:
511511
echo "CHIP_MICROWAVE_OVEN_APP: out/linux-x64-microwave-oven-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-microwave-oven-app" >> /tmp/test_env.yaml
512512
echo "CHIP_RVC_APP: out/linux-x64-rvc-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-rvc-app" >> /tmp/test_env.yaml
513513
echo "NETWORK_MANAGEMENT_APP: out/linux-x64-network-manager-ipv6only-no-ble-no-wifi-tsan-clang-test/matter-network-manager-app" >> /tmp/test_env.yaml
514-
echo "FABRIC_ADMIN_APP: out/linux-x64-fabric-admin-rpc-ipv6only-clang/fabric-admin" >> /tmp/test_env.yaml
514+
echo "FABRIC_ADMIN_APP: out/linux-x64-fabric-admin-rpc-ipv6only-no-ble-no-wifi-clang/fabric-admin" >> /tmp/test_env.yaml
515515
echo "FABRIC_BRIDGE_APP: out/linux-x64-fabric-bridge-rpc-ipv6only-no-ble-no-wifi-clang/fabric-bridge-app" >> /tmp/test_env.yaml
516516
echo "LIGHTING_APP_NO_UNIQUE_ID: out/linux-x64-light-data-model-no-unique-id-ipv6only-no-ble-no-wifi-clang/chip-lighting-app" >> /tmp/test_env.yaml
517517
echo "TRACE_APP: out/trace_data/app-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml

.gn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ default_args = {
3535

3636
# Required for pw_unit_test
3737
pw_sys_io_BACKEND = "$dir_pw_sys_io_stdio"
38-
pw_assert_BACKEND = "$dir_pw_assert_log"
39-
pw_log_BACKEND = "$dir_pw_log_basic"
38+
pw_assert_BACKEND = "//src/pw_backends/assert"
39+
pw_log_BACKEND = "//src/pw_backends/log"
4040

4141
# TODO: Make sure only unit tests link against this
4242
pw_build_LINK_DEPS = [

config/bouffalolab/common/lib/pw_rpc/pw_rpc.gni

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
import("//build_overrides/chip.gni")
1616
import("//build_overrides/pigweed.gni")
1717

18-
pw_log_BACKEND = "$dir_pw_log_basic"
19-
pw_assert_BACKEND = "$dir_pw_assert_log"
18+
pw_log_BACKEND = "${chip_root}/src/pw_backends/log"
19+
pw_assert_BACKEND = "${chip_root}/src/pw_backends/assert"
2020
pw_sys_io_BACKEND =
2121
"${chip_root}/examples/platform/bouffalolab/common/rpc/pw_sys_io:pw_sys_io"
2222

config/efr32/lib/pw_rpc/pw_rpc.gni

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
import("//build_overrides/chip.gni")
1616
import("//build_overrides/pigweed.gni")
1717

18-
pw_log_BACKEND = "$dir_pw_log_basic"
19-
pw_assert_BACKEND = "$dir_pw_assert_log:check_backend"
18+
pw_log_BACKEND = "${chip_root}/src/pw_backends/log"
19+
pw_assert_BACKEND = "${chip_root}/src/pw_backends/assert"
2020
pw_rpc_CONFIG = "$dir_pw_rpc:disable_global_mutex"
2121
pw_sys_io_BACKEND =
2222
"${chip_root}/examples/platform/silabs/pw_sys_io:pw_sys_io_silabs"

config/mbed/chip-gn/lib/pw_rpc/pw_rpc.gni

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
import("//build_overrides/chip.gni")
1616
import("//build_overrides/pigweed.gni")
1717

18-
pw_log_BACKEND = "$dir_pw_log_basic"
19-
pw_assert_BACKEND = "$dir_pw_assert_log:check_backend"
18+
pw_log_BACKEND = "${chip_root}/src/pw_backends/log"
19+
pw_assert_BACKEND = "${chip_root}/src/pw_backends/assert"
2020
pw_sys_io_BACKEND =
2121
"${chip_root}/examples/platform/mbed/pw_sys_io:pw_sys_io_mbed"
2222
pw_rpc_system_server_BACKEND =

config/nxp/lib/pw_rpc/pw_rpc.gni

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
import("//build_overrides/chip.gni")
1616
import("//build_overrides/pigweed.gni")
1717

18-
pw_log_BACKEND = "$dir_pw_log_basic"
19-
pw_assert_BACKEND = "$dir_pw_assert_log:check_backend"
18+
pw_log_BACKEND = "${chip_root}/src/pw_backends/log"
19+
pw_assert_BACKEND = "${chip_root}/src/pw_backends/assert"
2020
pw_rpc_CONFIG = "$dir_pw_rpc:disable_global_mutex"
2121
pw_sys_io_BACKEND = "${chip_root}/examples/platform/nxp/pw_sys_io:pw_sys_io_nxp"
2222

config/qpg/lib/pw_rpc/pw_rpc.gni

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
import("//build_overrides/chip.gni")
1616
import("//build_overrides/pigweed.gni")
1717

18-
pw_log_BACKEND = "$dir_pw_log_basic"
19-
pw_assert_BACKEND = "$dir_pw_assert_log:check_backend"
18+
pw_log_BACKEND = "${chip_root}/src/pw_backends/log"
19+
pw_assert_BACKEND = "${chip_root}/src/pw_backends/assert"
2020
pw_sys_io_BACKEND = "${chip_root}/examples/platform/qpg/pw_sys_io:pw_sys_io_qpg"
2121

2222
pw_build_LINK_DEPS = [

examples/all-clusters-app/linux/with_pw_rpc.gni

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import("${chip_root}/config/standalone/args.gni")
2121

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

24-
pw_log_BACKEND = "$dir_pw_log_basic"
25-
pw_assert_BACKEND = "$dir_pw_assert_log:check_backend"
24+
pw_log_BACKEND = "${chip_root}/src/pw_backends/log"
25+
pw_assert_BACKEND = "${chip_root}/src/pw_backends/assert"
2626
pw_sys_io_BACKEND = "$dir_pw_sys_io_stdio"
2727
pw_trace_BACKEND = "$dir_pw_trace_tokenized"
2828
pw_unit_test_MAIN = "$dir_pw_unit_test:logging_main"
@@ -39,4 +39,3 @@ pw_build_LINK_DEPS = [
3939
]
4040

4141
chip_enable_pw_rpc = true
42-
chip_use_pw_logging = true

examples/android/CHIPTest/args.gni

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ chip_monolithic_tests = false
2828

2929
pw_sys_io_BACKEND = "$dir_pw_sys_io_stdio"
3030

31-
pw_assert_BACKEND = "$dir_pw_assert_log"
32-
pw_log_BACKEND = "$dir_pw_log_basic"
31+
pw_assert_BACKEND = "${chip_root}/src/pw_backends/assert"
32+
pw_log_BACKEND = "${chip_root}/src/pw_backends/log"
3333

3434
pw_unit_test_BACKEND = "$dir_pw_unit_test:light"
3535

examples/chef/linux/with_pw_rpc.gni

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import("${chip_root}/config/standalone/args.gni")
2121

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

24-
pw_log_BACKEND = "$dir_pw_log_basic"
25-
pw_assert_BACKEND = "$dir_pw_assert_log:check_backend"
24+
pw_log_BACKEND = "${chip_root}/src/pw_backends/log"
25+
pw_assert_BACKEND = "${chip_root}/src/pw_backends/assert"
2626
pw_sys_io_BACKEND = "$dir_pw_sys_io_stdio"
2727
pw_trace_BACKEND = "$dir_pw_trace_tokenized"
2828
pw_unit_test_MAIN = "$dir_pw_unit_test:logging_main"
@@ -39,4 +39,3 @@ pw_build_LINK_DEPS = [
3939
]
4040

4141
chip_enable_pw_rpc = true
42-
chip_use_pw_logging = true

0 commit comments

Comments
 (0)