Skip to content

Commit a96538c

Browse files
authored
Merge branch 'master' into feature/enable_uart_logging
2 parents 780b13f + b427981 commit a96538c

File tree

272 files changed

+6653
-1897
lines changed

Some content is hidden

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

272 files changed

+6653
-1897
lines changed

.github/actions/checkout-submodules-and-bootstrap/action.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ inputs:
1515
runs:
1616
using: "composite"
1717
steps:
18+
- name: Maximize runner disk
19+
uses: ./.github/actions/maximize-runner-disk
1820
- name: Dump disk info
1921
uses: ./.github/actions/dump-disk-info
2022
- name: Set git safe directory for local act runs
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Maximize runner disk
2+
description: Free up disk space on the github runner
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Free up disk space on the github runner
7+
if: ${{ !env.ACT }}
8+
shell: bash
9+
run: |
10+
# maximize-runner-disk
11+
if [[ "$RUNNER_OS" == Linux ]]; then
12+
# Directories to prune to free up space. Candidates:
13+
# 1.6G /usr/share/dotnet
14+
# 1.1G /usr/local/lib/android/sdk/platforms
15+
# 1000M /usr/local/lib/android/sdk/build-tools
16+
# 8.9G /usr/local/lib/android/sdk
17+
# This list can be amended later to change the trade-off between the amount of
18+
# disk space freed up, and how long it takes to do so (deleting many files is slow).
19+
prune=(/usr/share/dotnet /usr/local/lib/android/sdk/platforms /usr/local/lib/android/sdk/build-tools)
20+
21+
if [[ "$UID" -eq 0 && -d /__w ]]; then
22+
root=/runner-root-volume
23+
if [[ ! -d "$root" ]]; then
24+
echo "Unable to maximize disk space, job is running inside a container and $root is not mounted"
25+
exit 0
26+
fi
27+
function sudo() { "$@"; } # we're already root (and sudo is probably unavailable)
28+
elif [[ "$UID" -ne 0 && "$RUNNER_ENVIRONMENT" == github-hosted ]]; then
29+
root=
30+
else
31+
echo "Unable to maximize disk space, unknown runner environment"
32+
exit 0
33+
fi
34+
35+
echo "Freeing up runner disk space on ${root:-/}"
36+
function avail() { df -k --output=avail "${root:-/}" | grep '^[0-9]*$'; }
37+
function now() { date '+%s'; }
38+
before="$(avail)" start="$(now)"
39+
for dir in "${prune[@]}"; do
40+
if [[ -d "${root}${dir}" ]]; then
41+
echo "- $dir"
42+
# du -sh -- "${root}${dir}"
43+
sudo rm -rf -- "${root}${dir}"
44+
else
45+
echo "- $dir (not found)"
46+
fi
47+
done
48+
after="$(avail)" end="$(now)"
49+
echo "Done, freed up $(( (after - before) / 1024 ))M of disk space in $(( end - start )) seconds."
50+
fi

.github/workflows/build.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
container:
4343
image: ghcr.io/project-chip/chip-build:35
4444
volumes:
45+
- "/:/runner-root-volume"
4546
- "/tmp/log_output:/tmp/test_logs"
4647
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
4748
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
@@ -137,6 +138,7 @@ jobs:
137138
container:
138139
image: ghcr.io/project-chip/chip-build:35
139140
volumes:
141+
- "/:/runner-root-volume"
140142
- "/tmp/log_output:/tmp/test_logs"
141143
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
142144
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
@@ -285,6 +287,7 @@ jobs:
285287
container:
286288
image: ghcr.io/project-chip/chip-build:35
287289
volumes:
290+
- "/:/runner-root-volume"
288291
- "/tmp/log_output:/tmp/test_logs"
289292
options: --sysctl "net.ipv6.conf.all.disable_ipv6=0
290293
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
@@ -345,6 +348,7 @@ jobs:
345348
container:
346349
image: ghcr.io/project-chip/chip-build:35
347350
volumes:
351+
- "/:/runner-root-volume"
348352
- "/tmp/log_output:/tmp/test_logs"
349353
options: --sysctl "net.ipv6.conf.all.disable_ipv6=0
350354
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
@@ -453,6 +457,7 @@ jobs:
453457
container:
454458
image: ghcr.io/project-chip/chip-build:35
455459
volumes:
460+
- "/:/runner-root-volume"
456461
- "/tmp/log_output:/tmp/test_logs"
457462
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
458463
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"

