Force shallow clone of json 3-rd party - #12914
Conversation
Source? It's supposed to work as of v3.6, no? |
| # We do not use 'GIT_REPOSITORY' as it doesn't support a shallow clone of a specific commit, | ||
| # this make the clone step very long, so we clone by ourselves | ||
| DOWNLOAD_COMMAND git clone -c advice.detachedHead=false --branch v3.11.3 https://github.com/nlohmann/json.git --depth 1 json | ||
| DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/third-party/ |
There was a problem hiding this comment.
I think better to keep the quotes in case the binary dir has spaces in it - though I'm not sure it matters.
There was a problem hiding this comment.
Should I try or keep it as is?
Its not working , see LibCI which use > 3.20 |
That's not in doubt -- I believe you. |
|
|
Great, thanks. It says:
So we're trying to take out this flag. Couple of things:
I have yet to see this... but agree that this is better if it indeed helps. |
|
I agree it will be helpful to deep dive on this, I will open a ticket for it. |
BTW, here you did a lot of work to make it run on cmake configure step (call it from a different file), it is also relevant for a full external project step which also compile (like in libcurl) |
| SOURCE_DIR "${CMAKE_BINARY_DIR}/third-party/json" | ||
| GIT_SHALLOW 1 # No history needed (requires cmake 3.6) | ||
|
|
||
| # We do not use 'GIT_REPOSITORY' as it doesn't support a shallow clone of a specific commit, |
There was a problem hiding this comment.
Please point to the article you pointed to in the PR
There was a problem hiding this comment.
And also explain advice.detachedHead=false
CMake ignore the shallow clone, json history is huge (185 [MB] when the repo itself is ~7 [MB]) and take much time to download.
Jenkins fail on that many times on timeout.
This fix it.
Before:


After:


Also notified json on GH
nlohmann/json#4370