-
Notifications
You must be signed in to change notification settings - Fork 191
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
Timestamps for URL downloads match the download time #372
Conversation
By enabling CMake policy 135 we ensure that extracted files timestamp match that of the download time, instead of when the archive is created. This makes sure that if the URL changes to an older version we still rebuild everything as the timestamp stays newer.
8681362
to
01a484c
Compare
Hey, thanks for the PR! That policy change definitely sounds like a good idea. However, I feel a bit uneasy with changing global CMake policies from a utility script like CPM, as it can be unexpected for users. E.g. this lead to different behaviour of the same scripts based on the current CMake version. Alternatively, how about adding a note to the Readme explaining the issue and suggesting using |
I think we would need to suggest that the projects set |
How about if we do this as a global CPM option? That would be an opt-in behavior change and we would document the flag as only working with CMake 3.24+ |
I see, that's a good point. Maybe having an option like |
Enabling CPM_SET_RECOMMENDED_CMAKE_POLICIES will establish defaults for all CMake policies so that both CPM and added projects operate inline with CPM recommended best practices.
I have updated this PR with the introduction of |
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.
Thanks for updating the PR to add the recommended policy updates!
I also wonder if it would make sense to default @iboB do you have any thoughts on this? |
Co-authored-by: Lars Melchior <[email protected]>
Co-authored-by: Lars Melchior <[email protected]>
I agree with @TheLartians that setting the policies to new by default is desirable. This is the future, right? :) I also think that we should set them when CPM.cmake is included. It should be the responsibility of the users to manually handle policies if they want to depend on the old behavor IMO the tougher question is what to do with the policies set in Thinking about it, I find it unpleasant that adding the exact same package with and without So... in short I would:
|
Based on the feedback it looks like everyone agrees that the policies should be set on inclusion of CPM.cmake. So I have updated the PR to do exactly that. The policies are still guarded by |
Thanks @iboB for the feedback and @robertmaynard for the changes! After thinking about it I'm now also convinced that setting the policies initially without option to opt-out is the way to go. Besides the points mentioned above, providing no opt-out also means less options to handle and maintain for us. If setting the policies do lead to an increase in issues, we can still add an opt-out in a future version if deemed necessary. |
I have updated the PR to always enable the policies, and dropped the |
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.
Looks good, thanks! Perhaps we can still add a quick note in the readme about the policies , but IMO it's also good as is.
With cpm-cmake/CPM.cmake#372 merged into CPM we should update our CPM version so that RAPIDS developers don't see CMake policy warnings with CMake 3.24+ Authors: - Robert Maynard (https://github.com/robertmaynard) Approvers: - Vyas Ramasubramani (https://github.com/vyasr) URL: #236
By enabling CMake policy 135 we ensure that extracted files timestamp match that of the download time, instead of when the archive is created. This makes sure that if the URL changes to an older version we still rebuild everything as the timestamp
stays newer.