scripts: uuid-registry: only write header when content changes - #11154
Merged
Conversation
kv2019i
requested review from
dbaluta,
lbetlej,
lgirdwood,
mmaka1 and
plbossart
as code owners
September 2, 2026 08:20
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change is localized, preserves the generated output format, and prevents unnecessary rebuilds by avoiding no-op rewrites.
Pull request overview
Updates gen-uuid-reg.py to avoid rewriting the generated uuid-registry.h when the output would be identical, preventing unnecessary timestamp changes that cascade into widespread incremental rebuilds (since the header is force-included into many translation units).
Changes:
- Build the full generated header content as a single string (
new_content). - Compare against the existing output file and return early when unchanged.
- Write the header in a single
f.write()when an update is needed.
File summaries
| File | Description |
|---|---|
| scripts/gen-uuid-reg.py | Avoids unconditional rewrites of the generated UUID registry header to improve incremental build performance. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
abonislawski
approved these changes
Sep 2, 2026
lyakh
approved these changes
Sep 3, 2026
Every invocation of gen-uuid-reg.py rewrites uuid-registry.h with open(..., "w"), updating the file's mtime even when the generated content was byte-for-byte identical. The uuid-registry.cmake custom command that runs this script executes on every build (it is wired into zephyr_interface via the uuid_reg_h target), and the header is force-included with -imacros into nearly every SOF translation unit. As a result, incremental builds in practise rebuild all objects even if no code is changed. Fix incremental builds by only updating uuid-registery if the content changes. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
kv2019i
force-pushed
the
202609-fix-incremental-builds
branch
from
September 3, 2026 11:37
7ca1a61 to
bd19c6d
Compare
Collaborator
Author
|
V2;
|
PR 11154: test resultsRun date: 2026-09-03 12:09 UTC Tested commit: bd19c6da93b98af7accf4b0402d25c5e148adbd4 |
Collaborator
Author
|
Fuzzer fails are known #11162 , rest is good, proceeding with merge. |
This file contains hidden or 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
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.
Every invocation of gen-uuid-reg.py rewrites uuid-registry.h with open(..., "w"), updating the file's mtime even when the generated content was byte-for-byte identical. The uuid-registry.cmake custom command that runs this script executes on every build (it is wired into zephyr_interface via the uuid_reg_h target), and the header is force-included with -imacros into nearly every SOF translation unit. As a result, incremental builds in practise rebuild all objects even if no code is changed.
Fix incremental builds by only updating uuid-registery if the content changes.