Add option to preserve input tar mtimes in TarFileWriter#11028
Add option to preserve input tar mtimes in TarFileWriter#11028dannysullivan wants to merge 1 commit intobazelbuild:masterfrom
Conversation
Also backfill unit tests of default mtime functionality
|
the tar writing rules within bazelbuild/bazel are deprecated and moved to bazelbuild/rules_pkg, so we won't take the change to this repo. But there is a fundamentally different problem. The default behavior is a wrong-minded hack. We can discuss it that repo, but please as an issue first, instead of a set of PRs. |
|
Thanks for the feedback @aiuto - I just opened the issue here: bazelbuild/rules_pkg#149 . Please let me know if you need any extra information from me! |
|
Well.. As much as I want a quick migration to rules_pkg, that may be another 2 or 3 incompatible flag flips in the future. Let's try to merge this to get people over the hump. |
Also backfill unit tests of default mtime functionality.
This is the first in a short sequence of changes aimed at fixing static file caching issues in applications deployed using the container_image rule in rules_docker. That rule relies on TarFileWriter, which currently copies files from one tar to another and overwrites the input files' mtimes, which causes the Last-Modified HTTP header to always return the same value and breaks browser caches.
This PR contains an additive change in the form of an optional parameter to TarFileWriter that copies mtimes from the input tar files to the output tar. It should not affect any existing behavior.