Skip to content

Commit

Permalink
Merge branch 'master' into fix/python-subscripiton
Browse files Browse the repository at this point in the history
  • Loading branch information
tianfeng-yang authored Feb 27, 2024
2 parents de2eb88 + 28c78af commit 20046dd
Show file tree
Hide file tree
Showing 326 changed files with 10,536 additions and 1,611 deletions.
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Checks: >
-clang-analyzer-cplusplus.Move,
-clang-analyzer-deadcode.DeadStores,
-clang-analyzer-nullability.NullablePassedToNonnull,
-clang-analyzer-optin.core.EnumCastOutOfRange,
-clang-analyzer-optin.cplusplus.UninitializedObject,
-clang-analyzer-optin.cplusplus.VirtualCall,
-clang-analyzer-optin.osx.cocoa.localizability.EmptyLocalizationContextChecker,
Expand Down
32 changes: 1 addition & 31 deletions .github/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,19 @@ abfb
ABI
ABIs
ables
AccessControl
AccessControlEntry
accesscontrol
accessor
Accessors
AccountLogin
acdbc
ack
ACKed
ACL
ACLs
actdiag
AdapterAddress
AdapterName
adb
AddNOC
AddOrUpdateThreadNetwork
AddOrUpdateWiFiNetwork
addr
AddResponse
AddThreadNetwork
AddStatus
adk
AdministratorCommissioning
adoc
adr
AdvAutonomous
Expand All @@ -48,7 +38,6 @@ AE
aef
AES
AIDL
AlarmCode
algs
alloc
Ameba
Expand All @@ -61,15 +50,12 @@ AnnounceOTAProvider
AnnounceOTAProviderRequest
APIs
apk
AppConfig
AppImpl
AppleTV
appliable
ApplianceControl
applianceeventsandalert
ApplianceIdentification
appliancestatistics
ApplicationBasic
ApplicationId
ApplicationIdentifier
ApplicationLauncher
Expand Down Expand Up @@ -171,7 +157,6 @@ BRD
breakpoint
bredr
BridgedDeviceBasicInformation
bridgedLightEndpoint
bringup
BroadcastReceiver
BromateConcentrationMeasurement
Expand Down Expand Up @@ -259,9 +244,6 @@ CLIs
cloudbuild
CLRF
clusterAttrs
clusterId
clusterList
clusterListName
ClusterName
ClusterObjectTests
ClusterRevision
Expand Down Expand Up @@ -315,7 +297,6 @@ ContentApp's
ContentAppPlatform
ContentLaunch
ContentLauncher
continuousHinting
contrib
controllee
conv
Expand Down Expand Up @@ -382,7 +363,6 @@ DefaultOTARequestor
DefaultOTARequestorDriver
DefaultOTARequestorStorage
DefaultSuccess
defaultValue
definedValue
DehumidificationControl
DelayedActionTime
Expand Down Expand Up @@ -415,9 +395,7 @@ DeviceLayer
DeviceNetworkProvisioningDelegate
DeviceNetworkProvisioningDelegateImpl
DevicePairingDelegate
deviceSoftwareVersionModel
DeviceTemperatureConfiguration
deviceType
DevKitC
DevKitM
devtype
Expand Down Expand Up @@ -511,8 +489,6 @@ EnableNetwork
EnableWiFiNetwork
endian
EndpointId
endpointName
endsWith
eno
entrypoint
enum
Expand Down Expand Up @@ -580,7 +556,6 @@ FlowMeasurement
FluorideConcentrationMeasurement
focusable
forkpty
formatOnSave
FOTA
FreeRTOS
FreeRTOSConfig
Expand Down Expand Up @@ -614,7 +589,6 @@ GetIP
getManualTests
GetSafeAttributePersistenceProvider
getstarted
getTests
GH
ghcr
ghp
Expand All @@ -639,8 +613,6 @@ graphviz
Groupcast
GroupId
GroupKeyManagement
groupKeySecurityPolicy
groupKeySetID
groupsettings
gsdk
gtk
Expand Down Expand Up @@ -694,8 +666,6 @@ ifconfig
ifdef
ifdefs
IGMP
ignoreApplyUpdate
ignoreQueryImage
ihex
IlluminanceMeasurement
IM
Expand Down
21 changes: 9 additions & 12 deletions .github/workflows/darwin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,18 @@ jobs:
# target versions instead?
run: |
mkdir -p /tmp/darwin/framework-tests
../../../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) &
echo "This is a simple log" > /tmp/darwin/framework-tests/end_user_support_log.txt
../../../out/debug/chip-all-clusters-app --interface-id -1 --end_user_support_log /tmp/darwin/framework-tests/end_user_support_log.txt > >(tee /tmp/darwin/framework-tests/all-cluster-app.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-err.log >&2) &
../../../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) &
# Disable BLE because the app does not have the permission to use
# it and that may crash the CI.
#
# -enableUndefinedBehaviorSanitizer instruments the code in Matter.framework,
# but to instrument the code in the underlying libCHIP we need to pass CHIP_IS_UBSAN=YES
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_UBSAN=YES 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)
# Disable BLE (CHIP_IS_BLE=NO) because the app does not have the permission to use it and that may crash the CI.
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)
# And the same thing, but with MTR_PER_CONTROLLER_STORAGE_ENABLED turned off, so we test that it does not break for now.
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_UBSAN=YES 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)
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)
# And the same thing, but with MTR_NO_AVAILABILITY not turned on. This requires -Wno-unguarded-availability-new to avoid availability errors.
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_UBSAN=YES 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)
# -enableThreadSanitizer instruments the code in Matter.framework,
# but to instrument the code in the underlying libCHIP we need to pass CHIP_IS_TSAN=YES
xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableThreadSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_TSAN=YES 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)
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)
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)
working-directory: src/darwin/Framework
- name: Build Matter TV Casting Bridge
run: |
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,10 @@ jobs:
--known-failure app/att-storage.h \
--known-failure app/CommandHandler.h \
--known-failure app/CommandHandlerInterface.h \
--known-failure app/CommandSender.h \
--known-failure app/CommandSenderLegacyCallback.h \
--known-failure app/CompatEnumNames.h \
--known-failure app/data-model/ListLargeSystemExtensions.h \
--known-failure app/EventHeader.h \
--known-failure app/EventLoggingTypes.h \
--known-failure app/InteractionModelHelper.h \
--known-failure app/ReadClient.h \
--known-failure app/ReadHandler.h \
--known-failure app/ReadPrepareParams.h \
--known-failure app/reporting/tests/MockReportScheduler.cpp \
Expand All @@ -117,7 +113,6 @@ jobs:
--known-failure app/util/attribute-table.h \
--known-failure app/util/binding-table.cpp \
--known-failure app/util/binding-table.h \
--known-failure app/util/common.h \
--known-failure app/util/config.h \
--known-failure app/util/DataModelHandler.cpp \
--known-failure app/util/DataModelHandler.h \
Expand All @@ -132,7 +127,6 @@ jobs:
--known-failure app/util/odd-sized-integers.h \
--known-failure app/util/util.cpp \
--known-failure app/util/util.h \
--known-failure app/WriteClient.h \
--known-failure app/WriteHandler.h \
--known-failure lib/core/CHIPVendorIdentifiers.hpp \
--known-failure platform/DeviceSafeQueue.cpp \
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/spell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,20 @@ on:
- ".github/.wordlist.txt"

jobs:
check-reviewdog:
name: Check Spelling - reviewdog
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: reviewdog/action-misspell@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Seems redundant; removed as pyspelling is customized while this is not
# check-reviewdog:
# name: Check Spelling - reviewdog
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - uses: reviewdog/action-misspell@v1
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
check-spellcheck:
name: Check Spelling - pyspelling
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: igsekor/[email protected]
- uses: rojopolis/[email protected]
1 change: 1 addition & 0 deletions .spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@ matrix:
- '**/*.md|!third_party/**|!examples/common/**/repo/**|!docs/ERROR_CODES.md|!docs/clusters.md|!docs/testing/yaml_schema.md|!docs/testing/yaml_pseudocluster.md'
aspell:
ignore-case: true
camel-case: true
2 changes: 2 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
deps += [
"${chip_root}/src/app/server/java",
"${chip_root}/src/controller/java",
"${chip_root}/src/controller/java:jsontlv",
"${chip_root}/src/controller/java:onboarding_payload",
"${chip_root}/src/controller/java:tlv",
"${chip_root}/src/platform/android:java",
]
}
Expand Down
55 changes: 3 additions & 52 deletions build/chip/chip_codegen.gni
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ template("_chip_build_time_zapgen") {
_output_subdir = "zap-generated"
}

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

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

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

sources = [ _idl_file ]

outputs = []
foreach(name, invoker.outputs) {
outputs += [ "${target_gen_dir}/zap_pregen/${name}" ]
}

forward_variables_from(invoker, [ "prune_outputs" ])
if (defined(prune_outputs)) {
foreach(name, prune_outputs) {
outputs += [ "${target_gen_dir}/zap_pregen/${name}" ]
}
}
}

# This action ensures that any "extra" files generated by zap codegen
# are actually deleted.
#
# This is to avoid double-codegen of configurations like endpoint config
# or access credentials being generated for both "controller client" and
# application-specific
pw_python_action("${_name}_files") {
# TODO: this seems to touch internals. Is this ok? speeds up builds!
_pw_internal_run_in_venv = false

script = "${chip_root}/scripts/tools/zap/prune_outputs.py"

_keep_file = rebase_path("${target_gen_dir}/${_name}.keep.outputs")
write_file(_keep_file, invoker.outputs, "list lines")

args = [
"--keep",
_keep_file,
"--input-dir",
rebase_path("${target_gen_dir}/zap_pregen/"),
"--output-dir",
rebase_path("${target_gen_dir}/zapgen/"),
]

inputs = []
foreach(name, invoker.outputs) {
inputs += [ "${target_gen_dir}/zap_pregen/${name}" ]
}

outputs = []
foreach(name, invoker.outputs) {
outputs += [ "${target_gen_dir}/zapgen/${name}" ]
}

deps = [ ":${_name}_zap_pregen" ]
}

source_set(_name) {
Expand All @@ -255,10 +211,7 @@ template("_chip_build_time_zapgen") {
if (!defined(public_deps)) {
public_deps = []
}
public_deps += [
":${_name}_files",
":${_name}_zap_pregen",
]
public_deps += [ ":${_name}_zap" ]
}
}

Expand Down Expand Up @@ -420,7 +373,6 @@ template("chip_zapgen") {
"input",
"outputs",
"public_configs",
"prune_outputs",
])
}
} else {
Expand Down Expand Up @@ -482,7 +434,6 @@ template("chip_zapgen") {
[
"deps",
"public_configs",
"prune_outputs",
])
if (!defined(public_configs)) {
public_configs = []
Expand Down
5 changes: 5 additions & 0 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,16 @@ declare_args() {
}

config("sanitize_address") {
defines = []
cflags = [
"-fsanitize=address",
"-fno-omit-frame-pointer",
]
ldflags = cflags

if (target_os == "mac" || target_os == "ios") {
defines += [ "_LIBCPP_HAS_NO_ASAN" ]
}
}

config("sanitize_thread") {
Expand Down
Loading

0 comments on commit 20046dd

Please sign in to comment.