-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmake: dts: Use temporary file for dts.cmake #81340
base: main
Are you sure you want to change the base?
Conversation
nordicjm
commented
Nov 13, 2024
•
edited
Loading
edited
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temporary blocking to allow further tests / investigations.
f230669
to
43cac1d
Compare
cmake/modules/dts.cmake
Outdated
# A temporary file is used copied to the original file if it differs, this prevents a cycle when | ||
# sysbuild is used of configuring and building multiple times due to the dts.cmake file of images | ||
# having a newer modification time than the sysbuild build.ninja file, despite the output having | ||
# not changed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general this is not only tied to sysbuild.
Touching any file during CMake configure time can trigger additional build steps later.
Build steps which may be unnecessary if there are no changes to the configure time generated file.
This may not only be related to dts.cmake, but can be true for other files created at configure time.
Therefore this is not fixing a sysbuild issue, sysbuild just happens to be impacted more by this fact than other parts of the system.
Long term a more general handling of such cases would be nice so that we don't regenerate a file in the first place instead of having to generate, compare and move.
Uses a temporary file for dts output then uses CMake to copy to the correct file if it has changed. This prevents a ping-pong issue when sysbuild is used of configuring and building cycle when nothing has changed and there is sysbuild code which loads in the devicetree data from an image Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>