-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add zap gen for Matter access privilege definitions #16327
Merged
mlepage-google
merged 21 commits into
project-chip:master
from
mlepage-google:gen-matter-access
Mar 23, 2022
Merged
Add zap gen for Matter access privilege definitions #16327
mlepage-google
merged 21 commits into
project-chip:master
from
mlepage-google:gen-matter-access
Mar 23, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZAPT file iterates over access definitions for app server clusters, for attributes/commands/events, to generate parallel arrays of custom privileges for read/write attribute, invoke command, and read event. These are generated and built per-app, and linked in by the library's RequiredPrivilege module. Weak implementations provide an empty default (needed for testing). Fixes project-chip#14419
pullapprove
bot
requested review from
anush-apple,
austinh0,
Byungjoo-Lee,
bzbarsky-apple,
carol-apple,
chrisdecenzo,
chshu,
chulspro,
Damian-Nordic,
dhrishi,
electrocucaracha,
emargolis,
erjiaqing,
franck-apple,
gjc13,
harimau-qirex,
hawk248,
harsha-rajendran,
isiu-apple,
jelderton,
jepenven-silabs,
jmartinez-silabs,
kpschoedel,
lazarkov,
LuDuda,
lzgrablic02,
msandstedt and
robszewczyk
March 16, 2022 19:46
Use chip_server_cluster_attributes and all_incoming_commands_for_cluster so only enabled attributes and commands have access generated.
PR #16327: Size comparison from 7d1256f to 2b76e44 Increases (17 builds for efr32, esp32, linux, p6)
Decreases (20 builds for cyw30739, esp32, k32w, linux, mbed, nrfconnect, telink)
Full report (27 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
PR #16327: Size comparison from a72ab9b to 328667f Increases (14 builds for esp32, linux, p6)
Decreases (21 builds for cyw30739, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
Full report (27 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
More conservative defaults if real implementations are not linked in.
PR #16327: Size comparison from a72ab9b to 0004383 Increases (11 builds for efr32, linux, p6)
Decreases (20 builds for cyw30739, k32w, linux, mbed, nrfconnect, p6, telink)
Full report (25 builds for cyw30739, efr32, k32w, linux, mbed, nrfconnect, p6, telink)
|
CI is failing because my zap regen all used my query ORDER BY change but it's not upstream yet. |
This was referenced Mar 22, 2022
This requires including the API header from the generated header, as well as including the generated header from the API implementation file. But it allows the static_asserts to be removed.
bzbarsky-apple
approved these changes
Mar 23, 2022
PR #16327: Size comparison from b24efd9 to a6dd001 Increases (15 builds for efr32, esp32, linux, p6)
Decreases (22 builds for cyw30739, efr32, k32w, linux, mbed, nrfconnect, p6, telink)
Full report (27 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
andrei-menzopol
pushed a commit
to andrei-menzopol/connectedhomeip
that referenced
this pull request
Apr 14, 2022
New zap template iterates over access definitions for app server clusters, for attributes/commands/events, to generate parallel arrays of custom privileges for read/write attribute, invoke command, and read event. New privilege storage source files provide an API to access the generated data, and an implementation using the generated data. The data is generated and the storage is built per-app. The library (DM, IM, app common) RequiredPrivilege module now uses the privilege-storage API to access populated data on a per-app basis. Weak implementations of the privilege storage API provide a default implementation lacking generated data, so test artifacts can be built. Fixes project-chip#14419
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Data is not generated for access privileges.
Issue #14419
Change overview
New zap template iterates over access definitions for app server
clusters, for attributes/commands/events, to generate parallel arrays of
custom privileges for read/write attribute, invoke command, and read
event.
New privilege storage source files provide an API to access the generated
data, and an implementation using the generated data.
The data is generated and the storage is built per-app.
The library (DM, IM, app common) RequiredPrivilege module now uses the
privilege-storage API to access populated data on a per-app basis. Weak
implementations of the privilege storage API provide a default implementation
lacking generated data, so test artifacts can be built.
Fixes #14419
Testing