.github/workflows/darwin.yaml

+4-7
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,10 @@ jobs:
119119
run: |
120120
xcodebuild -target "MatterTvCastingBridge" -sdk iphoneos
121121
working-directory: examples/tv-casting-app/darwin/MatterTvCastingBridge
122-
- name: Uploading .ips files in Xcode derived data to debug the failure
123-
uses: actions/upload-artifact@v4
124-
if: ${{ failure() && !env.ACT }}
125-
with:
126-
name: darwin-framework-derived-data
127-
path: ~/Library/Developer/Xcode/DerivedData/**/*.ips
128-
retention-days: 5
122+
- name: Collect crash logs
123+
run: |
124+
mkdir -p /tmp/darwin/framework-tests
125+
find ~/Library/Developer/Xcode/DerivedData /Library/Logs/DiagnosticReports -name '*.ips' -print0 | xargs -0 -J % cp % /tmp/darwin/framework-tests
129126
- name: Uploading log files
130127
uses: actions/upload-artifact@v4
131128
if: ${{ failure() && !env.ACT }}

.github/workflows/java-tests.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,17 @@ jobs:
132132
--tool-cluster "im" \
133133
--tool-args "onnetwork-long-im-invoke --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \
134134
--factoryreset \
135+
'
136+
- name: Run IM Extendable Invoke Test
137+
run: |
138+
scripts/run_in_python_env.sh out/venv \
139+
'./scripts/tests/run_java_test.py \
140+
--app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \
141+
--app-args "--discriminator 3840 --interface-id -1" \
142+
--tool-path out/linux-x64-java-matter-controller \
143+
--tool-cluster "im" \
144+
--tool-args "onnetwork-long-im-extendable-invoke --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \
145+
--factoryreset \
135146
'
136147
- name: Run IM Read Test
137148
run: |

.github/workflows/lint.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ jobs:
9696
--known-failure app/CommandHandler.h \
9797
--known-failure app/CommandHandlerInterface.h \
9898
--known-failure app/CommandSenderLegacyCallback.h \
99-
--known-failure app/CompatEnumNames.h \
10099
--known-failure app/data-model/ListLargeSystemExtensions.h \
101100
--known-failure app/EventHeader.h \
102101
--known-failure app/EventLoggingTypes.h \
@@ -114,7 +113,6 @@ jobs:
114113
--known-failure app/util/attribute-table.h \
115114
--known-failure app/util/binding-table.cpp \
116115
--known-failure app/util/binding-table.h \
117-
--known-failure app/util/common.h \
118116
--known-failure app/util/config.h \
119117
--known-failure app/util/DataModelHandler.cpp \
120118
--known-failure app/util/DataModelHandler.h \
@@ -205,7 +203,7 @@ jobs:
205203
# TODO: TLVDebug should ideally not be excluded here.
206204
# TODO: protocol_decoder.cpp should ideally not be excluded here.
207205
# TODO: PersistentStorageMacros.h should ideally not be excluded here.
208-
git grep -I -n "PRI.64" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)examples/chip-tool' ':(exclude)examples/tv-casting-app' ':(exclude)src/app/MessageDef/MessageDefHelper.cpp' ':(exclude)src/app/tests/integration/chip_im_initiator.cpp' ':(exclude)src/lib/core/TLVDebug.cpp' ':(exclude)src/lib/dnssd/tests/TestTxtFields.cpp' ':(exclude)src/lib/format/protocol_decoder.cpp' ':(exclude)src/lib/support/PersistentStorageMacros.h' ':(exclude)src/messaging/tests/echo/echo_requester.cpp' ':(exclude)src/platform/Linux' ':(exclude)src/platform/Ameba' ':(exclude)src/platform/ESP32' ':(exclude)src/platform/webos' ':(exclude)zzz_generated/chip-tool' ':(exclude)src/tools/chip-cert/Cmd_PrintCert.cpp' && exit 1 || exit 0
206+
git grep -I -n "PRI.64" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)examples/chip-tool' ':(exclude)examples/tv-casting-app' ':(exclude)src/app/MessageDef/MessageDefHelper.cpp' ':(exclude)src/app/tests/integration/chip_im_initiator.cpp' ':(exclude)src/lib/core/TLVDebug.cpp' ':(exclude)src/lib/dnssd/tests/TestTxtFields.cpp' ':(exclude)src/lib/format/protocol_decoder.cpp' ':(exclude)src/lib/support/PersistentStorageMacros.h' ':(exclude)src/messaging/tests/echo/echo_requester.cpp' ':(exclude)src/platform/Linux' ':(exclude)src/platform/Ameba' ':(exclude)src/platform/ESP32' ':(exclude)src/platform/Darwin' ':(exclude)src/darwin' ':(exclude)src/platform/webos' ':(exclude)zzz_generated/chip-tool' ':(exclude)src/tools/chip-cert/Cmd_PrintCert.cpp' && exit 1 || exit 0
209207
210208
# git grep exits with 0 if it finds a match, but we want
211209
# to fail (exit nonzero) on match. And we want to exclude this file,

