Skip to content

Conversation

@arjav1528
Copy link

Summary

GitHub changed how source code archives for tags are served. The previous URL format for downloading a release tarball (e.g. https://github.com/DaveGamble/cJSON/archive/v1.7.10.tar.gz) no longer works; GitHub now requires refs/tags/ in the path for tag-based archive downloads.

This change updates the cJSON download URL in both the Makefile and CMakeLists.txt build paths to use the correct format: .../archive/refs/tags/v${VERSION}.tar.gz. Without this, the cJSON tarball download fails during the apps build when the source is fetched from GitHub.

References:

Impact

  • Users: Builds that fetch cJSON from GitHub (when the local cJSON tree is not present) will succeed instead of failing on the download step.
  • Build process: No change to build options or defaults; only the URL used for downloading the cJSON tarball is updated. Both Makefile and CMake build systems are updated.
  • Compatibility: Same cJSON version (e.g. 1.7.10) is downloaded; only the URL path is different. No API or behavioral change.

Testing

  • Host: [e.g. macOS / Linux, CPU, compiler]
  • Build: Configured NuttX with CONFIG_NETUTILS_CJSON=y, cleaned the cJSON source directory and tarball, then ran the apps build to trigger download and build of cJSON.
  • Result: cJSON tarball downloaded successfully from the updated URL and the netutils/cjson application built without errors.
  • Verification: Build and runtime of a config that uses cJSON (e.g. a board that enables cJSON) to confirm no regressions.

Copy link
Contributor

@linguini1 linguini1 left a comment

Choose a reason for hiding this comment

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

Seems fine. Which build host did you use?

Host: [e.g. macOS / Linux, CPU, compiler]

And which NuttX configuration did you build to test?

@arjav1528
Copy link
Author

Seems fine. Which build host did you use?

Host: [e.g. macOS / Linux, CPU, compiler]

And which NuttX configuration did you build to test?

Host: macOS, Apple M4 Air, clang (Xcode).
NuttX config: nuttx/boards/sim/sim/sim/nsh/defconfig (with CONFIG_NETUTILS_CJSON=y enabled). Built from a clean apps tree so the cJSON tarball was downloaded using the new URL. Download and build completed successfully.

@linguini1
Copy link
Contributor

Host: macOS, Apple M4 Air, clang (Xcode). NuttX config: nuttx/boards/sim/sim/sim/nsh/defconfig (with CONFIG_NETUTILS_CJSON=y enabled). Built from a clean apps tree so the cJSON tarball was downloaded using the new URL. Download and build completed successfully.

Sounds good! Just asking since you left it as a placeholder in the description!

@linguini1 linguini1 dismissed their stale review February 8, 2026 17:47

Details provided.

@arjav1528
Copy link
Author

Host: macOS, Apple M4 Air, clang (Xcode). NuttX config: nuttx/boards/sim/sim/sim/nsh/defconfig (with CONFIG_NETUTILS_CJSON=y enabled). Built from a clean apps tree so the cJSON tarball was downloaded using the new URL. Download and build completed successfully.

Sounds good! Just asking since you left it as a placeholder in the description!

Yess, may be I forgot to change the tenplate PR

Copy link
Contributor

@cederom cederom left a comment

Choose a reason for hiding this comment

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

Thank you @arjav1528 :-) Just please provide git commit message, this part is required, see https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md :-)

Both URLs work for me, but true, old URL has 302 redirection and releases contain reference to one with refs/tags already, thanks for the update! :-)

Do you have some spare time to take a look at other github packages too? :-)

