-
Notifications
You must be signed in to change notification settings - Fork 184
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
Skip fetch only works when CPM_SOURCE_CACHE
is defined
#577
Comments
bilke
added a commit
to ufz/ogs
that referenced
this issue
Sep 11, 2024
See cpm-cmake/CPM.cmake#577. Should fix issues observed by various developers.
wolfpld
added a commit
to wolfpld/tracy
that referenced
this issue
Sep 27, 2024
A simple solution seems to be to always enable the cache. --- a/cmake/CPM.cmake
+++ b/cmake/CPM.cmake
@@ -154,7 +154,7 @@ set(CPM_DRY_RUN
if(DEFINED ENV{CPM_SOURCE_CACHE})
set(CPM_SOURCE_CACHE_DEFAULT $ENV{CPM_SOURCE_CACHE})
else()
- set(CPM_SOURCE_CACHE_DEFAULT OFF)
+ set(CPM_SOURCE_CACHE_DEFAULT ${CMAKE_CURRENT_BINARY_DIR}/.cpm-cache)
endif()
set(CPM_SOURCE_CACHE |
Intriguing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When the environment variable
CPM_SOURCE_CACHE
is set, re-running cmake does not cause a fetch and patch.When unset, fetch and patch both occur.
The problem observed (see #572 for more discussion) is that the unset path fetch does not overwrite the source and so the patch command fails.
#572 suggests a fix that could ignore errors during patching. I think this could be an issue when a user is testing version updates; it would be nice if we just, say, updated package A to latest version and running CMake told us the patches were incompatible/not applied. I don't think
-t
reports that?In my testing, I see that when the environment variable is set, we skip the fetch and patch steps. Maybe we can add a cache variable to indicate the initial fetch and patch skips were successful?
Recreation of this is relatively simple, see https://github.com/ScottBailey/cpm-cmake-test-577 for an automated working example.
@lemire
The text was updated successfully, but these errors were encountered: