Skip to content

Incremental build fails when new syscall is added #64729

Open
@nordic-krch

Description

@nordic-krch

Describe the bug
When using twister with --no-clean option it fails when new syscall is added between the builds. It seems that there are some cmake dependency issue that prevents regeneration of syscall header.

Please also mention any information which could help others to understand
the problem you're facing:

  • What target platform are you using?
  • What have you tried to diagnose or workaround this issue?
  • Is this a regression? If yes, have you been able to "git bisect" it to a
    specific commit?
  • ...

To Reproduce
Steps to reproduce the behavior:

  1. git checkout ac3a6d3721 checkout a commit just before the commit which adds new syscall
  2. scripts/twister -p nrf52840dk_nrf52840 -s samples/subsys/logging/logger/sample.logger.basic --no-clean
  3. git checkout 1a0e8d6f9e checkout commit which adds new syscall
  4. scripts/twister -p nrf52840dk_nrf52840 -s samples/subsys/logging/logger/sample.logger.basic --no-clean will fail due to syscall header not having a new call

Expected behavior
Build should succeed because syscall files shall be re-generated.

Impact
Cannot use --no-clean build in CI.

Additional context
Following patch helps but I'm no CMake expert so hard to say if that is a proper solution:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 15671fc8ad..5d3b433483 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -793,7 +793,7 @@ add_custom_command(OUTPUT include/generated/syscall_dispatch.c ${syscall_list_h}
   ${SYSCALL_LONG_REGISTERS_ARG}
   ${SYSCALL_SPLIT_TIMEOUT_ARG}
   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-  DEPENDS ${PARSE_SYSCALLS_TARGET}
+  DEPENDS ${syscalls_json} ${struct_tags_json}
   )

Metadata

Metadata

Labels

area: Build SystembugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

Status

To do

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions