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

tfm related build rebuild even if nothing changes #36101

Closed
galak opened this issue Jun 9, 2021 · 0 comments · Fixed by #36183
Closed

tfm related build rebuild even if nothing changes #36101

galak opened this issue Jun 9, 2021 · 0 comments · Fixed by #36183
Assignees
Labels
area: Build System area: Trusted Execution Trusted Execution bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug

Comments

@galak
Copy link
Collaborator

galak commented Jun 9, 2021

Doing a repeated make will rebuild files even if nothing changes for a tfm board target:

cd samples/hello_world/build
cmake -DBOARD=lpcxpresso55s69_ns ..
make
make
@galak galak added bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug area: Build System area: Trusted Execution Trusted Execution labels Jun 9, 2021
tejlmand added a commit to tejlmand/zephyr that referenced this issue Jun 11, 2021
Fixes: zephyrproject-rtos#36101

The move of CMake invocation to a dedicated custom target, see zephyrproject-rtos#34868
results in tfm_cmake to always be considered out-of-date, causing CMake
to be reinvoked in the TF-M Binary dir, which again results in the
build command to rebuild.

This commit moves the invocation to a custom command with the
CMakeCache.txt as output. The custom target tfm_cmake is updated to
depend on CMakeCache.txt.

This mean that CMake for TF-M will only be invoked inside the Zephyr
build command if that file is missing.

If the CMakeCache.txt file is updated or TF-M CMake or source code is
modified, then the build command inside the TF-M build folder will
ensure correct re-run of CMake from within the TF-M build folder.

This ensures that TF-M will still rebuild if TF-M code is modified,
while at the same time avoid unnecessary rebuilds of TF-M code.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
galak pushed a commit that referenced this issue Jun 11, 2021
Fixes: #36101

The move of CMake invocation to a dedicated custom target, see #34868
results in tfm_cmake to always be considered out-of-date, causing CMake
to be reinvoked in the TF-M Binary dir, which again results in the
build command to rebuild.

This commit moves the invocation to a custom command with the
CMakeCache.txt as output. The custom target tfm_cmake is updated to
depend on CMakeCache.txt.

This mean that CMake for TF-M will only be invoked inside the Zephyr
build command if that file is missing.

If the CMakeCache.txt file is updated or TF-M CMake or source code is
modified, then the build command inside the TF-M build folder will
ensure correct re-run of CMake from within the TF-M build folder.

This ensures that TF-M will still rebuild if TF-M code is modified,
while at the same time avoid unnecessary rebuilds of TF-M code.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Build System area: Trusted Execution Trusted Execution bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants