-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force shallow clone of json 3-rd party #12914
Conversation
Source? It's supposed to work as of v3.6, no? |
CMake/json-download.cmake.in
Outdated
# 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I try or keep it as is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think quotes are better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please point to the article you pointed to in the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And also explain advice.detachedHead=false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
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