Skip to content

Commit d663a09

Browse files
Merge branch 'Set-3-18-24' of github.com:raul-marquez-csa/connectedhomeip into Set-3-18-24
2 parents 6e297d7 + 57df271 commit d663a09

File tree

19 files changed

+252
-200
lines changed

19 files changed

+252
-200
lines changed

.github/workflows/darwin.yaml

+82-71
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,25 @@ concurrency:
2626

2727
env:
2828
CHIP_NO_LOG_TIMESTAMPS: true
29-
30-
jobs:
31-
darwin:
32-
name: Build Darwin
3329

30+
jobs:
31+
framework:
32+
name: Build framework
3433
if: github.actor != 'restyled-io[bot]'
3534
runs-on: macos-latest
36-
35+
strategy:
36+
matrix:
37+
options: # We don't need a full matrix
38+
- flavor: macos-release-availability
39+
arguments: -sdk macosx -configuration Release OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-unguarded-availability-new'
40+
- flavor: ios-release
41+
arguments: -sdk iphoneos -configuration Release OTHER_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
42+
- flavor: ios-debug
43+
arguments: -sdk iphoneos -configuration Debug OTHER_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
44+
- flavor: tvos-debug
45+
arguments: -sdk appletvos -configuration Debug OTHER_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
46+
- flavor: watchos-debug
47+
arguments: -sdk watchos -configuration Debug OTHER_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
3748
steps:
3849
- name: Checkout
3950
uses: actions/checkout@v4
@@ -43,57 +54,41 @@ jobs:
4354
uses: ./.github/actions/checkout-submodules-and-bootstrap
4455
with:
4556
platform: darwin
57+
bootstrap-log-name: bootstrap-logs-framework-${{ matrix.options.flavor }}
4658
- name: Block zap-cli from being used
47-
# xcodebuild is NOT expected to require zap-cli
48-
run: scripts/run_in_build_env.sh 'D=$(dirname $(which zap-cli)) && mv $D/zap-cli $D/zap-cli.moved'
49-
- name: Validate zap-cli is NOT available
50-
# run_in_build_env.sh is used to ensure PATH is set to something that would otherwise find zap-cli
51-
run: scripts/run_in_build_env.sh '(zap-cli --version && exit 1) || exit 0'
52-
- name: Run watchOS Build Debug
53-
working-directory: src/darwin/Framework
54-
# Disable availability annotations, since we are not building a system
55-
# Matter.framework.
56-
run: xcodebuild -target "Matter" -sdk watchos -configuration Debug GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
57-
- name: Run tvOS Build Debug
58-
working-directory: src/darwin/Framework
59-
# Disable availability annotations, since we are not building a system
60-
# Matter.framework.
61-
run: xcodebuild -target "Matter" -sdk appletvos -configuration Debug GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
62-
- name: Run iOS Build Debug
63-
working-directory: src/darwin/Framework
64-
# Disable availability annotations, since we are not building a system
65-
# Matter.framework.
66-
run: xcodebuild -target "Matter" -sdk iphoneos -configuration Debug GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
67-
- name: Run iOS Build Release
68-
working-directory: src/darwin/Framework
69-
# Disable availability annotations, since we are not building a system
70-
# Matter.framework.
71-
run: xcodebuild -target "Matter" -sdk iphoneos -configuration Release GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
72-
- name: Clean Build
73-
run: xcodebuild clean
74-
working-directory: src/darwin/Framework
75-
- name: Delete Defaults
76-
run: defaults delete com.apple.dt.xctest.tool
77-
continue-on-error: true
78-
- name: Run macOS Build
79-
# Enable -Werror by hand here, because the Xcode config can't
80-
# enable it for various reasons. Keep whatever Xcode settings
81-
# for OTHER_CFLAGS exist by using ${inherited}.
82-
#
83-
# Enable -Wconversion by hand as well, because it seems to not be
84-
# enabled by default in the Xcode config.
85-
#
86-
# Disable availability annotations, since we are not building a system
87-
# Matter.framework.
88-
run: xcodebuild -target "Matter" -sdk macosx OTHER_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
89-
working-directory: src/darwin/Framework
90-
- name: Clean Build
91-
run: xcodebuild clean
59+
run: |
60+
# 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'
62+
# run_in_build_env.sh is used to ensure PATH is set to something that would otherwise find zap-cli
63+
scripts/run_in_build_env.sh '(zap-cli --version && exit 1) || exit 0'
64+
- name: Build
9265
working-directory: src/darwin/Framework
93-
- name: Make zap-cli work again
94-
run: scripts/run_in_build_env.sh 'D=$(dirname $(which zap-cli.moved)) && mv $D/zap-cli.moved $D/zap-cli'
95-
- name: Validate zap-cli is again available
96-
run: scripts/run_in_build_env.sh 'zap-cli --version'
66+
run: xcodebuild -target "Matter" ${{ matrix.options.arguments }}
67+
68+
tests:
69+
name: Run framework tests
70+
if: github.actor != 'restyled-io[bot]'
71+
runs-on: macos-latest
72+
strategy:
73+
matrix:
74+
options: # We don't need a full matrix
75+
- flavor: asan
76+
arguments: -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES
77+
- flavor: asan-global-storage
78+
arguments: -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES
79+
defines: MTR_PER_CONTROLLER_STORAGE_ENABLED=0
80+
- flavor: tsan
81+
arguments: -enableThreadSanitizer YES
82+
steps:
83+
- name: Checkout
84+
uses: actions/checkout@v4
85+
- name: Setup Environment
86+
run: brew install python@3.9
87+
- name: Checkout submodules & Bootstrap
88+
uses: ./.github/actions/checkout-submodules-and-bootstrap
89+
with:
90+
platform: darwin
91+
bootstrap-log-name: bootstrap-logs-framework-${{ matrix.options.flavor }}
9792
- name: Build example All Clusters Server
9893
run: |
9994
scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug chip_config_network_layer_ble=false
@@ -103,40 +98,56 @@ jobs:
10398
- name: Build example OTA Requestor
10499
run: |
105100
scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/debug/ota-requestor-app chip_config_network_layer_ble=false non_spec_compliant_ota_action_delay_floor=0
106-
- name: Delete Defaults
107-
run: defaults delete com.apple.dt.xctest.tool
108-
continue-on-error: true
109101
- name: Run Framework Tests
110102
# For now disable unguarded-availability-new warnings because we
111103
# internally use APIs that we are annotating as only available on
112104
# new enough versions. Maybe we should change out deployment
113105
# target versions instead?
106+
working-directory: src/darwin/Framework
114107
run: |
115108
mkdir -p /tmp/darwin/framework-tests
116109
../../../out/debug/chip-all-clusters-app --interface-id -1 > >(tee /tmp/darwin/framework-tests/all-cluster-app.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-err.log >&2) &
117110
../../../out/debug/chip-all-clusters-app --interface-id -1 --dac_provider ../../../credentials/development/commissioner_dut/struct_cd_origin_pid_vid_correct/test_case_vector.json --product-id 32768 --discriminator 3839 --secured-device-port 5539 --KVS /tmp/chip-all-clusters-app-kvs2 > >(tee /tmp/darwin/framework-tests/all-cluster-app-origin-vid.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-origin-vid-err.log >&2) &
118-
# Disable BLE (CHIP_IS_BLE=NO) because the app does not have the permission to use it and that may crash the CI.
119111
120-
TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'> >(tee /tmp/darwin/framework-tests/darwin-tests-asan.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-err.log >&2)
121-
# And the same thing, but with MTR_PER_CONTROLLER_STORAGE_ENABLED turned off, so we test that it does not break for now.
122-
TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1 MTR_PER_CONTROLLER_STORAGE_ENABLED=0' > >(tee /tmp/darwin/framework-tests/darwin-tests-asan-controller-storage.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-controller-storage-err.log >&2)
123-
# And the same thing, but with MTR_NO_AVAILABILITY not turned on. This requires -Wno-unguarded-availability-new to avoid availability errors.
124-
TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-unguarded-availability-new' CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited}' > >(tee /tmp/darwin/framework-tests/darwin-tests-asan-with-availability-annotations.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-with-availability-annotations-err.log >&2)
112+
export TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1
125113
126-
xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableThreadSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1' > >(tee /tmp/darwin/framework-tests/darwin-tests-tsan.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-tsan-err.log >&2)
127-
working-directory: src/darwin/Framework
128-
- name: Build Matter TV Casting Bridge
129-
run: |
130-
xcodebuild -target "MatterTvCastingBridge" -sdk iphoneos
131-
working-directory: examples/tv-casting-app/darwin/MatterTvCastingBridge
114+
# Disable BLE (CHIP_IS_BLE=NO) because the app does not have the permission to use it and that may crash the CI.
115+
xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx ${{ matrix.options.arguments }} \
116+
OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1 ${{ matrix.options.defines }}' \
117+
> >(tee /tmp/darwin/framework-tests/darwin-tests.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-err.log >&2)
132118
- name: Collect crash logs
133119
run: |
134120
mkdir -p /tmp/darwin/framework-tests
135121
find ~/Library/Developer/Xcode/DerivedData /Library/Logs/DiagnosticReports -name '*.ips' -print0 | xargs -0 -J % cp % /tmp/darwin/framework-tests
136122
- name: Uploading log files
137123
uses: actions/upload-artifact@v4
138-
if: ${{ failure() && !env.ACT }}
124+
if: failure() && !env.ACT
139125
with:
140-
name: darwin-framework-test-logs
126+
name: darwin-framework-test-logs-${{ matrix.options.flavor }}
141127
path: /tmp/darwin/framework-tests
142128
retention-days: 5
129+
130+
tv-casting-bridge:
131+
name: Build TV Casting Bridge example
132+
if: github.actor != 'restyled-io[bot]'
133+
runs-on: macos-latest
134+
steps:
135+
- name: Checkout
136+
uses: actions/checkout@v4
137+
- name: Setup Environment
138+
run: brew install python@3.9
139+
- name: Checkout submodules & Bootstrap
140+
uses: ./.github/actions/checkout-submodules-and-bootstrap
141+
with:
142+
platform: darwin
143+
- name: Build
144+
working-directory: examples/tv-casting-app/darwin/MatterTvCastingBridge
145+
run: xcodebuild -target "MatterTvCastingBridge" -sdk iphoneos
146+
147+
darwin:
148+
name: Build Darwin # Matches the previous monolithic build that's marked "required" for PRs
149+
needs: [ framework, tests ]
150+
runs-on: macos-latest
151+
steps:
152+
- name: Done
153+
run: 'true' # nothing to do