.github/workflows/smoketest-android.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
container:
4040
image: ghcr.io/project-chip/chip-build-android:35
4141
volumes:
42+
- "/:/runner-root-volume"
4243
- "/tmp/log_output:/tmp/test_logs"
4344

4445
steps:

.github/workflows/unit_integration_test.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
container:
4040
image: ghcr.io/project-chip/chip-build:35
4141
volumes:
42+
- "/:/runner-root-volume"
4243
- "/tmp/log_output:/tmp/test_logs"
4344
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
4445

build/chip/chip_codegen.gni

+3-52
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ template("_chip_build_time_zapgen") {
152152
_output_subdir = "zap-generated"
153153
}
154154

155-
pw_python_action("${_name}_zap_pregen") {
155+
pw_python_action("${_name}_zap") {
156156
script = "${chip_root}/scripts/tools/zap/generate.py"
157157

158158
# TODO: this seems to touch internals. Is this ok? speeds up builds!
@@ -165,7 +165,7 @@ template("_chip_build_time_zapgen") {
165165
"--templates",
166166
_template_path,
167167
"--output-dir",
168-
rebase_path(target_gen_dir) + "/zap_pregen/" + _output_subdir,
168+
rebase_path(target_gen_dir) + "/zapgen/" + _output_subdir,
169169

170170
# TODO: lock file support should be removed as this serializes zap
171171
# (slower), however this is currently done because on Darwin zap startup
@@ -188,54 +188,10 @@ template("_chip_build_time_zapgen") {
188188

189189
sources = [ _idl_file ]
190190

191-
outputs = []
192-
foreach(name, invoker.outputs) {
193-
outputs += [ "${target_gen_dir}/zap_pregen/${name}" ]
194-
}
195-
196-
forward_variables_from(invoker, [ "prune_outputs" ])
197-
if (defined(prune_outputs)) {
198-
foreach(name, prune_outputs) {
199-
outputs += [ "${target_gen_dir}/zap_pregen/${name}" ]
200-
}
201-
}
202-
}
203-
204-
# This action ensures that any "extra" files generated by zap codegen
205-
# are actually deleted.
206-
#
207-
# This is to avoid double-codegen of configurations like endpoint config
208-
# or access credentials being generated for both "controller client" and
209-
# application-specific
210-
pw_python_action("${_name}_files") {
211-
# TODO: this seems to touch internals. Is this ok? speeds up builds!
212-
_pw_internal_run_in_venv = false
213-
214-
script = "${chip_root}/scripts/tools/zap/prune_outputs.py"
215-
216-
_keep_file = rebase_path("${target_gen_dir}/${_name}.keep.outputs")
217-
write_file(_keep_file, invoker.outputs, "list lines")
218-
219-
args = [
220-
"--keep",
221-
_keep_file,
222-
"--input-dir",
223-
rebase_path("${target_gen_dir}/zap_pregen/"),
224-
"--output-dir",
225-
rebase_path("${target_gen_dir}/zapgen/"),
226-
]
227-
228-
inputs = []
229-
foreach(name, invoker.outputs) {
230-
inputs += [ "${target_gen_dir}/zap_pregen/${name}" ]
231-
}
232-
233191
outputs = []
234192
foreach(name, invoker.outputs) {
235193
outputs += [ "${target_gen_dir}/zapgen/${name}" ]
236194
}
237-
238-
deps = [ ":${_name}_zap_pregen" ]
239195
}
240196

241197
source_set(_name) {
@@ -255,10 +211,7 @@ template("_chip_build_time_zapgen") {
255211
if (!defined(public_deps)) {
256212
public_deps = []
257213
}
258-
public_deps += [
259-
":${_name}_files",
260-
":${_name}_zap_pregen",
261-
]
214+
public_deps += [ ":${_name}_zap" ]
262215
}
263216
}
264217

@@ -420,7 +373,6 @@ template("chip_zapgen") {
420373
"input",
421374
"outputs",
422375
"public_configs",
423-
"prune_outputs",
424376
])
425377
}
426378
} else {
@@ -482,7 +434,6 @@ template("chip_zapgen") {
482434
[
483435
"deps",
484436
"public_configs",
485-
"prune_outputs",
486437
])
487438
if (!defined(public_configs)) {
488439
public_configs = []

build/config/BUILDCONFIG.gn

+4-7
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ if (_chip_defaults.custom_toolchain != "") {
7676
} else {
7777
_target_compiler = "gcc"
7878
}
79-
8079
_default_toolchain = "${_build_overrides.build_root}/toolchain/linux:linux_${target_cpu}_${_target_compiler}"
81-
} else if (target_os == host_os &&
82-
(target_cpu == host_cpu ||
83-
(target_cpu == "arm64e" && host_cpu == "arm64"))) {
80+
} else if (host_os == "mac" && (target_os == "mac" || target_os == "ios")) {
81+
# On Mac the host toolchain supports building for all mac and ios targets
82+
_default_toolchain = host_toolchain
83+
} else if (target_os == host_os && target_cpu == host_cpu) {
8484
_default_toolchain = host_toolchain
8585
} else if (target_os == "freertos") {
8686
if (_chip_defaults.is_clang) {
@@ -113,9 +113,6 @@ if (_chip_defaults.custom_toolchain != "") {
113113
} else {
114114
assert(false, "Unsupported target_cpu: ${current_cpu}")
115115
}
116-
} else if (target_os == "ios") {
117-
_default_toolchain =
118-
"${_build_overrides.build_root}/toolchain/ios:ios_${target_cpu}"
119116
} else if (target_os == "tizen") {
120117
_default_toolchain =
121118
"${_build_overrides.build_root}/toolchain/tizen:tizen_${target_cpu}"

build/config/compiler/BUILD.gn

+2-2
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ config("cosmetic_default") {
343343
}
344344

345345
config("runtime_default") {
346-
if (is_clang) {
346+
if (is_clang) { # Using Pigweed clang instead of Darwin host clang
347347
configs = [
348348
"$dir_pw_toolchain/host_clang:no_system_libcpp",
349349
"$dir_pw_toolchain/host_clang:xcode_sysroot",
@@ -402,7 +402,7 @@ config("sanitize_address") {
402402
]
403403
ldflags = cflags
404404

405-
if (target_os == "mac" || target_os == "ios") {
405+
if ((target_os == "mac" || target_os == "ios") && !is_clang) {
406406
defines += [ "_LIBCPP_HAS_NO_ASAN" ]
407407
}
408408
}

config/esp32/components/chip/CMakeLists.txt

+19
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,25 @@ endif()
131131

132132
if(CONFIG_ENABLE_ICD_SERVER)
133133
chip_gn_arg_append("chip_enable_icd_server" "true")
134+
if(CONFIG_ICD_ENFORCE_SIT_SLOW_POLL_LIMIT)
135+
chip_gn_arg_append("icd_enforce_sit_slow_poll_limit" "true")
136+
endif()
137+
if(CONFIG_ICD_REPORT_ON_ACTIVE_MODE)
138+
chip_gn_arg_append("chip_icd_report_on_active_mode" "true")
139+
endif()
140+
if(CONFIG_ENABLE_ICD_LIT)
141+
chip_gn_arg_append("chip_enable_icd_lit" "true")
142+
if(CONFIG_ENABLE_ICD_CIP)
143+
chip_gn_arg_append("chip_enable_icd_checkin" "true")
144+
else()
145+
chip_gn_arg_append("chip_enable_icd_checkin" "false")
146+
endif()
147+
if(CONFIG_ENABLE_ICD_USER_ACTIVE_MODE_TRIGGER)
148+
chip_gn_arg_append("chip_enable_icd_user_active_mode_trigger" "true")
149+
else()
150+
chip_gn_arg_append("chip_enable_icd_user_active_mode_trigger" "false")
151+
endif()
152+
endif()
134153
endif()
135154

136155
if(CONFIG_ENABLE_PW_RPC)

0 commit comments

Comments
 (0)