And.. if you use cJSON.. there is a 1.7.19 release already out there.. do you know if that would build and run on NuttX? There were many fixes since 1.7.10 and the only breaking stuff seems linked list change in 1.7.14 (I really like cJSON announces quick fix in the release notes! https://github.com/DaveGamble/cJSON/releases).

% wget https://github.com/DaveGamble/cJSON/archive/v1.7.10.tar.gz
--2026-02-08 23:18:57--  https://github.com/DaveGamble/cJSON/archive/v1.7.10.tar.gz
Resolving github.com (github.com)... 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/DaveGamble/cJSON/tar.gz/refs/tags/v1.7.10 [following]
--2026-02-08 23:18:57--  https://codeload.github.com/DaveGamble/cJSON/tar.gz/refs/tags/v1.7.10
Resolving codeload.github.com (codeload.github.com)... 140.82.121.9
Connecting to codeload.github.com (codeload.github.com)|140.82.121.9|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: ‘v1.7.10.tar.gz’

v1.7.10.tar.gz                                                                [ <=>                                                                                                                                                                                 ] 338,93K  1,77MB/s    in 0,2s

2026-02-08 23:18:58 (1,77 MB/s) - ‘v1.7.10.tar.gz’ saved [347063]


% wget https://github.com/DaveGamble/cJSON/archive/refs/tags/v1.7.10.tar.gz
--2026-02-08 23:23:14--  https://github.com/DaveGamble/cJSON/archive/refs/tags/v1.7.10.tar.gz
Resolving github.com (github.com)... 140.82.121.3
Connecting to github.com (github.com)|140.82.121.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/DaveGamble/cJSON/tar.gz/refs/tags/v1.7.10 [following]
--2026-02-08 23:23:14--  https://codeload.github.com/DaveGamble/cJSON/tar.gz/refs/tags/v1.7.10
Resolving codeload.github.com (codeload.github.com)... 140.82.121.9
Connecting to codeload.github.com (codeload.github.com)|140.82.121.9|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: ‘v1.7.10.tar.gz.1’

v1.7.10.tar.gz.1                                                              [ <=>                                                                                                                                                                                 ] 338,93K  1,73MB/s    in 0,2s

2026-02-08 23:23:14 (1,73 MB/s) - ‘v1.7.10.tar.gz.1’ saved [347063]

Image

…/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 <arjav1528@gmail.com>
@arjav1528
Copy link
Author

Thank you @arjav1528 :-) Just please provide git commit message, this part is required, see https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md :-)

Both URLs work for me, but true, old URL has 302 redirection and releases contain reference to one with refs/tags already, thanks for the update! :-)

Do you have some spare time to take a look at other github packages too? :-)

And.. if you use cJSON.. there is a 1.7.19 release already out there.. do you know if that would build and run on NuttX? There were many fixes since 1.7.10 and the only breaking stuff seems linked list change in 1.7.14 (I really like cJSON announces quick fix in the release notes! https://github.com/DaveGamble/cJSON/releases).

% wget https://github.com/DaveGamble/cJSON/archive/v1.7.10.tar.gz
--2026-02-08 23:18:57--  https://github.com/DaveGamble/cJSON/archive/v1.7.10.tar.gz
Resolving github.com (github.com)... 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/DaveGamble/cJSON/tar.gz/refs/tags/v1.7.10 [following]
--2026-02-08 23:18:57--  https://codeload.github.com/DaveGamble/cJSON/tar.gz/refs/tags/v1.7.10
Resolving codeload.github.com (codeload.github.com)... 140.82.121.9
Connecting to codeload.github.com (codeload.github.com)|140.82.121.9|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: ‘v1.7.10.tar.gz’

v1.7.10.tar.gz                                                                [ <=>                                                                                                                                                                                 ] 338,93K  1,77MB/s    in 0,2s

2026-02-08 23:18:58 (1,77 MB/s) - ‘v1.7.10.tar.gz’ saved [347063]


% wget https://github.com/DaveGamble/cJSON/archive/refs/tags/v1.7.10.tar.gz
--2026-02-08 23:23:14--  https://github.com/DaveGamble/cJSON/archive/refs/tags/v1.7.10.tar.gz
Resolving github.com (github.com)... 140.82.121.3
Connecting to github.com (github.com)|140.82.121.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/DaveGamble/cJSON/tar.gz/refs/tags/v1.7.10 [following]
--2026-02-08 23:23:14--  https://codeload.github.com/DaveGamble/cJSON/tar.gz/refs/tags/v1.7.10
Resolving codeload.github.com (codeload.github.com)... 140.82.121.9
Connecting to codeload.github.com (codeload.github.com)|140.82.121.9|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: ‘v1.7.10.tar.gz.1’

v1.7.10.tar.gz.1                                                              [ <=>                                                                                                                                                                                 ] 338,93K  1,73MB/s    in 0,2s

2026-02-08 23:23:14 (1,73 MB/s) - ‘v1.7.10.tar.gz.1’ saved [347063]

Image

sure, will love to contribute

@simbit18
Copy link
Contributor

simbit18 commented Feb 10, 2026

Question:
Wouldn't it be easier to update the URL in the Kconfig file??

config NETUTILS_CJSON_URL
	string "URL where cJSON library can be downloaded"
	default "https://github.com/DaveGamble/cJSON/archive"

https://github.com/apache/nuttx-apps/blob/master/netutils/cjson/Kconfig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants