Skip to content

Commit 95259d4

Browse files
authored
Merge branch 'master' into matterTCP-ConnectAPI
2 parents 44fb438 + c5fba0c commit 95259d4

File tree

176 files changed

+2868
-1277
lines changed

Some content is hidden

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

176 files changed

+2868
-1277
lines changed

.github/actions/bootstrap/action.yaml

+38-21
Original file line numberDiff line numberDiff line change
@@ -12,49 +12,66 @@ inputs:
1212
outputs:
1313
cache-hit:
1414
description: "Bootstrap environment was restored from cache"
15-
value: ${{ fromJSON(steps.bootstrap-cache.outputs.outputs).cache-hit }} # retry returns all outputs in `outputs`
15+
value: ${{ fromJSON(steps.restore.outputs.outputs).cache-hit }} # dynamic action returns all outputs in `outputs`
1616

1717
runs:
1818
using: "composite"
1919
steps:
20-
- name: Calculate bootstrap cache key
21-
id: bootstrap-cache-key
20+
- name: Determine bootstrap cache configuration
21+
id: prepare
2222
shell: bash
2323
run: |
24-
# Calculate bootstrap cache key
24+
# Determine bootstrap cache configuration
2525
# In addition to the various setup files, the work directory matters as well,
2626
# because the bootstrapped Pigweed environment contains absolute paths.
27+
echo "Calculating bootstrap cache key for '$PWD'"
2728
FILES_HASH="${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}"
2829
FINAL_HASH="$(echo "$PWD:$FILES_HASH" | shasum -a 256 | cut -d' ' -f1)"
29-
echo "Calculated bootstrap cache key for '$PWD': $FINAL_HASH"
30-
echo "hash=$FINAL_HASH" >> "$GITHUB_OUTPUT"
30+
echo key="${RUNNER_OS}-${RUNNER_ARCH}-${{ inputs.platform }}-${FINAL_HASH}" | tee -a "$GITHUB_OUTPUT"
3131
32-
- uses: Wandalen/wretry.action@v1.4.10
33-
name: Bootstrap from cache
34-
id: bootstrap-cache
32+
# Split caches across backends
33+
case "$RUNNER_OS" in
34+
macOS) echo backend=actions;;
35+
*) echo backend=buildjet;;
36+
esac | tee -a "$GITHUB_OUTPUT"
37+
38+
- name: Bootstrap from cache
39+
id: restore
40+
uses: ./.github/actions/dynamic
3541
continue-on-error: true
3642
with:
37-
action: buildjet/cache@v4
38-
attempt_limit: 3
39-
attempt_delay: 2000
43+
action: ${{ steps.prepare.outputs.backend }}/cache/restore@v4
4044
with: |
41-
key: ${{ runner.os }}-${{ runner.arch }}-${{ inputs.platform }}-${{ steps.bootstrap-cache-key.outputs.hash}}
45+
key: ${{ steps.prepare.outputs.key }}
4246
path: |
43-
.environment
44-
build_overrides/pigweed_environment.gni
47+
.environment
48+
build_overrides/pigweed_environment.gni
4549
4650
- name: Run bootstrap
47-
if: fromJSON(steps.bootstrap-cache.outputs.outputs).cache-hit != 'true'
51+
if: ${{ fromJSON(steps.restore.outputs.outputs).cache-hit != 'true' }}
4852
env:
49-
PW_NO_CIPD_CACHE_DIR: Y
53+
PW_NO_CIPD_CACHE_DIR: 1
54+
PW_ENVSETUP_NO_BANNER: 1
5055
shell: bash
5156
run: source scripts/bootstrap.sh -p all,${{ inputs.platform }}
5257

