-
Notifications
You must be signed in to change notification settings - Fork 112
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
Source file mtimes are always set to Jan 1, 1980 #1358
Comments
@matthewrobertson I think this is actually by design. The RFC has a bit more detail, but basically we were worried that setting layer timestamps (as opposed to just image create time) would break caching. However, we've had a few requests for layer timestamps since this feature was introduced, so maybe we should add it as a configurable option. In the meantime, we can probably update the help text in pack to make it clearer that layer timestamps aren't included for now. |
Thanks for the context @natalieparellano. I am actually not sure that We have gotten a handful of customer bug reports that zeroing out mtimes causes caching issues in various HTTP frameworks. If we are worried about side effects of changing this, how would we feel about a new setting to disable it |
I'll bring this up for discussion at our next working group (Thurs 6/6). |
Hey @matthewrobertson we talked about this today - generally folks are in favor of supporting something like this. We would want a light-weight RFC in the style of https://github.com/buildpacks/rfcs/blob/main/text/0103-source-date-epoch.md. There was some debate about whether this should be the default behavior that folks opt out of, to be discussed further. In either case, it would require a Platform API version bump. Implementation would require some care, as buildpacks can (and do) make changes to the app directory, and we would want to ensure that mtimes are zeroed out when buildpacks make changes as otherwise build reproducibility is broken. One possible path forward would be to zero out mtimes if the existing time is later than the build start time. Also noted was the fact that buildpacks for some language families delete the source code entirely, so this change would be relevant in only a subset of cases. Feel free to reach out if you'd like any help with writing the RFC. @AidanDelaney has kindly agreed to provide guidance here. |
Sounds good. I will start working on something and try to attend the next working group meeting to discuss if I have any questions. |
Hi, do you have any update about this issue? Can we expect implementation of this feature any time soon? |
@joanna-polec this still requires an RFC, and someone to drive the implementation. If you are interested in taking this on, please let us know and a maintainer would be happy to guide you. |
Summary
All buildpack builders reset the mtime of all application source files to Jan 1, 1980, even if
SOURCE_DATE_EPOCH
or the pack--creation-time
flag is set.Reproduction
See the sample app here: https://github.com/matthewrobertson/bp-mtime-issue
Steps
(more comprehensive instructions in the linked repo)
Load the app in your browser: http://localhost:8080/
Repeat steps 1 - 3.
Current behavior
The content on the page does not change unless you do hard refresh in the browser because of HTTP caching. This is because the public/index.js file in the container has an mtime of
Jan 1, 1980...
:Expected behavior
I would expect the cache to get busted every time I rebuild because I passed the
--creation-time now
flag.Context
lifecycle version
0.19.6
platform version(s)
The text was updated successfully, but these errors were encountered: