Skip to content

Commit

Permalink
Merge branch 'master' into subscription_resumption/session_retry
Browse files Browse the repository at this point in the history
  • Loading branch information
wqx6 authored Mar 5, 2024
2 parents 50e8f48 + 8a1c7aa commit e98e7f2
Show file tree
Hide file tree
Showing 302 changed files with 20,826 additions and 2,517 deletions.
7 changes: 7 additions & 0 deletions .github/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ EchoMessage
EchoRequests
EchoResponse
EchoService
ECW
edaf
edc
EDR
Expand Down Expand Up @@ -738,6 +739,7 @@ kCase
Kconfig
kDacPublicKey
KeypadInput
keypair
keyset
kGroup
kInvalidCommandId
Expand Down Expand Up @@ -884,6 +886,7 @@ mlan
MLD
mmevk
moal
Mobly
ModeSelect
modprobe
Modustoolbox
Expand Down Expand Up @@ -948,6 +951,7 @@ nrfdks
nrfutil
nrfxlib
NTAG
NTP
nullable
nullptr
NUM
Expand Down Expand Up @@ -1013,6 +1017,7 @@ OTBR
otcli
outform
outgoingCommands
overridable
OxygenConcentrationMeasurement
OzoneConcentrationMeasurement
PAA
Expand Down Expand Up @@ -1051,6 +1056,7 @@ perfetto
periodicQueryTimeout
pexpect
pickString
PICSCODE
PID
Pigweed
PinCode
Expand Down Expand Up @@ -1366,6 +1372,7 @@ TestGenExample
TestGroupDemoConfig
TestMultiRead
TestName
TestOnlySendCommandTimedRequestFlagWithNoTimedInvoke
TESTPASSWD
TestPICS
TESTSSID
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ jobs:
run: |
./scripts/run_in_build_env.sh "./scripts/codepregen.py ./zzz_pregenerated"
mv scripts/codegen.py scripts/codegen.py.renamed
mv scripts/tools/zap/generate.py scripts/tools/zap/generate.py.renamed
- name: Clean output
run: rm -rf ./out
- name: Build using build_examples.py (pregen)
Expand All @@ -234,18 +235,11 @@ jobs:
--pregen-dir ./zzz_pregenerated \
build \
"
- name: Check no code generation in output
run: |
CNT=$(find out -name "CHIPClusters.h" | wc -l)
if [ "${CNT}" != "0" ]; then
echo "ERROR: found unexpected generated files:"
find out -name "CHIPClusters.h"
exit 1
fi
- name: Undo code pre-generation changes (make compile time codegen work again)
run: |
rm -rf ./zzz_pregenerated
mv scripts/codegen.py.renamed scripts/codegen.py
mv scripts/tools/zap/generate.py.renamed scripts/tools/zap/generate.py
- name: Run fake linux tests with build_examples
run: |
./scripts/run_in_build_env.sh \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cirque.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
- name: Get Cirque Bootstrap cache key
id: cirque-bootstrap-cache-key
run: echo "val=$(scripts/tests/cirque_tests.sh cachekeyhash)" >> $GITHUB_OUTPUT
- uses: Wandalen/[email protected].4
- uses: Wandalen/[email protected].5
name: Cirque Bootstrap cache
if: ${{ !env.ACT }}
continue-on-error: true
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/darwin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ jobs:
- name: Validate zap-cli is NOT available
# run_in_build_env.sh is used to ensure PATH is set to something that would otherwise find zap-cli
run: scripts/run_in_build_env.sh '(zap-cli --version && exit 1) || exit 0'
- name: Run watchOS Build Debug
working-directory: src/darwin/Framework
# Disable availability annotations, since we are not building a system
# Matter.framework.
run: xcodebuild -target "Matter" -sdk watchos -configuration Debug GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
- name: Run iOS Build Debug
working-directory: src/darwin/Framework
# Disable availability annotations, since we are not building a system
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/examples-esp32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
run: |
./scripts/run_in_build_env.sh "./scripts/codepregen.py ./zzz_pregenerated"
mv scripts/codegen.py scripts/codegen.py.renamed
mv scripts/tools/zap/generate.py scripts/tools/zap/generate.py.renamed
- name: Clean output
run: rm -rf ./out
- name: Build some M5Stack variations with pregen
Expand All @@ -84,18 +85,11 @@ jobs:
build \
--copy-artifacts-to out/artifacts \
"
- name: Check no code generation in output
run: |
CNT=$(find out -name "CHIPClusters.h" | wc -l)
if [ "${CNT}" != "0" ]; then
echo "ERROR: found unexpected generated files:"
find out -name "CHIPClusters.h"
exit 1
fi
- name: Undo code pregeneration changes
run: |
rm -rf ./zzz_pregenerated
mv scripts/codegen.py.renamed scripts/codegen.py
mv scripts/tools/zap/generate.py.renamed scripts/tools/zap/generate.py
- name: Build example All Clusters App C3
run: scripts/examples/esp_example.sh all-clusters-app sdkconfig_c3devkit.defaults
- name: Copy aside build products
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Wandalen/[email protected].4
- uses: Wandalen/[email protected].5
name: Gradle Validation
continue-on-error: true
with:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ jobs:
--known-failure app/CommandHandlerInterface.h \
--known-failure app/CommandSenderLegacyCallback.h \
--known-failure app/data-model/ListLargeSystemExtensions.h \
--known-failure app/EventHeader.h \
--known-failure app/EventLoggingTypes.h \
--known-failure app/ReadHandler.h \
--known-failure app/ReadPrepareParams.h \
--known-failure app/reporting/tests/MockReportScheduler.cpp \
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,6 @@ jobs:
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-lit-icd-ipv6only-no-ble-no-wifi-tsan-clang-test/lit-icd-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_ICDM_2_1.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_IDM_1_2.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json --enable-key 000102030405060708090a0b0c0d0e0f" --script "src/python_testing/TC_IDM_1_4.py" --script-args "--hex-arg PIXIT.DGGEN.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_IDM_4_2.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_PWRTL_2_1.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_RR_1_1.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_SC_3_6.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
Expand Down
2 changes: 1 addition & 1 deletion .spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ matrix:
# converts markdown to HTML
- pyspelling.filters.markdown:
sources:
- '**/*.md|!third_party/**|!examples/common/**/repo/**|!docs/ERROR_CODES.md|!docs/clusters.md|!docs/testing/yaml_schema.md|!docs/testing/yaml_pseudocluster.md'
- '**/*.md|!third_party/**|!examples/common/**/repo/**|!docs/ERROR_CODES.md|!docs/clusters.md|!docs/testing/yaml_schema.md|!docs/testing/yaml_pseudocluster.md | !docs/testing/python.md | !docs/testing/ChipDeviceCtrlAPI.md'
aspell:
ignore-case: true
camel-case: true
110 changes: 76 additions & 34 deletions build/chip/chip_codegen.gni
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ template("_chip_build_time_codegen") {
_name = target_name
_generator = invoker.generator

config("${_name}_config") {
include_dirs = [ target_gen_dir ]
}

pw_python_action("${_name}_generate") {
script = "${chip_root}/scripts/codegen.py"

Expand Down Expand Up @@ -124,10 +120,6 @@ template("_chip_build_time_zapgen") {
_name = target_name
_generator = invoker.generator

config("${_name}_config") {
include_dirs = [ "${target_gen_dir}/zapgen/" ]
}

assert(_generator == "app-templates")

if (_generator == "app-templates") {
Expand Down Expand Up @@ -225,6 +217,9 @@ template("_chip_build_time_zapgen") {
# generator
# Name of the generator to use (e.g. java-jni, java-class, cpp-app)
#
# outputs MUST share the same directory prefix (e.g. 'app/' or 'tlv/meta'
# or 'jni')
#
# outputs
# Explicit names of the expected outputs. Enforced to validate that
# expected outputs are generated when processing input files.
Expand Down Expand Up @@ -265,7 +260,17 @@ template("_chip_build_time_zapgen") {
# ]
# }
#
# Guarantees a target named "${target_name}_generate" exists and contains all
# generated files (this works even in the case of using a pre-generated directory
# by using a copy target to import pre-generated data)
#
template("chip_codegen") {
_name = target_name

config("${_name}_config") {
include_dirs = [ target_gen_dir ]
}

if (chip_code_pre_generated_directory == "") {
_chip_build_time_codegen(target_name) {
forward_variables_from(invoker,
Expand All @@ -279,8 +284,6 @@ template("chip_codegen") {
])
}
} else {
_name = target_name

not_needed(invoker, [ "options" ])

# This constructs a path like:
Expand All @@ -292,8 +295,21 @@ template("chip_codegen") {
string_replace(rebase_path(invoker.input, chip_root), ".matter", "") +
"/codegen/" + invoker.generator

config("${_name}_config") {
include_dirs = [ "${_generation_dir}" ]
# Generation in this case just involves some files copying
copy("${_name}_generate") {
sources = []

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

# NOTE: we assume ALL outputs have a common subdir. This is generally the case with
# paths like "app/callback-stub.cpp" and "app/PluginApplicationCallbacks.h"
_outputs = invoker.outputs
_dir_name = get_path_info(_outputs[0], "dir")
outputs = [ "${target_gen_dir}/${_dir_name}/{{source_file_part}}" ]

public_configs = [ ":${_name}_config" ]
}

source_set(_name) {
Expand All @@ -302,13 +318,13 @@ template("chip_codegen") {
if (defined(invoker.public_configs)) {
public_configs += invoker.public_configs
}
sources = get_target_outputs(":${_name}_generate")

forward_variables_from(invoker, [ "deps" ])

sources = []
foreach(name, invoker.outputs) {
sources += [ "${_generation_dir}/${name}" ]
if (!defined(deps)) {
deps = []
}
deps += [ ":${_name}_generate" ]
}
}
}
Expand All @@ -327,6 +343,9 @@ template("chip_codegen") {
# Explicit names of the expected outputs. Enforced to validate that
# expected outputs are generated when processing input files.
#
# outputs MUST share the same directory prefix (e.g. 'app/' or 'tlv/meta'
# or 'jni')
#
# deps, public_configs
# Forwarded to the resulting source set
#
Expand All @@ -352,18 +371,28 @@ template("chip_codegen") {
#
# Example usage:
#
# chip_codegen("java-jni-generate") {
# input = "controller-clusters.matter"
# generator = "java-jni"
# chip_zapgen("controller-clusters-zap") {
# input = "controller-clusters.zap"
# generator = "app-templates"
#
# outputs = [
# "jni/IdentifyClient-ReadImpl.cpp",
# "jni/IdentifyClient-InvokeSubscribeImpl.cpp",
# # ... more to follow
# ]
# }
# outputs = [
# "zap-generated/access.h",
# "zap-generated/gen_config.h",
# "zap-generated/endpoint_config.h",
# ]
# }
#
# Guarantees a target named "${target_name}_generate" exists and contains all
# generated files (this works even in the case of using a pre-generated directory
# by using a copy target to import pre-generated data)
#
template("chip_zapgen") {
_name = target_name

config("${_name}_config") {
include_dirs = [ "${target_gen_dir}/zapgen/" ]
}

if (chip_code_pre_generated_directory == "") {
_chip_build_time_zapgen(target_name) {
forward_variables_from(invoker,
Expand All @@ -376,8 +405,6 @@ template("chip_zapgen") {
])
}
} else {
_name = target_name

# This contstructs a path like:
# FROM all-clusters-app.zap (inside examples/all-clusters-app/all-clusters-common/)
# USING "cpp-app" for generator:
Expand All @@ -387,10 +414,6 @@ template("chip_zapgen") {
string_replace(rebase_path(invoker.input, chip_root), ".zap", "") +
"/zap/" + invoker.generator

config("${_name}_config") {
include_dirs = [ "${_generation_dir}" ]
}

# Pick up only the headers and mark them available to use
# Specifically controller seems to require header files but NOT cpp (does)
# not want to include cpp compilation of IM command handler data
Expand Down Expand Up @@ -429,6 +452,23 @@ template("chip_zapgen") {
public_deps = [ ":${_name}_headers" ]
}

# Generation in this case just involves some files copying
copy("${_name}_generate") {
sources = []

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

# NOTE: we assume ALL outputs have a common subdir. This is generally the case with
# paths like "app/callback-stub.cpp" and "app/PluginApplicationCallbacks.h"
_outputs = invoker.outputs
_dir_name = get_path_info(_outputs[0], "dir")
outputs = [ "${target_gen_dir}/zapgen/${_dir_name}/{{source_file_part}}" ]

public_configs = [ ":${_name}_config" ]
}

source_set(_name) {
forward_variables_from(invoker,
[
Expand All @@ -440,10 +480,12 @@ template("chip_zapgen") {
}
public_configs += [ ":${_name}_config" ]

sources = []
foreach(name, invoker.outputs) {
sources += [ "${_generation_dir}/${name}" ]
if (!defined(public_deps)) {
public_deps = []
}
public_deps += [ ":${_name}_generate" ]

sources = get_target_outputs(":${_name}_generate")

# Ugly, but references WILL reference back into main code.
check_includes = false
Expand Down
Loading

0 comments on commit e98e7f2

Please sign in to comment.