From f6fd87ca21f63ebef80c6d10b081d9b1ff2419f4 Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Mon, 14 Jun 2021 13:46:03 -0400 Subject: [PATCH] Update pigweed to 78d0730d (#7566) --- config/efr32/lib/pw_rpc/pw_rpc.gni | 5 ++ config/esp32/components/chip/CMakeLists.txt | 2 + config/esp32/lib/pw_rpc/BUILD.gn | 2 + .../nrfconnect/chip-gn/lib/pw_rpc/pw_rpc.gni | 5 ++ examples/lighting-app/efr32/BUILD.gn | 3 + examples/lighting-app/linux/BUILD.gn | 9 ++- examples/lighting-app/linux/with_pw_rpc.gni | 5 ++ .../pigweed-app/esp32/main/CMakeLists.txt | 1 + scripts/environment.json | 5 +- scripts/pigweed.json | 76 ------------------- scripts/python.json | 7 ++ src/lib/support/pw_log_chip/BUILD.gn | 6 +- src/platform/EFR32/args.gni | 6 ++ third_party/pigweed/repo | 2 +- 14 files changed, 53 insertions(+), 81 deletions(-) delete mode 100644 scripts/pigweed.json create mode 100644 scripts/python.json diff --git a/config/efr32/lib/pw_rpc/pw_rpc.gni b/config/efr32/lib/pw_rpc/pw_rpc.gni index 013667a87869cb..b0ef83d19dabd6 100644 --- a/config/efr32/lib/pw_rpc/pw_rpc.gni +++ b/config/efr32/lib/pw_rpc/pw_rpc.gni @@ -20,4 +20,9 @@ pw_assert_BACKEND = "$dir_pw_assert_log" pw_sys_io_BACKEND = "${chip_root}/examples/platform/efr32/pw_sys_io:pw_sys_io_efr32" +pw_build_LINK_DEPS = [ + "$dir_pw_assert:impl", + "$dir_pw_log:impl", +] + dir_pw_third_party_nanopb = "${chip_root}/third_party/nanopb/repo" diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index 5baf5efaac454e..f209c37779acaa 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -60,11 +60,13 @@ chip_gn_arg_append("esp32_cpu" "\"esp32\"") chip_gn_arg_bool("is_debug" is_debug) if(CONFIG_ENABLE_PW_RPC) + string(APPEND chip_gn_args "import(\"//build_overrides/pigweed.gni\")\n") chip_gn_arg_append("chip_build_pw_rpc_lib" "true") chip_gn_arg_append("pw_log_BACKEND" "\"//third_party/connectedhomeip/third_party/pigweed/repo/pw_log_basic\"") chip_gn_arg_append("pw_assert_BACKEND" "\"//third_party/connectedhomeip/third_party/pigweed/repo/pw_assert_log\"") chip_gn_arg_append("pw_sys_io_BACKEND" "\"//third_party/connectedhomeip/examples/platform/esp32/pw_sys_io:pw_sys_io_esp32\"") chip_gn_arg_append("dir_pw_third_party_nanopb" "\"//third_party/connectedhomeip/third_party/nanopb/repo\"") + chip_gn_arg_append("pw_build_LINK_DEPS" "[\"\$dir_pw_assert:impl\", \"\$dir_pw_log:impl\"]") endif() if (NOT CONFIG_USE_MINIMAL_MDNS) diff --git a/config/esp32/lib/pw_rpc/BUILD.gn b/config/esp32/lib/pw_rpc/BUILD.gn index 8063be9e32c425..383e4b25f21d56 100644 --- a/config/esp32/lib/pw_rpc/BUILD.gn +++ b/config/esp32/lib/pw_rpc/BUILD.gn @@ -30,6 +30,8 @@ static_library("pw_rpc") { dir_pw_log, ] + deps += pw_build_LINK_DEPS + output_dir = "${root_out_dir}/lib" complete_static_lib = true diff --git a/config/nrfconnect/chip-gn/lib/pw_rpc/pw_rpc.gni b/config/nrfconnect/chip-gn/lib/pw_rpc/pw_rpc.gni index 521744dc0b4def..5732dca57cd060 100644 --- a/config/nrfconnect/chip-gn/lib/pw_rpc/pw_rpc.gni +++ b/config/nrfconnect/chip-gn/lib/pw_rpc/pw_rpc.gni @@ -22,4 +22,9 @@ pw_sys_io_BACKEND = pw_rpc_system_server_BACKEND = "${chip_root}/examples/common/pigweed:system_rpc_server" +pw_build_LINK_DEPS = [ + "$dir_pw_assert:impl", + "$dir_pw_log:impl", +] + dir_pw_third_party_nanopb = "${chip_root}/third_party/nanopb/repo" diff --git a/examples/lighting-app/efr32/BUILD.gn b/examples/lighting-app/efr32/BUILD.gn index b9b80e40c2167e..a33d68a66ce547 100644 --- a/examples/lighting-app/efr32/BUILD.gn +++ b/examples/lighting-app/efr32/BUILD.gn @@ -25,6 +25,7 @@ import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") if (chip_enable_pw_rpc) { import("//build_overrides/pigweed.gni") + import("$dir_pw_build/target_types.gni") } assert(current_os == "freertos") @@ -136,6 +137,8 @@ efr32_executable("lighting_app") { "${examples_plat_dir}/pw_sys_io:pw_sys_io_efr32", ] + deps += pw_build_LINK_DEPS + include_dirs += [ "${chip_root}/examples/common", "${chip_root}/examples/common/pigweed/efr32", diff --git a/examples/lighting-app/linux/BUILD.gn b/examples/lighting-app/linux/BUILD.gn index e7348bd8240eee..7db925c3ac84ab 100644 --- a/examples/lighting-app/linux/BUILD.gn +++ b/examples/lighting-app/linux/BUILD.gn @@ -21,6 +21,11 @@ assert(chip_build_tools) import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") +if (chip_enable_pw_rpc) { + import("//build_overrides/pigweed.gni") + import("$dir_pw_build/target_types.gni") +} + config("includes") { include_dirs = [ ".", @@ -47,8 +52,6 @@ executable("chip-lighting-app") { cflags = [ "-Wconversion" ] if (chip_enable_pw_rpc) { - import("//build_overrides/pigweed.gni") - defines = [ "PW_RPC_ENABLED" ] sources += [ @@ -71,6 +74,8 @@ executable("chip-lighting-app") { "${chip_root}/examples/common/pigweed:device_service.nanopb_rpc", "${chip_root}/examples/lighting-app/lighting-common:lighting_service.nanopb_rpc", ] + + deps += pw_build_LINK_DEPS } output_dir = root_out_dir diff --git a/examples/lighting-app/linux/with_pw_rpc.gni b/examples/lighting-app/linux/with_pw_rpc.gni index 39af71ccff083f..e64dd0fe8a2b12 100644 --- a/examples/lighting-app/linux/with_pw_rpc.gni +++ b/examples/lighting-app/linux/with_pw_rpc.gni @@ -32,4 +32,9 @@ dir_pw_third_party_nanopb = "${chip_root}/third_party/nanopb/repo" pw_chrono_SYSTEM_CLOCK_BACKEND = "$dir_pw_chrono_stl:system_clock" pw_sync_MUTEX_BACKEND = "$dir_pw_sync_stl:mutex_backend" +pw_build_LINK_DEPS = [ + "$dir_pw_assert:impl", + "$dir_pw_log:impl", +] + chip_enable_pw_rpc = true diff --git a/examples/pigweed-app/esp32/main/CMakeLists.txt b/examples/pigweed-app/esp32/main/CMakeLists.txt index 4f20f49e9d6245..bf6df791c14fbb 100644 --- a/examples/pigweed-app/esp32/main/CMakeLists.txt +++ b/examples/pigweed-app/esp32/main/CMakeLists.txt @@ -36,6 +36,7 @@ idf_component_register(INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/third_party/pigweed/repo/pw_rpc/nanopb/public" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/third_party/pigweed/repo/pw_rpc/raw/public" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/third_party/pigweed/repo/pw_protobuf/public" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/third_party/pigweed/repo/pw_function/public" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/third_party/pigweed/repo/pw_status/public" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/third_party/pigweed/repo/pw_stream/public" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/third_party/pigweed/repo/pw_result/public" diff --git a/scripts/environment.json b/scripts/environment.json index 4c6ef55600b4cd..4c1ba2b76555cb 100644 --- a/scripts/environment.json +++ b/scripts/environment.json @@ -1,5 +1,8 @@ { - "cipd_package_files": ["scripts/pigweed.json"], + "cipd_package_files": [ + "third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/cipd_setup/pigweed.json", + "scripts/python.json" + ], "virtualenv": { "gn_root": ".", "gn_targets": [":python_packages.install"] diff --git a/scripts/pigweed.json b/scripts/pigweed.json deleted file mode 100644 index df6fc8fde8de09..00000000000000 --- a/scripts/pigweed.json +++ /dev/null @@ -1,76 +0,0 @@ -[ - { - "path": "gn/gn/${os}-${arch=amd64,arm64}", - "tags": ["git_revision:dba01723a441c358d843a575cb7720d54ddcdf92"] - }, - { - "path": "infra/ninja/${os}-${arch=amd64}", - "tags": ["version:1.9.0"] - }, - { - "path": "infra/cmake/${os}-${arch=amd64}", - "tags": ["version:3.16.1"] - }, - { - "_comment": "TODO(pwbug/93): Package Bazel for Windows.", - "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}", - "tags": ["git_revision:2d87d204057b419f5290f8d38b61b9c2c5b4fb52-2"] - }, - { - "path": "pigweed/third_party/gcc-arm-none-eabi/${os}-${arch=amd64}", - "tags": ["version:9-2020-q2-update"] - }, - { - "path": "infra/3pp/tools/protoc/${os}-${arch}", - "tags": ["version:3.14.0"] - }, - { - "_comment": "TODO(pwbug/70) Put clang in cipd for Windows.", - "path": "fuchsia/third_party/clang/${os=linux,mac}-${arch}", - "tags": ["git_revision:3dc24bc31edbc01dea085b24a6a6b024d7ae531c"] - }, - { - "_comment": "When bumping the minor version (e.g., to 3.9.x) also update env_setup/virtualenv/init.py to check for the new version.", - "path": "infra/3pp/tools/cpython3/${os=mac}-${arch}", - "tags": ["version:3.8.2.chromium.10"] - }, - { - "_comment": "TODO(pwbug/66) Put openocd in cipd for Windows.", - "path": "pigweed/third_party/openocd/${os=linux,mac}-${arch=amd64}", - "tags": ["git_revision:e41c0f4906e46d1076ce62a0da5518aa1ca280b8"] - }, - { - "path": "pigweed/third_party/mingw64-x86_64-win32-seh/${os=windows}-${arch=amd64}", - "tags": ["version:8.1.0"] - }, - { - "path": "pigweed/host_tools/${os}-${arch=amd64}", - "tags": ["git_revision:1220aa869e7bed8d564edd8d404e08720603386e"] - }, - { - "path": "infra/rbe/client/${os=linux,windows}-${arch=amd64}", - "tags": ["git_revision:bbfff8b0a8701cebd503d961c99e9587605b19e2"] - }, - { - "path": "fuchsia/third_party/qemu/${os=linux,mac}-${arch}", - "tags": ["git_revision:841f14e74f5af7886cf49cfcd4fed264911ae58e"] - }, - { - "path": "fuchsia/third_party/kythe", - "subdir": "kythe", - "tags": ["version:1.0.2"] - }, - { - "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"] - } -] diff --git a/scripts/python.json b/scripts/python.json new file mode 100644 index 00000000000000..361a357c40e125 --- /dev/null +++ b/scripts/python.json @@ -0,0 +1,7 @@ +[ + { + "path": "infra/3pp/tools/cpython3/${platform}", + "platforms": ["mac-amd64", "windows-amd64"], + "tags": ["version:3.8.2.chromium.10"] + } +] diff --git a/src/lib/support/pw_log_chip/BUILD.gn b/src/lib/support/pw_log_chip/BUILD.gn index 74f4fa8be7aaa1..23695fa505add0 100644 --- a/src/lib/support/pw_log_chip/BUILD.gn +++ b/src/lib/support/pw_log_chip/BUILD.gn @@ -25,7 +25,11 @@ config("config") { pw_source_set("pw_log_chip") { public_configs = [ ":config" ] - public_deps = [ "${chip_root}/src/lib/support" ] + public_deps = [ ":pw_log_chip.impl" ] public = [ "public_overrides/pw_log_backend/log_backend.h" ] sources = [ "public/pw_log_chip/log_chip.h" ] } + +pw_source_set("pw_log_chip.impl") { + public_deps = [ "${chip_root}/src/lib/support" ] +} diff --git a/src/platform/EFR32/args.gni b/src/platform/EFR32/args.gni index afadf9fa2bbb9a..90620e5d6f52f5 100644 --- a/src/platform/EFR32/args.gni +++ b/src/platform/EFR32/args.gni @@ -14,6 +14,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/efr32_sdk.gni") +import("//build_overrides/pigweed.gni") import("${chip_root}/examples/platform/efr32/args.gni") @@ -46,3 +47,8 @@ openthread_external_platform = "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" chip_config_memory_management = "platform" + +pw_build_LINK_DEPS = [ + "$dir_pw_assert:impl", + "$dir_pw_log:impl", +] diff --git a/third_party/pigweed/repo b/third_party/pigweed/repo index 4afe7a4158fae3..626a9b8e988ef9 160000 --- a/third_party/pigweed/repo +++ b/third_party/pigweed/repo @@ -1 +1 @@ -Subproject commit 4afe7a4158fae3d56f8282c0c114880f407ab105 +Subproject commit 626a9b8e988ef9f1bb1c5bc809a3490f96caf86c