build: Track all syscall deps #96941
Draft
+109
−69
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When working on #96892 I noticed that in some places cmake is only tracking syscall deps for those under ${ZEPHYR_BASE}/include when in reality syscalls can come from a number of places including those defined by users.
This PR updates cmake dependencies to track all inputs used in syscall generation.
I was able to verify the issue by creating an external zephyr module driver. Repo steps are somewhat complicated, as mentioned in #96892 and #96881, git is funny and will do full file delete/adds when modifying a few lines.
Repo
Part A: Setup external module
git clone https://github.com/mark-inderhees/zephyr-module
git apply module.patch
Part B: Setup repo
cp samples/basic/blinky/src/main.c /tmp/main.c
git restore samples/basic/blinky/src/main.c
export ZEPHYR_EXTRA_MODULES=<your_path>/zephyr-module
west build -b nrf5340dk/nrf5340/cpuapp samples/basic/blinky -p always
cp /tmp/main.c samples/basic/blinky/src/main.c
west build -b nrf5340dk/nrf5340/cpuapp samples/basic/blinky
I verified the fix by replacing Part B step 1, checking out my branch
git checkout test-module
. This cherry-picks the blinky external driver integration on top of this PR's fix.