53-
- name: Uploading bootstrap logs
58+
- name: Save bootstrap cache
59+
uses: ./.github/actions/dynamic
60+
if: ${{ fromJSON(steps.restore.outputs.outputs).cache-hit != 'true' }}
61+
continue-on-error: true
62+
with:
63+
action: ${{ steps.prepare.outputs.backend }}/cache/save@v4
64+
with: |
65+
key: ${{ steps.prepare.outputs.key }}
66+
path: |
67+
.environment
68+
build_overrides/pigweed_environment.gni
69+
70+
- name: Upload bootstrap logs
5471
uses: actions/upload-artifact@v4
55-
if: always() && !env.ACT && fromJSON(steps.bootstrap-cache.outputs.outputs).cache-hit != 'true'
72+
if: ${{ always() && !env.ACT && fromJSON(steps.restore.outputs.outputs).cache-hit != 'true' }}
5673
with:
5774
name: ${{ inputs.bootstrap-log-name }}
5875
path: |
59-
.environment/gn_out/.ninja_log
60-
.environment/pigweed-venv/*.log
76+
.environment/gn_out/.ninja_log
77+
.environment/pigweed-venv/*.log

.github/actions/dynamic/action.yaml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Dynamic
2+
description: Dynamically resolves another GitHub action
3+
inputs:
4+
action:
5+
description: Action reference
6+
required: true
7+
with:
8+
description: Action inputs as multi-line YAML string
9+
required: false
10+
default: ""
11+
outputs:
12+
outputs:
13+
description: JSON object of outputs from the action
14+
value: ${{ steps.run.outputs.outputs }}
15+
runs:
16+
using: composite
17+
steps:
18+
- name: Instantiate
19+
shell: bash
20+
run: |
21+
# Dynamically invoke ${{ inputs.action }}
22+
with='${{ inputs.with }}'
23+
[[ -z "$with" ]] || with="$(echo ' with:'; sed -e 's/^/ /' <<<"$with")"
24+
mkdir -p ./.tmp/dynamic-action-instance
25+
cat <<END >./.tmp/dynamic-action-instance/action.yaml
26+
runs:
27+
using: composite
28+
steps:
29+
- id: run
30+
uses: ${{ inputs.action }}
31+
$with
32+
outputs:
33+
outputs:
34+
value: $(echo '$'){{ toJSON(steps.run.outputs) }}
35+
END
36+
- name: Run
37+
id: run
38+
uses: ./.tmp/dynamic-action-instance

.github/workflows/darwin-tests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
LSAN_OPTIONS: detect_leaks=1 malloc_context_size=40 suppressions=scripts/tests/chiptest/lsan-mac-suppressions.txt
5050

5151
if: github.actor != 'restyled-io[bot]'
52-
runs-on: macos-latest
52+
runs-on: macos-13
5353

5454
steps:
5555
- name: Checkout

.github/workflows/darwin.yaml

+14-23
Original file line numberDiff line numberDiff line change
@@ -31,34 +31,34 @@ jobs:
3131
framework:
3232
name: Build framework
3333
if: github.actor != 'restyled-io[bot]'
34-
runs-on: macos-latest
34+
runs-on: macos-13
3535
strategy:
3636
matrix:
3737
options: # We don't need a full matrix
3838
- flavor: macos-release-availability
39-
arguments: -sdk macosx -configuration Release OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-unguarded-availability-new'
39+
arguments: -sdk macosx -configuration Release WARNING_CFLAGS='${inherited} -Werror -Wconversion -Wno-unguarded-availability-new'
4040
- flavor: ios-release
41-
arguments: -sdk iphoneos -configuration Release OTHER_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
41+
arguments: -sdk iphoneos -configuration Release WARNING_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
4242
- flavor: ios-debug
43-
arguments: -sdk iphoneos -configuration Debug OTHER_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
43+
arguments: -sdk iphoneos -configuration Debug WARNING_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
4444
- flavor: tvos-debug
45-
arguments: -sdk appletvos -configuration Debug OTHER_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
45+
arguments: -sdk appletvos -configuration Debug WARNING_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
4646
- flavor: watchos-debug
47-
arguments: -sdk watchos -configuration Debug OTHER_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
47+
arguments: -sdk watchos -configuration Debug WARNING_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
4848
steps:
4949
- name: Checkout
5050
uses: actions/checkout@v4
51-
- name: Setup Environment
52-
run: brew install python@3.9
5351
- name: Checkout submodules & Bootstrap
5452
uses: ./.github/actions/checkout-submodules-and-bootstrap
5553
with:
5654
platform: darwin
5755
bootstrap-log-name: bootstrap-logs-framework-${{ matrix.options.flavor }}
5856
- name: Block zap-cli from being used
57+
env:
58+
PW_ENVSETUP_NO_BANNER: 1
5959
run: |
6060
# Framework builds are NOT expected to require zap-cli
61-
scripts/run_in_build_env.sh 'D=$(dirname $(which zap-cli)) && mv $D/zap-cli $D/zap-cli.moved'
61+
scripts/run_in_build_env.sh 'rm -- "$(which zap-cli)"'
6262
# run_in_build_env.sh is used to ensure PATH is set to something that would otherwise find zap-cli
6363
scripts/run_in_build_env.sh '(zap-cli --version && exit 1) || exit 0'
6464
- name: Build
@@ -68,7 +68,8 @@ jobs:
6868
tests:
6969
name: Run framework tests
7070
if: github.actor != 'restyled-io[bot]'
71-
runs-on: macos-latest
71+
needs: [ framework ] # serialize to avoid running to many parallel macos runners
72+
runs-on: macos-13
7273
strategy:
7374
matrix:
7475
options: # We don't need a full matrix
@@ -82,8 +83,6 @@ jobs:
8283
steps:
8384
- name: Checkout
8485
uses: actions/checkout@v4
85-
- name: Setup Environment
86-
run: brew install python@3.9
8786
- name: Checkout submodules & Bootstrap
8887
uses: ./.github/actions/checkout-submodules-and-bootstrap
8988
with:
@@ -117,6 +116,7 @@ jobs:
117116
OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1 ${{ matrix.options.defines }}' \
118117
> >(tee /tmp/darwin/framework-tests/darwin-tests.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-err.log >&2)
119118
- name: Collect crash logs
119+
if: failure() && !env.ACT
120120
run: |
121121
mkdir -p /tmp/darwin/framework-tests
122122
find ~/Library/Developer/Xcode/DerivedData /Library/Logs/DiagnosticReports -name '*.ips' -print0 | xargs -0 -J % cp % /tmp/darwin/framework-tests
@@ -131,24 +131,15 @@ jobs:
131131
tv-casting-bridge:
132132
name: Build TV Casting Bridge example
133133
if: github.actor != 'restyled-io[bot]'
134-
runs-on: macos-latest
134+
needs: [ framework ] # serialize to avoid running to many parallel macos runners
135+
runs-on: macos-13
135136
steps:
136137
- name: Checkout
137138
uses: actions/checkout@v4
138-
- name: Setup Environment
139-
run: brew install python@3.9
140139
- name: Checkout submodules & Bootstrap
141140
uses: ./.github/actions/checkout-submodules-and-bootstrap
142141
with:
143142
platform: darwin
144143
- name: Build
145144
working-directory: examples/tv-casting-app/darwin/MatterTvCastingBridge
146145
run: xcodebuild -target "MatterTvCastingBridge" -sdk iphoneos
147-
148-
darwin:
149-
name: Build Darwin # Matches the previous monolithic build that's marked "required" for PRs
150-
needs: [ framework, tests ]
151-
runs-on: macos-latest
152-
steps:
153-
- name: Done
154-
run: 'true' # nothing to do

.github/workflows/full-android.yaml

+6-28
Original file line numberDiff line numberDiff line change
@@ -73,30 +73,6 @@ jobs:
7373
"./scripts/build/build_examples.py --target android-arm-chip-tool build"
7474
- name: Clean out build output
7575
run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* examples/android/CHIPTool/app/libs/*.jar
76-
- name: Build Android arm-tv-casting-app
77-
run: |
78-
./scripts/run_in_build_env.sh \
79-
"./scripts/build/build_examples.py --target android-arm-tv-casting-app build"
80-
- name: Clean out build output
81-
run: rm -rf ./out examples/tv-casting-app/android/App/app/libs/jniLibs/* examples/tv-casting-app/android/App/app/libs/*.jar
82-
- name: Build Android arm-tv-server
83-
run: |
84-
./scripts/run_in_build_env.sh \
85-
"./scripts/build/build_examples.py --target android-arm-tv-server build"
86-
- name: Clean out build output
87-
run: rm -rf ./out examples/tv-app/android/App/app/libs/jniLibs/* examples/tv-app/android/App/app/libs/*.jar
88-
- name: Build Android arm64-tv-casting-app
89-
run: |
90-
./scripts/run_in_build_env.sh \
91-
"./scripts/build/build_examples.py --target android-arm64-tv-casting-app build"
92-
- name: Clean out build output
93-
run: rm -rf ./out examples/tv-casting-app/android/app/libs/jniLibs/* examples/android/CHIPTool/app/libs/*.jar
94-
- name: Build Android arm64-tv-server
95-
run: |
96-
./scripts/run_in_build_env.sh \
97-
"./scripts/build/build_examples.py --target android-arm64-tv-server build"
98-
- name: Clean out build output
99-
run: rm -rf ./out examples/tv-app/android/App/app/libs/jniLibs/* examples/tv-app/android/App/app/libs/*.jar
10076
- name: Build Android arm64-chip-tool
10177
run: |
10278
./scripts/run_in_build_env.sh \
@@ -107,7 +83,9 @@ jobs:
10783
"ninja -C out/android-arm64-chip-tool build/chip/java/tests:java_build_test"
10884
- name: Clean out build output
10985
run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* examples/android/CHIPTool/app/libs/*.jar
110-
# - name: Build Android Studio build (arm64 only)
111-
# run: |
112-
# ./scripts/run_in_build_env.sh \
113-
# "./scripts/build/build_examples.py --target android-androidstudio-arm64-chip-tool build"
86+
- name: Build Android arm64-chip-test
87+
run: |
88+
./scripts/run_in_build_env.sh \
89+
"./scripts/build/build_examples.py --target android-arm64-chip-test build"
90+
- name: Clean out build output
91+
run: rm -rf ./out examples/android/CHIPTest/app/libs/jniLibs/* examples/android/CHIPTest/app/libs/*.jar

.github/workflows/lint.yml

+15
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,18 @@ jobs:
285285
if: always()
286286
run: |
287287
git grep -I -n 'SuccessOrExit([^=)]*(' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
288+
289+
# git grep exits with 0 if it finds a match, but we want
290+
# to fail (exit nonzero) on match.
291+
- name: Check for use of "using namespace" outside of a class/function in headers.
292+
if: always()
293+
run: |
294+
# Various platforms have `using namespace chip::Ble` in their BLEManager* headers; just exclude those for now.
295+
#
296+
# Exclude platform openiotsdk bits that do this in their persistent storage header.
297+
#
298+
# Also exclude examples (for now) and third_party, which have various instances of this.
299+
#
300+
# Ignore uses of `System::Clock::Literals`, because that's the only way to have things using _ms32 or whatnot
301+
# in a header file.
302+
git grep -I -n -e '^using namespace' --and --not -e 'System::Clock::Literals' -- './**/*.h' ':(exclude)src/platform/*/BLEManager*.h' ':(exclude)src/platform/openiotsdk/KVPsaPsStore.h' ':(exclude)./examples' ':(exclude)./third_party' && exit 1 || exit 0

.github/workflows/smoketest-android.yaml

-12
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,3 @@ jobs:
6868
"ninja -C out/android-arm64-chip-tool build/chip/java/tests:java_build_test"
6969
- name: Clean out build output
7070
run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* examples/android/CHIPTool/app/libs/*.jar
71-
- name: Build Android arm64-tv-casting-app
72-
run: |
73-
./scripts/run_in_build_env.sh \
74-
"./scripts/build/build_examples.py --target android-arm64-tv-casting-app build"
75-
- name: Clean out build output
76-
run: rm -rf ./out examples/tv-casting-app/android/App/app/libs/jniLibs/* examples/tv-casting-app/android/App/app/libs/*.jar
77-
- name: Build Android arm64-tv-server
78-
run: |
79-
./scripts/run_in_build_env.sh \
80-
"./scripts/build/build_examples.py --target android-arm64-tv-server build"
81-
- name: Clean out build output
82-
run: rm -rf ./out examples/tv-app/android/App/app/libs/jniLibs/* examples/tv-app/android/App/app/libs/*.jar

config/esp32/components/chip/CMakeLists.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -441,16 +441,17 @@ if(CONFIG_OPENTHREAD_ENABLED)
441441
endif()
442442
endif()
443443

444-
if((NOT CONFIG_USE_MINIMAL_MDNS) AND (CONFIG_ENABLE_WIFI_STATION OR CONFIG_ENABLE_WIFI_AP))
444+
if(NOT CONFIG_USE_MINIMAL_MDNS)
445445
idf_build_get_property(build_components BUILD_COMPONENTS)
446446
# For IDF v5.x, the mdns component was moved to idf_managed_components.
447447
# We should use 'espressif__mdns' for 'idf_component_get_property'.
448448
if("espressif__mdns" IN_LIST build_components)
449449
idf_component_get_property(mdns_lib espressif__mdns COMPONENT_LIB)
450+
list(APPEND chip_libraries $<TARGET_FILE:${mdns_lib}>)
450451
elseif("mdns" IN_LIST build_components)
451452
idf_component_get_property(mdns_lib mdns COMPONENT_LIB)
453+
list(APPEND chip_libraries $<TARGET_FILE:${mdns_lib}>)
452454
endif()
453-
list(APPEND chip_libraries $<TARGET_FILE:${mdns_lib}>)
454455
endif()
455456

456457
if (CONFIG_ENABLE_ENCRYPTED_OTA)

config/nxp/chip-module/Kconfig

+20
Original file line numberDiff line numberDiff line change
@@ -256,3 +256,23 @@ config CHIP_OTA_REQUESTOR_REBOOT_ON_APPLY
256256
Reboots the device automatically after downloading a new firmware update
257257
to swap the old and the new firmware images. The reboot happens only when
258258
a user consents to apply the firmware update.
259+
260+
choice CHIP_OTA_REQUEST_UPGRADE_TYPE
261+
prompt "Type of the upgrade to apply on new images"
262+
default CHIP_OTA_REQUEST_UPGRADE_TEST
263+
depends on CHIP_OTA_REQUESTOR
264+
265+
config CHIP_OTA_REQUEST_UPGRADE_PERMANENT
266+
bool "Mark the image as permanent"
267+
help
268+
The upgrade will be permanent on the next reboot.
269+
No coming back to the old image.
270+
271+
config CHIP_OTA_REQUEST_UPGRADE_TEST
272+
bool "Mark the image as a test"
273+
help
274+
The upgrade will be marked as a test.
275+
Image will be run on the next reboot, if confirmed it
276+
becomes permanent, otherwise the new image is reverted.
277+
278+
endchoice

config/nxp/chip-module/Kconfig.defaults

+1-4
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ choice NET_TC_THREAD_TYPE
127127
default NET_TC_THREAD_PREEMPTIVE
128128
endchoice
129129

130-
config NET_TCP_WORK_QUEUE_THREAD_PRIO
130+
config NET_TCP_WORKER_PRIO
131131
default -16
132132

133133
config NET_TC_TX_THREAD_BASE_PRIO
@@ -406,6 +406,3 @@ config FLASH_SHELL
406406
endif # SHELL
407407

408408
endif
409-
410-
config NXP_FW_LOADER_MONOLITHIC
411-
default y if NXP_FW_LOADER

0 commit comments

Comments
 (0)