Skip to content

Commit ce9f2a0

Browse files
Merge branch 'master' into tc-idm-4.3-(python)
2 parents e566592 + 20b1457 commit ce9f2a0

File tree

189 files changed

+12139
-2757
lines changed

Some content is hidden

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

189 files changed

+12139
-2757
lines changed

.github/workflows/build.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ jobs:
333333
scripts/run_in_build_env.sh 'virtualenv pyenv'
334334
source pyenv/bin/activate
335335
pip3 install -r src/setup_payload/python/requirements.txt
336-
python3 src/setup_payload/tests/run_python_setup_payload_gen_test.py out/chip-tool
336+
python3 src/setup_payload/tests/run_python_setup_payload_test.py out/chip-tool
337337
338338
build_linux_python_lighting_device:
339339
name: Build on Linux (python lighting-app)

.github/workflows/darwin.yaml

+4-9
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ jobs:
9797
bootstrap-logs-framework-${{ matrix.options.flavor }}
9898
- name: Build example All Clusters Server
9999
run: |
100-
scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug chip_config_network_layer_ble=false
100+
scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug/all-clusters-app chip_config_network_layer_ble=false
101101
- name: Build example OTA Provider
102102
run: |
103-
scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug chip_config_network_layer_ble=false
103+
scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug/ota-provider-app chip_config_network_layer_ble=false
104104
- name: Build example OTA Requestor
105105
run: |
106106
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
@@ -113,13 +113,8 @@ jobs:
113113
run: |
114114
mkdir -p /tmp/darwin/framework-tests
115115
echo "This is a simple log" > /tmp/darwin/framework-tests/end_user_support_log.txt
116-
../../../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) &
117-
../../../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-
../../../out/debug/chip-all-clusters-app --interface-id -1 --discriminator 101 --passcode 1001 --KVS /tmp/chip-all-clusters-app-kvs101 --secured-device-port 5531 &
119-
../../../out/debug/chip-all-clusters-app --interface-id -1 --discriminator 102 --passcode 1002 --KVS /tmp/chip-all-clusters-app-kvs102 --secured-device-port 5532 &
120-
../../../out/debug/chip-all-clusters-app --interface-id -1 --discriminator 103 --passcode 1003 --KVS /tmp/chip-all-clusters-app-kvs103 --secured-device-port 5533 &
121-
../../../out/debug/chip-all-clusters-app --interface-id -1 --discriminator 104 --passcode 1004 --KVS /tmp/chip-all-clusters-app-kvs104 --secured-device-port 5534 &
122-
../../../out/debug/chip-all-clusters-app --interface-id -1 --discriminator 105 --passcode 1005 --KVS /tmp/chip-all-clusters-app-kvs105 --secured-device-port 5535 &
116+
../../../out/debug/all-clusters-app/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) &
117+
../../../out/debug/all-clusters-app/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) &
123118
124119
export TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1
125120

.github/workflows/lint.yml

-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ jobs:
9898
--known-failure controller/ExamplePersistentStorage.cpp \
9999
--known-failure controller/ExamplePersistentStorage.h \
100100
--known-failure app/AttributeAccessToken.h \
101-
--known-failure app/CommandHandler.h \
102101
--known-failure app/CommandHandlerInterface.h \
103102
--known-failure app/CommandResponseSender.h \
104103
--known-failure app/CommandSenderLegacyCallback.h \

.github/workflows/minimal-build.yaml

+23-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ concurrency:
2626
cancel-in-progress: true
2727

2828
jobs:
29-
minimal:
29+
minimal-all-clusters:
3030
name: Linux / configure build of all-clusters-app
3131

3232
if: github.actor != 'restyled-io[bot]'
@@ -47,3 +47,25 @@ jobs:
4747
- name: Configure and build All Clusters App
4848
run: |
4949
CC=gcc CXX=g++ scripts/configure --project=examples/all-clusters-app/linux && ./ninja-build
50+
51+
minimal-network-manager:
52+
name: Linux / configure build of network-manager-app
53+
54+
if: github.actor != 'restyled-io[bot]'
55+
runs-on: ubuntu-latest
56+
57+
container:
58+
image: ghcr.io/project-chip/chip-build-minimal:50
59+
60+
steps:
61+
- name: Checkout
62+
uses: actions/checkout@v4
63+
64+
- name: Checkout submodules # but don't bootstrap!
65+
uses: ./.github/actions/checkout-submodules
66+
with:
67+
platform: linux
68+
69+
- name: Configure and build Network Manager App
70+
run: |
71+
CC=gcc CXX=g++ scripts/configure --project=examples/network-manager-app/linux && ./ninja-build

.github/workflows/tests.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ jobs:
189189
src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml \
190190
src/app/zap-templates/zcl/data-model/chip/washer-controls-cluster.xml \
191191
src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml \
192+
src/app/zap-templates/zcl/data-model/chip/wifi-network-management-cluster.xml \
192193
src/app/zap-templates/zcl/data-model/chip/window-covering.xml \
193194
src/app/zap-templates/zcl/data-model/chip/temperature-control-cluster.xml \
194195
src/app/zap-templates/zcl/data-model/chip/matter-devices.xml \

build/chip/linux/BUILD.gn

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020 Project CHIP Authors
1+
# Copyright (c) 2020-2024 Project CHIP Authors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -21,4 +21,5 @@ pkg_config("glib") {
2121
"glib-2.0",
2222
"gio-unix-2.0",
2323
]
24+
optional = true # Only certain conditionally-compiled modules depend on glib
2425
}

build/config/linux/pkg-config.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
3-
# Copyright (c) 2020 Project CHIP Authors
3+
# Copyright (c) 2020-2024 Project CHIP Authors
44
#
55
# Redistribution and use in source and binary forms, with or without
66
# modification, are permitted provided that the following conditions are
@@ -127,6 +127,7 @@ def RewritePath(path, strip_prefix, sysroot):
127127
def main():
128128
parser = OptionParser()
129129
parser.add_option('-d', '--debug', action='store_true')
130+
parser.add_option('-o', '--optional', action='store_true')
130131
parser.add_option('-p', action='store', dest='pkg_config', type='string',
131132
default='pkg-config')
132133
parser.add_option('-v', action='append', dest='strip_out', type='string')
@@ -209,6 +210,10 @@ def main():
209210
try:
210211
flag_string = subprocess.check_output(cmd).decode('utf-8')
211212
except Exception:
213+
if options.optional:
214+
sys.stderr.write('Ignoring failure to run pkg-config for optional library.\n')
215+
print(json.dumps([False])) # Output a GN array indicating missing optional packages
216+
return 0
212217
sys.stderr.write('Could not run pkg-config.\n')
213218
return 1
214219

@@ -248,10 +253,10 @@ def main():
248253
else:
249254
cflags.append(flag)
250255

251-
# Output a GN array, the first one is the cflags, the second are the libs. The
256+
# Output a GN array, indicating success and our output lists.
252257
# JSON formatter prints GN compatible lists when everything is a list of
253258
# strings.
254-
print(json.dumps([includes, cflags, libs, lib_dirs]))
259+
print(json.dumps([True, includes, cflags, libs, lib_dirs]))
255260
return 0
256261

257262

build/config/linux/pkg_config.gni

+33-23
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
2-
# Copyright (c) 2020 Project CHIP Authors
2+
# Copyright (c) 2020-2024 Project CHIP Authors
33
#
44
# Redistribution and use in source and binary forms, with or without
55
# modification, are permitted provided that the following conditions are
@@ -43,9 +43,14 @@
4343
#
4444
# You can also use "extra args" to filter out results (see pkg-config.py):
4545
# extra_args = [ "-v, "foo" ]
46+
#
4647
# To ignore libs and ldflags (only cflags/defines will be set, which is useful
4748
# when doing manual dynamic linking), set:
4849
# ignore_libs = true
50+
#
51+
# To allow the build to proceed if (any of) the requested packages are absent, set:
52+
# optional = true
53+
# In this case the resulting config object will be empty.
4954

5055
import("//build_overrides/build.gni")
5156
import("${build_root}/config/sysroot.gni")
@@ -109,37 +114,42 @@ template("pkg_config") {
109114
} else {
110115
args = pkg_config_args + invoker.packages
111116
}
117+
if (defined(invoker.optional) && invoker.optional) {
118+
args += [ "-o" ]
119+
}
112120
if (defined(invoker.extra_args)) {
113121
args += invoker.extra_args
114122
}
115123

124+
# pkgresult = [present, includes, cflags, libs, lib_dirs]
116125
pkgresult = exec_script(pkg_config_script, args, "value")
117-
cflags = pkgresult[1]
126+
if (pkgresult[0]) {
127+
cflags = pkgresult[2]
118128

119-
foreach(include, pkgresult[0]) {
120-
cflags += [ "-I$include" ]
121-
}
129+
foreach(include, pkgresult[1]) {
130+
cflags += [ "-I$include" ]
131+
}
122132

123-
if (!defined(invoker.ignore_libs) || !invoker.ignore_libs) {
124-
libs = pkgresult[2]
125-
lib_dirs = pkgresult[3]
126-
}
133+
if (!defined(invoker.ignore_libs) || !invoker.ignore_libs) {
134+
libs = pkgresult[3]
135+
lib_dirs = pkgresult[4]
136+
}
127137

128-
# Link libraries statically for OSS-Fuzz fuzzer build
129-
if (oss_fuzz) {
130-
libs = []
131-
ldflags = [ "-Wl,-Bstatic" ]
132-
foreach(lib, pkgresult[2]) {
133-
ldflags += [ "-l$lib" ]
138+
# Link libraries statically for OSS-Fuzz fuzzer build
139+
if (oss_fuzz) {
140+
libs = []
141+
ldflags = [ "-Wl,-Bstatic" ]
142+
foreach(lib, pkgresult[3]) {
143+
ldflags += [ "-l$lib" ]
144+
}
145+
ldflags += [ "-Wl,-Bdynamic" ]
146+
lib_dirs = pkgresult[4]
134147
}
135-
ldflags += [ "-Wl,-Bdynamic" ]
136-
lib_dirs = pkgresult[3]
137-
}
138148

139-
forward_variables_from(invoker,
140-
[
141-
"defines",
142-
"visibility",
143-
])
149+
forward_variables_from(invoker, [ "defines" ])
150+
}
144151
}
152+
153+
# Always forward visibility
154+
forward_variables_from(invoker, [ "visibility" ])
145155
}

0 commit comments

Comments
 (0)