Skip to content
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

Make gzipped markdown source reproducible #166

Merged
merged 1 commit into from Apr 10, 2022
Merged

Conversation

dkg
Copy link
Contributor

@dkg dkg commented Mar 30, 2022

By avoiding setting the embedded timestamp in the gzip-encoded
markdown source, we avoid a variation based on time of build.

By avoiding setting the embedded timestamp in the gzip-encoded
markdown source, we avoid a variation based on time of build.
@cabo
Copy link
Owner

cabo commented Mar 30, 2022

I find it very useful to have that mtime. What are the specific circumstances where they get in the way?

@dkg
Copy link
Contributor Author

dkg commented Apr 10, 2022

Aside from my general preference for reproducible software, i find it pretty important to be able to compare versions of different drafts.

When comparing two copies of XML, the embedded markdown is either different or it is not different. If the only difference is in the embedded mtime, it shows up as a difference in the b64-encoded gzipped source. to determine that it's only the difference in the embedded mtime, and not, say, a difference in the metadata block at the start of the markdown, i have to either know the exact placement of the mtime in a gzip header and be able to visually identify it in b64 (a weird and very unfriendly skill!) or i have to un-b64 and decompress the embedded markdown and diff it.

Let me try asking the question in a different direction: where and when do you use that mtime? what is the advantage of having it? if the only thing it encodes is "now" (meaning, when kramdown-rfc is run) then surely that information is better recorded (or not recorded, if not needed) explicitly in the xml source, not in this obscure and difficult-to-read location. If it's supposed to encode the filesystem timestamp of the original markdown file, why is that useful? if i'm working from a new git checkout, the timezone will record when i did the clone, not when the file was modified. why would that information be something someone else needs to use?

@cabo
Copy link
Owner

cabo commented Apr 10, 2022

I agree that deterministic builds are highly desirable.
Having the time in the generated XML is occasionally useful to find out what happened, but maybe not that useful.
So I'll cherry-pick this PR and make a fix.

@cabo cabo merged commit 655f644 into cabo:master Apr 10, 2022
cabo added a commit that referenced this pull request Apr 10, 2022
No longer include mtime in the compressed markdown
(was PR #166)

See kramdown-rfc-autolink-iref-cleanup.rb:
Suppress auto-irefs inside the section that is also auto-linked
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.

None yet

2 participants