-
Notifications
You must be signed in to change notification settings - Fork 440
Do not store current timestamps in gz headers #569
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
Conversation
to enable reproducible builds of rdoc Normally, 0 would be the preferred value to indicate "no date" but that value is handled differently in Zlib::GzipWriter to put in the current time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it makes sense. Please check my review comments.
lib/rdoc/generator/json_index.rb
Outdated
@@ -175,7 +175,7 @@ def generate_gzipped | |||
debug_msg "Writing gzipped search index to %s" % outfile | |||
|
|||
Zlib::GzipWriter.open(outfile) do |gz| | |||
gz.mtime = File.mtime(search_index_file) | |||
gz.mtime = 1 # make output reproducible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the mtime
should be updated because the search_index.js.gz
is generated dynamically. Please use SOURCE_DATE_EPOCH
after RDoc::Generator::JsonIndex#generate
creates index file.
lib/rdoc/generator/json_index.rb
Outdated
@@ -193,7 +193,7 @@ def generate_gzipped | |||
debug_msg "Writing gzipped file to %s" % outfile | |||
|
|||
Zlib::GzipWriter.open(outfile) do |gz| | |||
gz.mtime = File.mtime(dest) | |||
gz.mtime = 1 # make output reproducible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix FileUtils.install
in RDoc::Generator::JsonIndex#generate
with :preserve
option instead of this because the mtime
value is based on original .js
file.
For your information, FileUtils.install
is based on "install(1)" command.
The mtime for search_index.js.gz should be updated because it's generated dynamically. So uses SOURCE_DATE_EPOCH after RDoc::Generator::JsonIndex#generate creates index file. FileUtils.install in RDoc::Generator::JsonIndex#generate with :preserve option because the mtime value is based on original .js file.
to enable reproducible builds of rdoc
Normally, 0 would be the preferred value to indicate "no date"
but that value is handled differently in Zlib::GzipWriter
to put in the current time