Skip to content

scripts: uuid-registry: only write header when content changes - #11154

Merged
kv2019i merged 1 commit into
thesofproject:mainfrom
kv2019i:202609-fix-incremental-builds
Sep 3, 2026
Merged

scripts: uuid-registry: only write header when content changes#11154
kv2019i merged 1 commit into
thesofproject:mainfrom
kv2019i:202609-fix-incremental-builds

Conversation

@kv2019i

@kv2019i kv2019i commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

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.

Copilot AI lite review requested due to automatic review settings September 2, 2026 08:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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.

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
kv2019i force-pushed the 202609-fix-incremental-builds branch from 7ca1a61 to bd19c6d Compare September 3, 2026 11:37
@kv2019i

kv2019i commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

V2;

  • rebased, no changes otherwise
  • should pass all CI now as SOF mainline has fix to win-linux compare

@intel-sofci

Copy link
Copy Markdown

PR 11154: test results

Run date: 2026-09-03 12:09 UTC

Tested commit: bd19c6da93b98af7accf4b0402d25c5e148adbd4

mtl pass rate lnl pass rate ptl pass rate wcl pass rate nvl pass rate

@kv2019i

kv2019i commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

Fuzzer fails are known #11162 , rest is good, proceeding with merge.

@kv2019i
kv2019i merged commit 4621880 into thesofproject:main Sep 3, 2026
44 of 46 checks passed
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.

5 participants