Skip to content

Commit e22a780

Browse files
tejlmandcarlescufi
authored andcommitted
[nrf temphack]: Limit number of parallel jobs for TF-M build to 1
Fixes: NCSDK-10008 Set number of parallel jobs for TF-M build to 1. In some circumstances it has been experienced that building TF-M with multiple parallel jobs then `permission denied` may occur. Root cause on Windows has not been identified but current suspicion is around folder / file lock mechanism. To ensure correct behaviour in all cases, limit number of parallel jobs to 1. This issue is especially experienced when building TF-M through SES-NE. This fix should be reverted when the root cause has been identified and fixed. Signed-off-by: Torsten Rasmussen <[email protected]>
1 parent 829d32c commit e22a780

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

modules/trusted-firmware-m/CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,22 @@ function(trusted_firmware_build)
224224

225225
include(ExternalProject)
226226

227+
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL Windows)
228+
# Set number of parallel jobs for TF-M build to 1.
229+
# In some circumstances it has been experienced that building TF-M with
230+
# multiple parallel jobs then `permission denied` may occur. Root cause on
231+
# Windows has not been identified but current suspicion is around folder /
232+
# file lock mechanism. To ensure correct behaviour in all cases, limit
233+
# number of parallel jobs to 1.
234+
set(PARALLEL_JOBS -j 1)
235+
endif()
236+
227237
ExternalProject_Add(
228238
tfm
229239
SOURCE_DIR ${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/trusted-firmware-m
230240
BINARY_DIR ${TFM_BINARY_DIR}
231241
CONFIGURE_COMMAND ""
232-
BUILD_COMMAND ${CMAKE_COMMAND} --build .
242+
BUILD_COMMAND ${CMAKE_COMMAND} --build . ${PARALLEL_JOBS}
233243
INSTALL_COMMAND ${CMAKE_COMMAND} --install .
234244
BUILD_ALWAYS True
235245
USES_TERMINAL_BUILD True

0 commit comments

Comments
 (0)