Skip to content

Conversation

@crasbe
Copy link
Contributor

@crasbe crasbe commented Oct 22, 2025

Contribution description

When not using the Rust version of Git-Cache, the build system clones the full NRFX repository which led to errors during the build process due to duplicated headers and headers not found where they were expected.

Furthermore the initial approach would copy all the files from the mdk/ subdirectory, which are unnecessarily many. Therefore it was changed to copy only the files defined in the sparse path

Since now we (might) have to deal with the full nrfx package again, I had to move the patches from separate subfolders to a common folder because we may (or may not) have to apply all at once, otherwise building for nrf52 first and then for nrf53 would fail, because the latter is unpatched...

Thanks for @elenaf9 for finding this issue.

Testing procedure

Since CI uses the Rust version of git-cache, it did not catch the regression.

To run the testing manually you have to clear the build/nrf5x_nrfx_mdk and make sure you're not using the rust version of git cache.
I guess it's possible to test it with make -C examples/networking/gnrc/gnrc_networking generate-Makefile.ci, which is currently running on skyleaf. built successful on skyleaf.

Current behavior:

cbuec@W11nMate:~/RIOTstuff/riot-guides/RIOT$ rm -rf build/nrf5x_nrfx_mdk/
cbuec@W11nMate:~/RIOTstuff/riot-guides/RIOT$ BOARD=nrf52dk make -C examples/networking/gnrc/gnrc_networking
make: Entering directory '/home/cbuec/RIOTstuff/riot-guides/RIOT/examples/networking/gnrc/gnrc_networking'
Building application "gnrc_networking" for "nrf52dk" with CPU "nrf52".

Cloning into '/home/cbuec/RIOTstuff/riot-guides/RIOT/build/nrf5x_nrfx_mdk/nrf52'...
remote: Enumerating objects: 8280, done.
remote: Counting objects: 100% (3582/3582), done.
remote: Compressing objects: 100% (546/546), done.
remote: Total 8280 (delta 3219), reused 3036 (delta 3036), pack-reused 4698 (from 3)
Receiving objects: 100% (8280/8280), 21.01 MiB | 13.48 MiB/s, done.
Resolving deltas: 100% (6949/6949), done.
HEAD is now at 11f57e5 nrfx 3.14.0 release
"make" -C /home/cbuec/RIOTstuff/riot-guides/RIOT/pkg/cmsis/
...
"make" -C /home/cbuec/RIOTstuff/riot-guides/RIOT/build/pkg/nimble/nimble/drivers/nrf52/src/ -f /home/cbuec/RIOTstuff/riot-guides/RIOT/Makefile.base MODULE=nimble_drivers_nrf5x
In file included from /home/cbuec/RIOTstuff/riot-guides/RIOT/build/nrf5x_nrfx_mdk/nrf52/nrfx.h:38,
                 from /home/cbuec/RIOTstuff/riot-guides/RIOT/build/pkg/nimble/nimble/drivers/nrf52/src/ble_hw.c:28:
/home/cbuec/RIOTstuff/riot-guides/RIOT/build/nrf5x_nrfx_mdk/nrf52/drivers/nrfx_common.h:46:10: fatal error:nrf_mem.h: No such file or directory
   46 | #include <nrf_mem.h>
      |          ^~~~~~~~~~~
compilation terminated.
make[2]: *** [/home/cbuec/RIOTstuff/riot-guides/RIOT/Makefile.base:157: /home/cbuec/RIOTstuff/riot-guides/RIOT/examples/networking/gnrc/gnrc_networking/bin/nrf52dk/nimble_drivers_nrf5x/ble_hw.o] Error 1
make[1]: *** [Makefile:82: nimble_drivers_nrf5x] Error 2
make: *** [/home/cbuec/RIOTstuff/riot-guides/RIOT/examples/networking/gnrc/gnrc_networking/../../../../Makefile.include:828: pkg-build] Error 2
make: Leaving directory '/home/cbuec/RIOTstuff/riot-guides/RIOT/examples/networking/gnrc/gnrc_networking'

Behavior with this PR:

cbuec@W11nMate:~/RIOTstuff/riot-guides/RIOT$ rm -rf build/nrf5x_nrfx_mdk/
cbuec@W11nMate:~/RIOTstuff/riot-guides/RIOT$ BOARD=nrf52dk make -C examples/networking/gnrc/gnrc_networking
make: Entering directory '/home/cbuec/RIOTstuff/riot-guides/RIOT/examples/networking/gnrc/gnrc_networking'
Building application "gnrc_networking" for "nrf52dk" with CPU "nrf52".

Cloning into '/home/cbuec/RIOTstuff/riot-guides/RIOT/build/nrf5x_nrfx_mdk'...
remote: Enumerating objects: 8280, done.
remote: Counting objects: 100% (3582/3582), done.
remote: Compressing objects: 100% (546/546), done.
remote: Total 8280 (delta 3219), reused 3036 (delta 3036), pack-reused 4698 (from 3)
Receiving objects: 100% (8280/8280), 21.01 MiB | 14.05 MiB/s, done.
Resolving deltas: 100% (6949/6949), done.
HEAD is now at 11f57e5 nrfx 3.14.0 release
"make" -C /home/cbuec/RIOTstuff/riot-guides/RIOT/pkg/cmsis/
...
"make" -C /home/cbuec/RIOTstuff/riot-guides/RIOT/sys/ztimer
   text    data     bss     dec     hex filename
 159828     352   38828  199008   30960 /home/cbuec/RIOTstuff/riot-guides/RIOT/examples/networking/gnrc/gnrc_networking/bin/nrf52dk/gnrc_networking.elf
make: Leaving directory '/home/cbuec/RIOTstuff/riot-guides/RIOT/examples/networking/gnrc/gnrc_networking'

Issues/PRs references

Fixes a regression introduced in #21800.

When not using the Rust version of Git-Cache, the build
system clones the full NRFX repository which led to errors during
the build process due to duplicated headers and headers not
found where they were expected.
@crasbe crasbe requested a review from aabadie as a code owner October 22, 2025 09:08
@crasbe crasbe added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: no fast fail don't abort PR build after first error labels Oct 22, 2025
@crasbe crasbe requested a review from maribu October 22, 2025 09:08
@github-actions github-actions bot added Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: cpu Area: CPU/MCU ports labels Oct 22, 2025
@crasbe crasbe added this to the Release 2025.10 milestone Oct 22, 2025
@riot-ci
Copy link

riot-ci commented Oct 22, 2025

Murdock results

✔️ PASSED

89031c4 cpu/nrf5x_common: fix vendor header regression

Success Failures Total Runtime
10552 0 10552 13m:31s

Artifacts

@elenaf9
Copy link
Contributor

elenaf9 commented Oct 22, 2025

Thanks for the quick fix @crasbe. Can confirm that this fixes the issue for me.

Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trusting @elenaf9 testing

@mguetschow mguetschow added this pull request to the merge queue Oct 22, 2025
Merged via the queue into RIOT-OS:master with commit 5ff98db Oct 22, 2025
29 checks passed
@crasbe crasbe deleted the pr/nrf_vendor_fixup branch October 30, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: cpu Area: CPU/MCU ports CI: no fast fail don't abort PR build after first error CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants