-
Notifications
You must be signed in to change notification settings - Fork 297
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 app file mtimes at build time #492
Comments
@pclalv When exporting image layers we want to normalize all file times so that we can reuse existing blobs and avoid expensively re-uploading layers to the registry when the layer file content has not changed. Fortunately, if the issue you are experiencing is caused by source file |
@ekcasey Am I right in thinking this is an issue in |
@zmackie I believe so, I'll move it over. |
Ah yeah, my mistake. While we invoke the lifecycle directly in our remote builds, I usually test our buildpacks locally with pack, and I mistakenly assumed that lifecycle builds and pack builds would be equivalent in this regard. It would be nice to smooth out this difference, though. |
As of lifecycle#80, the lifecycle ensures that all app
files have the same predetermined mtime at build time, regardless of
the app file's actual mtime. It would be nice to have an option to
preserve app file mtimes at buildtime in order to support build steps
that use mtime to validate the cache and/or its contents.
Detailed use-case
I have a Rails app with a Sprockets asset pipeline. In
order to build images for the Rails app we run several it through
several buildpacks, including a Ruby buildpack and a Sprockets asset
compilation buildpack.
The most basic Sprockets asset compilation buildpack essentially just
needs to compile static assets from source files and write those
compiled assets to a known place. It can compile every asset from
scratch every time and generate the correct results.
However, compiling every asset from scratch every time is not
efficient. We would like to enable our Sprockets buildpack to be able
to use a cache and thereby only compile assets that need to be
compiled. Sprockets is built with support for caching; as with GNU
make, a source file's mtime is the underlying mechanism for
determining whether a cached compiled asset is valid. Because every
source file has the same mtime on every build, a Sprockets buildpack
will compile an asset from a source file exactly once and never
compile it again, due to the source file mtime being the same every
every time.
The text was updated successfully, but these errors were encountered: