Skip to content

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

Merged
merged 3 commits into from
Jan 27, 2018
Merged

Do not store current timestamps in gz headers #569

merged 3 commits into from
Jan 27, 2018

Conversation

bmwiedemann
Copy link
Contributor

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

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
Copy link
Member

@aycabta aycabta left a 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.

@@ -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
Copy link
Member

@aycabta aycabta Jan 6, 2018

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.

@@ -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
Copy link
Member

@aycabta aycabta Jan 6, 2018

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.
@aycabta aycabta merged commit 49f19bc into ruby:master Jan 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants