Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nordicjm
Copy link
Collaborator

@nordicjm nordicjm commented Nov 13, 2024

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

Copy link
Collaborator

@tejlmand tejlmand left a 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.

@nordicjm nordicjm force-pushed the sbdtsfile branch 2 times, most recently from f230669 to 43cac1d Compare November 13, 2024 15:33
tejlmand
tejlmand previously approved these changes Nov 14, 2024
Comment on lines 352 to 355
# 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
Copy link
Collaborator

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.

cmake/modules/dts.cmake Outdated Show resolved Hide resolved
cmake/modules/dts.cmake Outdated Show resolved Hide resolved
@nordicjm nordicjm changed the title cmake: dts: Use temporary file for dts.cmake with sysbuild cmake: dts: Use temporary file for dts.cmake Nov 14, 2024
57300
57300 previously approved these changes Nov 14, 2024
tejlmand
tejlmand previously approved these changes Nov 14, 2024
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants