-
Notifications
You must be signed in to change notification settings - Fork 993
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
Preserving timestamps in conan cache #2729
Comments
First of all, do you have more information about the broken/interrupted installation process? Maybe it is something we can improve. Are you killing processes or is the user canceling (ctrl+c) it? EDIT: Now I see your comment here: #1003 About the timestamps, I understand your concern, I have to talk with @memsharded in case there could be an issue preserving the timestamps but it sounds good to me. |
I just talked with @memsharded and remembered why the timestamp is changing. So when we extract the But typically, the tgz of a binary package will be generated only once (in a CI), maybe we could |
Sounds good to me. As for the interrupted build issue, it's pretty much what is described in the #1003 ticket. |
Yes, might be doable as opt-in. |
Hi @lasote @memsharded! I'm bringing up this old issue because like the original reporter I would like to save timestamps in
Why this would be a problem if we store (the same) modification times in .tgz? I ask because I've made some local modifications to preserve timestamps and they seems not to break anything. If you are interested I can submit a PR. |
@memsharded Thanks for considering this for Conan 2.0, but why not include it into 1.x? My implementation is quite simple but still fully compatible with older packages without timestamps. If you are still afraid of breaking something, this can be turned off by default. |
Just doing a quick comparison of how this is handled by other package managers; Debian:
The pip
Timestamps in all cases seem to match the package installation time, and not when the file contents were last modified. Homebrew
With the dates in the following order: atime, mtime, ctime, birthtime - with Headers inside Xcode.app
In this case all values are prior to the installation date, except for Other than |
Thanks for the thorough analysis @jcar87 ! Then, it would seem that we should be relatively safe with #12378, which does exactly that, package things with their original times, but usual decompression in a new machine give creation+access time to the current one, while modified time is preserved the original one. |
As a side note, my understanding is that the timestamp we should preserve is The original issue by @progician mentions an issue when the Conan cache is wipe (and restore), the tiemstamps change in a way that cause files to be rebuilt - I'm assuming that this causes rebuilds of a project that is external to the Conan cache and is already configured and already has some compiled translation units. However, I'm not sure why the suggestion of applying the equivalent of I believe:
|
As for me, preserving just |
I am afraid it will not be possible, we are already in the last sprint for 2.0, and this is not an obvious change to do even if using a configurable opt-in, seems too much. |
Closed by #12378 for next beta.5 |
Using conan 1.2.1 at the moment
There are some other issues related to the broken/interrupted installation process. A way to get around this issue would be for us to delete the conan cache entirely and re-install it in every build on the CI. It's unfortunate extra 3 minutes for us, but until something comes along with the other issues, it looks like the best solution.
But then another problem I've run into, and this is that of the timestamps. If I wipe the cache, and reinstall all the dependencies in it, it will change the timestamps of all the binaries and headers of the dependencies. We have a couple of dependencies that are so widely used that basically this means an almost complete rebuild of the system, which takes considerable amount of time.
I understand that some regard to have clean builds for all CI builds as a best practice, but when it becomes an hour for every commit to build, that makes verification of bugs and features really cumbersome.
The
tar
command does have a way to deal with this, at least on Linux:So I wonder if this could be done (perhaps optionally, due to possible problems with timestamp preservation on different systems) in conan as well. We are using ninja as a build tool and it relies exclusively on timestamps, which makes it really fast, but then it fails to realise that nothing has really changed by just wiping and reinstalling the conan cache.
The text was updated successfully, but these errors were encountered: