Skip to content

Commit 964d460

Browse files
committed
Updated target names and output directories for unified builds in the CI workflow
1 parent 6b7d842 commit 964d460

File tree

4 files changed

+58
-55
lines changed

4 files changed

+58
-55
lines changed

.github/workflows/tests.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -661,30 +661,30 @@ jobs:
661661
run: |
662662
./scripts/run_in_build_env.sh \
663663
"./scripts/build/build_examples.py \
664-
--target linux-x64-light-${BUILD_VARIANT}-tsan-clang-test-unified-no-read-client \
665-
--target linux-x64-light-data-model-no-unique-id-${BUILD_VARIANT}-clang-unified-no-read-client \
666-
--target linux-x64-energy-management-${BUILD_VARIANT}-tsan-clang-test-unified-no-read-client \
667-
--target linux-x64-jf-admin-app-unified-no-read-client \
664+
--target linux-x64-light-no-read-client-${BUILD_VARIANT}-tsan-clang-test-unified \
665+
--target linux-x64-light-data-model-no-unique-id-no-read-client-${BUILD_VARIANT}-clang-unified \
666+
--target linux-x64-energy-management-no-read-client-${BUILD_VARIANT}-tsan-clang-test-unified \
667+
--target linux-x64-jf-admin-app-no-read-client-unified \
668668
--pw-command-launcher=ccache \
669669
build \
670670
--copy-artifacts-to objdir-clone \
671671
"
672672
rm -rf out/unified-no-read-client
673673
674-
- name: Build apps for REPL tests with rpc-json unified build
674+
- name: Build apps for REPL tests with RPC unified build
675675
env:
676676
CCACHE_DIR: "${{ github.workspace }}/.ccache"
677677
run: |
678678
./scripts/run_in_build_env.sh \
679679
"./scripts/build/build_examples.py \
680-
--target linux-x64-fabric-admin-rpc-${BUILD_VARIANT}-clang-unified-rpc-json \
681-
--target linux-x64-fabric-bridge-rpc-${BUILD_VARIANT}-clang-unified-rpc-json \
682-
--target linux-x64-jf-control-app-unified-rpc-json \
680+
--target linux-x64-fabric-admin-rpc-${BUILD_VARIANT}-clang-unified \
681+
--target linux-x64-fabric-bridge-rpc-${BUILD_VARIANT}-clang-unified \
682+
--target linux-x64-jf-control-app-rpc-unified \
683683
--pw-command-launcher=ccache \
684684
build \
685685
--copy-artifacts-to objdir-clone \
686686
"
687-
rm -rf out/unified-rpc-json
687+
rm -rf out/unified-rpc
688688
689689
- name: Build linux-x64-all-clusters
690690
env:
@@ -816,23 +816,23 @@ jobs:
816816
echo "CHIP_LOCK_APP: objdir-clone/linux-x64-lock-${BUILD_VARIANT}-tsan-clang-test-unified/chip-lock-app" >> /tmp/test_env.yaml
817817
echo "CAMERA_APP: objdir-clone/linux-x64-camera/chip-camera-app" >> /tmp/test_env.yaml
818818
echo "CAMERA_CONTROLLER_APP: objdir-clone/linux-x64-camera-controller/chip-camera-controller" >> /tmp/test_env.yaml
819-
echo "ENERGY_MANAGEMENT_APP: objdir-clone/linux-x64-energy-management-${BUILD_VARIANT}-tsan-clang-test-unified-no-read-client/chip-energy-management-app" >> /tmp/test_env.yaml
819+
echo "ENERGY_MANAGEMENT_APP: objdir-clone/linux-x64-energy-management-no-read-client-${BUILD_VARIANT}-tsan-clang-test-unified/chip-energy-management-app" >> /tmp/test_env.yaml
820820
echo "ENERGY_GATEWAY_APP: objdir-clone/linux-x64-energy-gateway-${BUILD_VARIANT}-tsan-clang-test/chip-energy-gateway-app" >> /tmp/test_env.yaml
821821
echo "LIT_ICD_APP: objdir-clone/linux-x64-lit-icd-${BUILD_VARIANT}-tsan-clang-test/lit-icd-app" >> /tmp/test_env.yaml
822822
echo "AIR_PURIFIER_APP: objdir-clone/linux-x64-air-purifier-${BUILD_VARIANT}-tsan-clang-test-unified/chip-air-purifier-app" >> /tmp/test_env.yaml
823823
echo "CHIP_MICROWAVE_OVEN_APP: objdir-clone/linux-x64-microwave-oven-${BUILD_VARIANT}-tsan-clang-test-unified/chip-microwave-oven-app" >> /tmp/test_env.yaml
824824
echo "CHIP_RVC_APP: objdir-clone/linux-x64-rvc-${BUILD_VARIANT}-tsan-clang-test-unified/chip-rvc-app" >> /tmp/test_env.yaml
825825
echo "NETWORK_MANAGEMENT_APP: objdir-clone/linux-x64-network-manager-${BUILD_VARIANT}-tsan-clang-test/matter-network-manager-app" >> /tmp/test_env.yaml
826-
echo "FABRIC_ADMIN_APP: objdir-clone/linux-x64-fabric-admin-rpc-${BUILD_VARIANT}-clang-unified-rpc-json/fabric-admin" >> /tmp/test_env.yaml
827-
echo "FABRIC_BRIDGE_APP: objdir-clone/linux-x64-fabric-bridge-rpc-${BUILD_VARIANT}-clang-unified-rpc-json/fabric-bridge-app" >> /tmp/test_env.yaml
826+
echo "FABRIC_ADMIN_APP: objdir-clone/linux-x64-fabric-admin-rpc-${BUILD_VARIANT}-clang-unified/fabric-admin" >> /tmp/test_env.yaml
827+
echo "FABRIC_BRIDGE_APP: objdir-clone/linux-x64-fabric-bridge-rpc-${BUILD_VARIANT}-clang-unified/fabric-bridge-app" >> /tmp/test_env.yaml
828828
echo "FABRIC_SYNC_APP: objdir-clone/linux-x64-fabric-sync-${BUILD_VARIANT}-clang/fabric-sync" >> /tmp/test_env.yaml
829-
echo "LIGHTING_APP_NO_UNIQUE_ID: objdir-clone/linux-x64-light-data-model-no-unique-id-${BUILD_VARIANT}-clang-unified-no-read-client/chip-lighting-app" >> /tmp/test_env.yaml
829+
echo "LIGHTING_APP_NO_UNIQUE_ID: objdir-clone/linux-x64-light-data-model-no-unique-id-no-read-client-${BUILD_VARIANT}-clang-unified/chip-lighting-app" >> /tmp/test_env.yaml
830830
echo "TERMS_AND_CONDITIONS_APP: objdir-clone/linux-x64-terms-and-conditions/chip-terms-and-conditions-app" >> /tmp/test_env.yaml
831831
echo "OTA_PROVIDER_APP: objdir-clone/linux-x64-ota-provider-${BUILD_VARIANT}-tsan-clang-test/chip-ota-provider-app" >> /tmp/test_env.yaml
832832
echo "OTA_REQUESTOR_APP: objdir-clone/linux-x64-ota-requestor-${BUILD_VARIANT}-tsan-clang-test/chip-ota-requestor-app" >> /tmp/test_env.yaml
833833
echo "TRACE_APP: out/trace_data/app-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml
834-
echo "JF_CONTROL_APP: objdir-clone/linux-x64-jf-control-app-unified-rpc-json/jfc-app" >> /tmp/test_env.yaml
835-
echo "JF_ADMIN_APP: objdir-clone/linux-x64-jf-admin-app-unified-no-read-client/jfa-app" >> /tmp/test_env.yaml
834+
echo "JF_CONTROL_APP: objdir-clone/linux-x64-jf-control-app-rpc-unified/jfc-app" >> /tmp/test_env.yaml
835+
echo "JF_ADMIN_APP: objdir-clone/linux-x64-jf-admin-app-no-read-client-unified/jfa-app" >> /tmp/test_env.yaml
836836
echo "CLOSURE_APP: objdir-clone/linux-x64-closure-${BUILD_VARIANT}-tsan-clang-test-unified/closure-app" >> /tmp/test_env.yaml
837837
echo "WATER_LEAK_DETECTOR_APP: objdir-clone/linux-x64-water-leak-detector-${BUILD_VARIANT}-tsan-clang-test-unified/water-leak-detector-app" >> /tmp/test_env.yaml
838838
echo "PUSH_AV_SERVER: src/tools/push_av_server/server.py" >> /tmp/test_env.yaml