.github/workflows/lint.yml

-3
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,8 @@ jobs:
101101
--known-failure app/reporting/tests/MockReportScheduler.h \
102102
--known-failure app/TestEventTriggerDelegate.h \
103103
--known-failure app/util/af.h \
104-
--known-failure app/util/af-types.h \
105104
--known-failure app/util/attribute-storage.cpp \
106105
--known-failure app/util/attribute-storage.h \
107-
--known-failure app/util/attribute-storage-null-handling.h \
108106
--known-failure app/util/attribute-table.cpp \
109107
--known-failure app/util/attribute-table.h \
110108
--known-failure app/util/binding-table.cpp \
@@ -118,7 +116,6 @@ jobs:
118116
--known-failure app/util/generic-callback-stubs.cpp \
119117
--known-failure app/util/im-client-callbacks.h \
120118
--known-failure app/util/MatterCallbacks.h \
121-
--known-failure app/util/odd-sized-integers.h \
122119
--known-failure app/util/util.cpp \
123120
--known-failure app/util/util.h \
124121
--known-failure app/WriteHandler.h \

build/config/mac/mac_sdk.gni

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ if (current_os == "mac") {
3434
deployment_target = "11.0"
3535
}
3636
} else {
37-
deployment_target = "13.4"
37+
deployment_target = "14.0"
3838
}
3939

