Skip to content

Switch to dynamic zap generation - #68

Open
ArekBalysNordic wants to merge 5 commits into
nrfconnect:mainfrom
ArekBalysNordic:codegen_dynamic
Open

ArekBalysNordic wants to merge 5 commits into
nrfconnect:mainfrom
ArekBalysNordic:codegen_dynamic

Conversation

@ArekBalysNordic

Copy link
Copy Markdown
Collaborator

See commit messages for details.

@ArekBalysNordic
ArekBalysNordic requested review from a team as code owners September 18, 2026 09:40
@github-actions

Copy link
Copy Markdown

You can find the documentation preview for this PR here.

Preview links for modified Matter add-on documents:

@ArekBalysNordic
ArekBalysNordic force-pushed the codegen_dynamic branch 3 times, most recently from 0482e6f to 9dfae28 Compare September 18, 2026 11:41
Comment thread docs/migration/migration_guide_110.rst Outdated

On the first build of a sample, the build system downloads and installs the ZAP tool into the Matter SDK :file:`.zap-install` directory.
This happens automatically when :kconfig:option:`CONFIG_MATTER_ZAP_CLI_INSTALL_PATH` is empty and ``zap-cli`` is not already available on :envvar:`PATH`.
The download runs once per Matter SDK revision. Later builds reuse the installed tool.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The download runs once per Matter SDK revision. Later builds reuse the installed tool.
The download runs once for each Matter SDK revision.
Later builds reuse the installed tool.

Comment thread docs/migration/migration_guide_110.rst Outdated
Comment on lines +129 to +130
* :ref:`ug_matter_gs_tools_matter_west_commands_zap_tool_gui` — edit the :file:`.zap` file.
* :ref:`ug_matter_gs_tools_matter_west_commands_zap_tool_generate` — generate the :file:`zap-generated/` directory.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* :ref:`ug_matter_gs_tools_matter_west_commands_zap_tool_gui` — edit the :file:`.zap` file.
* :ref:`ug_matter_gs_tools_matter_west_commands_zap_tool_generate` — generate the :file:`zap-generated/` directory.
* :ref:`ug_matter_gs_tools_matter_west_commands_zap_tool_gui` - Edit the :file:`.zap` file.
* :ref:`ug_matter_gs_tools_matter_west_commands_zap_tool_generate` - Generate the :file:`zap-generated/` directory.

Comment thread docs/migration/migration_guide_110.rst Outdated

west zap-generate

Generated files are written to :file:`zap-generated/` next to the :file:`.zap` file unless you pass ``--output``.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Generated files are written to :file:`zap-generated/` next to the :file:`.zap` file unless you pass ``--output``.
The generated files are written to :file:`zap-generated/` next to the :file:`.zap` file unless you pass ``--output``.

Comment thread docs/migration/migration_guide_110.rst Outdated

.. note::

When using static generation, you are responsible for re-running ``west zap-generate`` after every :file:`.zap` change and for keeping the generated files in version control.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When using static generation, you are responsible for re-running ``west zap-generate`` after every :file:`.zap` change and for keeping the generated files in version control.
When using static generation, you are responsible for re-running ``west zap-generate`` after every change in the :file:`.zap` and for keeping the generated files in version control.

Comment thread docs/migration_guides.rst Outdated
The |addon| provides migration notes for major releases to assist your transition from the previous release.

.. note::
While we strive to document all breaking changes, the migration guides might not include the detailed migration steps for your use case.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
While we strive to document all breaking changes, the migration guides might not include the detailed migration steps for your use case.
While all breaking changes are documented, the migration guides might not include the detailed migration steps for your use case.

Comment thread docs/migration_guides.rst Outdated
Comment on lines +3 to +4
Migration notes
################

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Migration notes
################
Migration notes
###############

Relocate chip_codegen_static.cmake and chip_data_model_static.cmake
into the ncs-matter cmake directory so Nordic build-time ZAP generation
lives in the add-on rather than the Matter SDK fork.

Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
Run zap_install.py during CMake configure to ensure zap-cli
matching the version required by the Matter SDK is available,
then symlink it next to the Python interpreter used for the build
(already on PATH for the whole west build session) so build-time
ZAP generation can find it. MATTER_ZAP_CLI_INSTALL_PATH can
still be set to point at a preinstalled zap-cli directory
instead of auto-installing.

Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
- Set the MATTER_ZAP_GENERATION_MODE to BUILD_TIME by default
- Align scripts to this change

Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
The zap-generated files are not needed because we switched to
the build-time zap file generation.

Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
- Added migration guide entry

Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants