pboettch / json-schema-validator

JSON schema validator for JSON for Modern C++
Other
464 stars 133 forks source link

Replace the full nlohmann_json repo with a fetch_content variant. #279

Closed eike-fokken closed 10 months ago

eike-fokken commented 10 months ago

During the configuring of json-schema-validator, the repository nlohmann_json is fetched via the fetch_content functionality of CMake. It is a huge repository with size 180MB, which are downloaded whenever one configures CMake on an empty build directory (e.g. after deleting the build directory to clear out cached CMake variables.) The repository https://github.com/ArthurSonzogni/nlohmann_json_cmake_fetchcontent

only contains releases instead of all development commits and has (at the moment) size of only 830kB, which stronly cuts the download time.

This PR implements https://github.com/pboettch/json-schema-validator/issues/277.

eike-fokken commented 10 months ago

@LecrisUT :

I actually am a bit reluctant towards #279 because the user should either use system installed version via find_package or set FETCHCONTENT_BASE_DIR if size download is an issue. The project structure in that look-aside repo is vulnerable to changes in upstream cmake file and restructurings.

I'm not sure, what the issue is here, could you explain a bit more? I've been using that look-aside repo for more than a year now and it never disappointed.

My feeling is that most user's won't bother to change anything and therefore always download the full development history of nlohmann_json, thereby taking up bandwith for nothing.

pboettch commented 10 months ago

I'm not sure, what the issue is here, could you explain a bit more? I've been using that look-aside repo for more than a year now and it never disappointed.

I think the risk of using this aside repo is that it worked well for you until now, but when it silently stops updating or disappears or is vandalised you'll get in trouble.

LecrisUT commented 10 months ago

Yes, indeed that. There can be many things that could change upstream, especially considering the future of CXX modules and header-only projects.

But I think the git submodule approach is the best approach to adopt as a standard across all modern cmake projects. It just needs to be documented better.

eike-fokken commented 10 months ago

As discussed in #278, please revert this.