fix(xbuild): fix incremental build of upydef files
What changed, and why it matters
This commit fixes a build-system bug where generated definition files were being rewritten on every build even when their contents had not changed, which broke incremental builds. It also corrects a related condition for generating dependency files. There is no indication this affects the security of Trezor devices or firmware at runtime.
No security action required; treat as a normal build-system fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change in cointool.py makes render_file() read the existing destination file and only write the rendered output if the content differs. Previously it always wrote the file and then restored the source’s mtime, which could confuse build tools that rely on content hashing or timestamp comparisons. The Rust change in compile.rs removes the OutputType::Object check so that .d dependency files are generated for C/C++ sources regardless of output type. Both changes are build-system correctness fixes for incremental builds; no runtime code or cryptographic behavior is modified.
Changed components
common/tools/cointool.pycore/embed/xbuild/src/clibrary/compile.rsInspect captured patch +0 / −0
Diff not available from the source API.Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.