4040
declare_args() {

docs/ERROR_CODES.md

+1
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ This file was **AUTOMATICALLY** generated by
202202

203203
| Decimal | Hex | Name |
204204
|-----------|-------|---------------------------------------------|
205+
| 1025 | 0x401 | `BLE_ERROR_ADAPTER_UNAVAILABLE` |
205206
| 1027 | 0x403 | `BLE_ERROR_NO_CONNECTION_RECEIVED_CALLBACK` |
206207
| 1028 | 0x404 | `BLE_ERROR_CENTRAL_UNSUBSCRIBED` |
207208
| 1029 | 0x405 | `BLE_ERROR_GATT_SUBSCRIBE_FAILED` |

examples/tv-casting-app/darwin/MatterTvCastingBridge/chip_xcode_build_connector.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ find_in_ancestors() {
145145
fi
146146

147147
# there are environments where these bits are unwanted, unnecessary, or impossible
148-
[[ -n $CHIP_NO_SUBMODULES ]] || git submodule update --init
148+
[[ -n $CHIP_NO_SUBMODULES ]] || scripts/checkout_submodules.py --shallow --platform darwin
149149
if [[ -z $CHIP_NO_ACTIVATE ]]; then
150150
# first run bootstrap/activate in an external env to build everything
151151
env -i PW_ENVSETUP_NO_BANNER=1 PW_ENVSETUP_QUIET=1 bash -c '. scripts/activate.sh'

examples/virtual-device-app/android/java/src/com/matter/virtual/device/app/DeviceEventType.java

+11-14
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,23 @@ public class DeviceEventType {
2323
public static final long EventId_ServiceConnectivityChange = 0x8003;
2424
public static final long EventId_ServiceProvisioningChange = 0x8004;
2525
public static final long EventId_TimeSyncChange = 0x8005;
26-
public static final long EventId_ICDPollingIntervalChang = 0x8006;
27-
public static final long EventId_CHIPoBLEConnectionEstablished = 0x8007;
28-
public static final long EventId_CHIPoBLEConnectionClosed = 0x8008;
29-
public static final long EventId_ThreadStateChange = 0x8009;
30-
public static final long EventId_ThreadInterfaceStateChange = 0x800A;
31-
public static final long EventId_CHIPoBLEAdvertisingChange = 0x800B;
32-
public static final long EventId_InterfaceIpAddressChanged = 0x800C;
33-
public static final long EventId_CommissioningWindowStatusChanged = 0x800D;
34-
public static final long EventId_CommissioningComplete = 0x800E;
35-
public static final long EventId_FailSafeTimerExpired = 0x800F;
36-
public static final long EventId_FailSafeStateChanged = 0x8010;
26+
public static final long EventId_CHIPoBLEConnectionEstablished = 0x8006;
27+
public static final long EventId_CHIPoBLEConnectionClosed = 0x8007;
28+
public static final long EventId_kCloseAllBleConnections = 0x8008;
29+
public static final long EventId_kWiFiDeviceAvailable = 0x8009;
30+
public static final long EventId_kOperationalNetworkStarted = 0x800A;
31+
public static final long EventId_ThreadStateChange = 0x800B;
32+
public static final long EventId_ThreadInterfaceStateChange = 0x800C;
33+
public static final long EventId_CHIPoBLEAdvertisingChange = 0x800D;
34+
public static final long EventId_InterfaceIpAddressChanged = 0x800E;
35+
public static final long EventId_CommissioningComplete = 0x800F;
36+
public static final long EventId_FailSafeTimerExpired = 0x8010;
3737
public static final long EventId_OperationalNetworkEnabled = 0x8011;
3838
public static final long EventId_DnssdInitialized = 0x8012;
3939
public static final long EventId_DnssdRestartNeeded = 0x8013;
4040
public static final long EventId_BindingsChangedViaCluster = 0x8014;
4141
public static final long EventId_OtaStateChanged = 0x8015;
4242
public static final long EventId_ServerReady = 0x8016;
43-
public static final long EventId_ChipMsgSentEvent = 0x8017;
44-
public static final long EventId_ChipMsgRxEventHandled = 0x8018;
45-
public static final long EventId_AppWakeUpEvent = 0x8018;
4643

4744
// out of public event range (0x8000)
4845
public static final long EventId_FabricRemoved = 0x9FFF;

src/app/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ static_library("interaction-model") {
202202
"${chip_root}/src/app/MessageDef",
203203
"${chip_root}/src/app/icd/server:icd-server-config",
204204
"${chip_root}/src/app/icd/server:observer",
205+
"${chip_root}/src/app/util:af-types",
205206
"${chip_root}/src/lib/address_resolve",
206207
"${chip_root}/src/lib/support",
207208
"${chip_root}/src/lib/support:static-support",

src/app/util/BUILD.gn

+16
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,38 @@
1515
import("//build_overrides/chip.gni")
1616
import("${chip_root}/src/app/common_flags.gni")
1717

18+
# These headers/cpp only depend on core/common
1819
source_set("types") {
1920
sources = [
2021
"att-storage.h",
2122
"attribute-metadata.cpp",
2223
"attribute-metadata.h",
24+
"attribute-storage-null-handling.h",
2325
"basic-types.h",
2426
"ember-strings.cpp",
2527
"ember-strings.h",
2628
"endpoint-config-defines.h",
29+
"odd-sized-integers.h",
2730
"types_stub.h",
2831
]
2932

3033
deps = [
3134
"${chip_root}/src/app/common:attribute-type",
35+
"${chip_root}/src/lib/core",
3236
"${chip_root}/src/lib/core:encoding",
3337
"${chip_root}/src/lib/core:types",
3438
]
3539
public_configs = [ "${chip_root}/src:includes" ]
3640
}
41+
42+
# This source set also depends on data-model
43+
source_set("af-types") {
44+
sources = [ "af-types.h" ]
45+
deps = [
46+
":types",
47+
"${chip_root}/src/app:paths",
48+
"${chip_root}/src/app/data-model",
49+
"${chip_root}/src/messaging",
50+
"${chip_root}/src/protocols/interaction_model",
51+
]
52+
}

src/ble/BleError.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ bool FormatLayerError(char * buf, uint16_t bufSize, CHIP_ERROR err)
5555
#if !CHIP_CONFIG_SHORT_ERROR_STR
5656
switch (err.AsInteger())
5757
{
58+
case BLE_ERROR_ADAPTER_UNAVAILABLE.AsInteger():
59+
desc = "BLE adapter unavailable";
60+
break;
5861
case BLE_ERROR_NO_CONNECTION_RECEIVED_CALLBACK.AsInteger():
5962
desc = "No chip over BLE connection received callback set";
6063
break;

0 commit comments

Comments
 (0)