From 8e35b8586430c32f706c3975efa7ca8fa0894c17 Mon Sep 17 00:00:00 2001 From: Arjav Patel Date: Mon, 9 Feb 2026 17:34:31 +0530 Subject: [PATCH] netutils/cjson: update download URL for cJSON tarball to include refs/tags Modified the CMakeLists.txt and Makefile to ensure the correct format for downloading the cJSON tarball from GitHub by including 'refs/tags/' in the URL. This change addresses issues with fetching the correct version of the library. Signed-off-by: Arjav Patel --- netutils/cjson/CMakeLists.txt | 3 ++- netutils/cjson/Makefile | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/netutils/cjson/CMakeLists.txt b/netutils/cjson/CMakeLists.txt index 83a6475cde7..b497e4a0170 100644 --- a/netutils/cjson/CMakeLists.txt +++ b/netutils/cjson/CMakeLists.txt @@ -30,12 +30,13 @@ if(CONFIG_NETUTILS_CJSON) set(CONFIG_NETUTILS_CJSON_VERSION "1.7.10") endif() + # GitHub requires refs/tags/ in the archive URL for tag downloads if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/cJSON) FetchContent_Declare( cJSON DOWNLOAD_NAME "v${CONFIG_NETUTILS_CJSON_VERSION}.tar.gz" DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR} - URL "${CONFIG_NETUTILS_CJSON_URL}/v${CONFIG_NETUTILS_CJSON_VERSION}.tar.gz" + URL "${CONFIG_NETUTILS_CJSON_URL}/refs/tags/v${CONFIG_NETUTILS_CJSON_VERSION}.tar.gz" SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/cJSON BINARY_DIR diff --git a/netutils/cjson/Makefile b/netutils/cjson/Makefile index d8993373d2b..683bdb3da95 100644 --- a/netutils/cjson/Makefile +++ b/netutils/cjson/Makefile @@ -49,10 +49,12 @@ CSRCS = $(CJSON_SRCDIR)$(DELIM)cJSON.c CSRCS += $(CJSON_SRCDIR)$(DELIM)cJSON_Utils.c # Download and unpack tarball if no git repo found +# GitHub requires refs/tags/ in the archive URL for tag downloads (see +# https://docs.github.com/en/repositories/working-with-files/using-files/downloading-source-code-archives) ifeq ($(wildcard $(CJSON_UNPACKNAME)/.git),) $(CJSON_TARBALL): @echo "Downloading: $(CJSON_TARBALL)" - $(Q) curl -O -L $(CONFIG_NETUTILS_CJSON_URL)/$(CJSON_TARBALL) + $(Q) curl -O -L $(CONFIG_NETUTILS_CJSON_URL)/refs/tags/$(CJSON_TARBALL) $(CJSON_UNPACKNAME): $(CJSON_TARBALL) @echo "Unpacking: $(CJSON_TARBALL) -> $(CJSON_UNPACKNAME)"