Skip to content

cmake: snippets: skip snippets.py when SNIPPET is unset#103709

Draft
gudnimg wants to merge 1 commit intozephyrproject-rtos:mainfrom
gudnimg:snippets-gudni
Draft

cmake: snippets: skip snippets.py when SNIPPET is unset#103709
gudnimg wants to merge 1 commit intozephyrproject-rtos:mainfrom
gudnimg:snippets-gudni

Conversation

@gudnimg
Copy link
Contributor

@gudnimg gudnimg commented Feb 7, 2026

When SNIPPET is not set, no snippets are applied but snippets.py still runs. Skip invoking it to avoid Python import overhead (~140 ms on my end).

Just an idea to speed up build configuration time. My understanding is that if SNIPPET is not defined, then no snippets are required for the build. https://docs.zephyrproject.org/latest/build/snippets/using.html

Tested using: west build --pristine always --board nrf52dk/nrf52832 samples/basic/blinky --cmake -- --profiling-format=google-trace --profiling-output=cmake-configure-trace.json

Before (141.6ms):

image

After(1.1ms):

image
When SNIPPET is not set, no snippets are applied but snippets.py still runs
Skip invoking it to avoid Python import overhead (~140 ms on my end).

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
Copy link
Contributor

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

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

Same comment as in #103718 (review)

@gudnimg gudnimg marked this pull request as draft February 14, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

5 participants