-
Notifications
You must be signed in to change notification settings - Fork 217
Feature: TarFileWriter tool optionally preserves input file mtimes #149
Description
See bazelbuild/bazel#11028 for initial conversation.
I work on a team that maintains deployment tools that use https://github.com/bazelbuild/rules_docker/ to build docker images for applications. We noticed that static files in deployed applications always had a Last-Modified value of the unix epoch. We traced the issue back to the TarFileWriter class, which copies all input files into an output tar and preserves most file metadata but overrides the mtime to a provided value (defaulting to 0).
I understand why, in many cases, users would want predictable mtimes for build reproducibility. I'm not sure I understand why this tool should always override mtimes, instead of making that an opt-in or opt-out feature. In our use case, we're passing an entire tar file through TarFileWriter as an input - I think it would be reasonable to allow the output metadata to match the input metadata.