scripts/build/build/target.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def __init__(self, name, builder_class, **kwargs):
224224

225225
def isUnifiedBuild(self, parts: List[TargetPart]):
226226
"""Checks if the given parts combine into a unified build.
227-
227+
228228
Returns the unified group ID (e.g., 'main', 'no-read-client', 'rpc-json')
229229
if this is a unified build, or None otherwise.
230230
"""
@@ -475,8 +475,14 @@ def Create(self, name: str, runner, repository_path: str, output_prefix: str,
475475
unified_group = self.isUnifiedBuild(parts)
476476
if unified_group:
477477
# Use group-specific output directory
478+
# group2 = apps with chip_enable_read_client=false
479+
# group3 = apps with RPC enabled
478480
if unified_group == 'main':
479481
dir_name = 'unified-build'
482+
elif unified_group == 'group2':
483+
dir_name = 'unified-no-read-client'
484+
elif unified_group == 'group3':
485+
dir_name = 'unified-rpc'
480486
else:
481487
dir_name = f'unified-{unified_group}'
482488
builder.output_dir = os.path.join(output_prefix, dir_name)

scripts/build/build/targets.py

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,25 @@ def BuildHostTarget():
204204
target.AppendModifier('googletest', use_googletest=True).OnlyIfRe('-tests')
205205
target.AppendModifier('terms-and-conditions', terms_and_conditions_required=True)
206206
target.AppendModifier('webrtc', enable_webrtc=True)
207-
target.AppendModifier('unified', unified=True, unified_group='main').OnlyIfRe(
207+
208+
# Standalone modifiers
209+
target.AppendModifier('no-read-client', chip_enable_read_client=False)
210+
211+
# Unified build modifier - automatically selects compatible group
212+
# The unified_group is determined by the combination of other modifiers
213+
target.AppendModifier('unified', unified=True).OnlyIfRe(
208214
"-(" + "|".join([
209215
# keep-sorted start
210216
'air-purifier',
211217
'bridge',
212218
'closure',
219+
'energy-management',
220+
'fabric-admin',
221+
'fabric-bridge',
222+
'jf-admin-app',
223+
'jf-control-app',
213224
'light',
225+
'light-data-model-no-unique-id',
214226
'lock',
215227
'microwave-oven',
216228
'ota-provider',
@@ -220,23 +232,6 @@ def BuildHostTarget():
220232
'water-leak-detector',
221233
# keep-sorted end
222234
]) + ")-")
223-
224-
# Group 2: No Read Client unified builds
225-
target.AppendModifier('unified-no-read-client', unified=True, unified_group='no-read-client').OnlyIfRe(
226-
"-(" + "|".join([
227-
'energy-management',
228-
'jf-admin-app',
229-
'light',
230-
'light-data-model-no-unique-id',
231-
]) + ")-")
232-
233-
# Group 3: RPC with JSON logging unified builds
234-
target.AppendModifier('unified-rpc-json', unified=True, unified_group='rpc-json').OnlyIfRe(
235-
"-(" + "|".join([
236-
'fabric-admin',
237-
'fabric-bridge',
238-
'jf-control-app',
239-
]) + ")-").OnlyIfRe('-rpc')
240235

241236
return target
242237

scripts/build/builders/host.py

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ class HostApp(Enum):
9898
def UnifiedTargetName(self, unified_group='main'):
9999
"""
100100
Returns the target name to compile an app as a unified build (i.e. with the GN
101-
root set to ''). The unified_group parameter specifies which unified build
102-
group this app belongs to.
101+
root set to ''). The unified_group parameter is automatically determined based
102+
on build configuration.
103103
"""
104104
TARGETS = {
105105
'main': {
@@ -117,13 +117,13 @@ def UnifiedTargetName(self, unified_group='main'):
117117
HostApp.WATER_LEAK_DETECTOR: ":linux_water_leak_detector_app",
118118
# keep-sorted end
119119
},
120-
'no-read-client': {
120+
'group2': { # Apps with chip_enable_read_client=false
121121
HostApp.LIGHT: ":linux_lighting_app",
122122
HostApp.LIGHT_DATA_MODEL_NO_UNIQUE_ID: ":linux_lighting_app_no_unique_id",
123123
HostApp.ENERGY_MANAGEMENT: ":linux_energy_management_app",
124124
HostApp.JF_ADMIN: ":linux_jf_admin_app",
125125
},
126-
'rpc-json': {
126+
'group3': { # Apps with RPC enabled
127127
HostApp.FABRIC_ADMIN: ":linux_fabric_admin",
128128
HostApp.FABRIC_BRIDGE: ":linux_fabric_bridge_app",
129129
HostApp.JF_CONTROL: ":linux_jf_control_app",
@@ -415,16 +415,17 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE,
415415
use_googletest=False,
416416
enable_webrtc=False,
417417
terms_and_conditions_required: Optional[bool] = None, chip_enable_nfc_based_commissioning=None,
418-
unified=False,
419-
unified_group='main'
418+
chip_enable_read_client=True,
419+
unified=False
420420
):
421421
"""
422422
Construct a host builder.
423423
424424
Params (limited docs, documenting interesting ones):
425425
426426
- unified: build will happen in a SINGLE output directory instead of separated out
427-
into per-target directories. Directory name will be "unified"
427+
into per-target directories. The specific unified group is automatically
428+
determined based on build configuration (chip_enable_read_client, enable_rpcs, etc.)
428429
"""
429430

430431
# Unified builds use the top level root for compilation
@@ -450,23 +451,24 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE,
450451
self.extra_gn_options.append('chip_config_network_layer_ble=false')
451452
self.extra_gn_options.append('chip_enable_ble=false')
452453

454+
if not chip_enable_read_client:
455+
self.extra_gn_options.append('chip_enable_read_client=false')
456+
453457
if unified:
458+
# Auto-detect unified group based on build configuration
459+
if not chip_enable_read_client:
460+
unified_group = 'group2'
461+
elif enable_rpcs:
462+
unified_group = 'group3'
463+
else:
464+
unified_group = 'main'
465+
454466
self.extra_gn_options.append('target_os="all"')
455467
self.extra_gn_options.append('matter_enable_tracing_support=true')
456-
457-
# Apply group-specific GN args
458-
if unified_group == 'main':
459-
self.extra_gn_options.append('matter_log_json_payload_hex=true')
460-
self.extra_gn_options.append('matter_log_json_payload_decode_full=true')
461-
elif unified_group == 'no-read-client':
462-
self.extra_gn_options.append('chip_enable_read_client=false')
463-
self.extra_gn_options.append('matter_log_json_payload_hex=true')
464-
self.extra_gn_options.append('matter_log_json_payload_decode_full=true')
465-
elif unified_group == 'rpc-json':
466-
self.extra_gn_options.append('matter_log_json_payload_hex=true')
467-
self.extra_gn_options.append('matter_log_json_payload_decode_full=true')
468-
# RPC is enabled via enable_rpcs parameter, already handled above
469-
468+
# All unified builds use JSON logging for better debugging
469+
self.extra_gn_options.append('matter_log_json_payload_hex=true')
470+
self.extra_gn_options.append('matter_log_json_payload_decode_full=true')
471+
470472
self.build_command = app.UnifiedTargetName(unified_group)
471473

472474
if not enable_wifipaf:

0 commit comments

Comments
 (0)