From 89031c45fb3a5dbd7f221b367d0d7439f906e15b Mon Sep 17 00:00:00 2001 From: crasbe Date: Wed, 22 Oct 2025 10:45:22 +0200 Subject: [PATCH] cpu/nrf5x_common: fix vendor header regression 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. --- cpu/nrf5x_common/Makefile.nrfx | 22 +++++++++++++------ ...=> 0001-RIOT-specific-changes-nRF51.patch} | 0 ...=> 0002-RIOT-specific-changes-nRF52.patch} | 0 ...=> 0003-RIOT-specific-changes-nRF53.patch} | 0 4 files changed, 15 insertions(+), 7 deletions(-) rename cpu/nrf5x_common/include/vendor/patches/{nrf51/0001-RIOT-specific-changes.patch => 0001-RIOT-specific-changes-nRF51.patch} (100%) rename cpu/nrf5x_common/include/vendor/patches/{nrf52/0001-RIOT-specific-changes.patch => 0002-RIOT-specific-changes-nRF52.patch} (100%) rename cpu/nrf5x_common/include/vendor/patches/{nrf53/0001-RIOT-specific-changes.patch => 0003-RIOT-specific-changes-nRF53.patch} (100%) diff --git a/cpu/nrf5x_common/Makefile.nrfx b/cpu/nrf5x_common/Makefile.nrfx index 6f25996551..96eb2083d3 100644 --- a/cpu/nrf5x_common/Makefile.nrfx +++ b/cpu/nrf5x_common/Makefile.nrfx @@ -21,14 +21,12 @@ else ifeq (nrf52, $(CPU_FAM)) PKG_SPARSE_PATHS += mdk/nrf52811.h PKG_SPARSE_PATHS += mdk/nrf52811_bitfields.h - PKG_SPARSE_PATHS += mdk/nrf52811_name_change.h PKG_SPARSE_PATHS += mdk/nrf52811_peripherals.h PKG_SPARSE_PATHS += mdk/nrf52832_peripherals.h PKG_SPARSE_PATHS += mdk/nrf52833.h PKG_SPARSE_PATHS += mdk/nrf52833_bitfields.h - PKG_SPARSE_PATHS += mdk/nrf52833_name_change.h PKG_SPARSE_PATHS += mdk/nrf52833_peripherals.h PKG_SPARSE_PATHS += mdk/nrf52840.h @@ -48,13 +46,23 @@ else ifneq (nrf53%, $(CPU_FAM)) endif -PKG_SOURCE_DIR = $(BUILD_DIR)/nrf5x_nrfx_mdk/$(CPU_FAM) -PKG_PATCH_DIR = $(RIOTCPU)/nrf5x_common/include/vendor/patches/$(CPU_FAM) +# The rust implementation of git-cache is the only one doing +# a sparse checkout. The others do a full clone, which we need to +# consider here. +ifneq (,$(GIT_CACHE_RS)) + PKG_SOURCE_DIR = $(BUILD_DIR)/nrf5x_nrfx_mdk/$(CPU_FAM) + VENDOR_FOLDER = $(PKG_SOURCE_DIR)/vendor +else + PKG_SOURCE_DIR = $(BUILD_DIR)/nrf5x_nrfx_mdk + VENDOR_FOLDER = $(PKG_SOURCE_DIR)/$(CPU_FAM)/vendor +endif + +PKG_PATCH_DIR = $(RIOTCPU)/nrf5x_common/include/vendor/patches include $(RIOTBASE)/pkg/pkg.mk -# The sparse checkout keeps the path, but we need to have the header in a +# The sparse checkout keeps the path, but we need to have the headers in a # subfolder called "vendor". all: - @mkdir -p $(PKG_SOURCE_DIR)/vendor - @cp $(PKG_SOURCE_DIR)/mdk/* $(PKG_SOURCE_DIR)/vendor + @mkdir -p $(VENDOR_FOLDER) + @cp $(addprefix $(PKG_SOURCE_DIR)/, $(PKG_SPARSE_PATHS)) $(VENDOR_FOLDER) diff --git a/cpu/nrf5x_common/include/vendor/patches/nrf51/0001-RIOT-specific-changes.patch b/cpu/nrf5x_common/include/vendor/patches/0001-RIOT-specific-changes-nRF51.patch similarity index 100% rename from cpu/nrf5x_common/include/vendor/patches/nrf51/0001-RIOT-specific-changes.patch rename to cpu/nrf5x_common/include/vendor/patches/0001-RIOT-specific-changes-nRF51.patch diff --git a/cpu/nrf5x_common/include/vendor/patches/nrf52/0001-RIOT-specific-changes.patch b/cpu/nrf5x_common/include/vendor/patches/0002-RIOT-specific-changes-nRF52.patch similarity index 100% rename from cpu/nrf5x_common/include/vendor/patches/nrf52/0001-RIOT-specific-changes.patch rename to cpu/nrf5x_common/include/vendor/patches/0002-RIOT-specific-changes-nRF52.patch diff --git a/cpu/nrf5x_common/include/vendor/patches/nrf53/0001-RIOT-specific-changes.patch b/cpu/nrf5x_common/include/vendor/patches/0003-RIOT-specific-changes-nRF53.patch similarity index 100% rename from cpu/nrf5x_common/include/vendor/patches/nrf53/0001-RIOT-specific-changes.patch rename to cpu/nrf5x_common/include/vendor/patches/0003-RIOT-specific-changes-nRF53.patch