Builds not reproducible across different platforms
Description
When building a document with date: none and identical Typst versions, currently v0.10.0, the build output should be reproducible across different platforms i.e. Linux and macOS builds should be byte-by-byte identical
Note that when using the same platform builds are reproducible as expected
Reproduction URL
No response
Operating system
Linux, macOS
Typst version
- [X] I am using the latest version of Typst
Would it maybe be possible to provide the 2 PDFs where they are different?
Could be due to differences in font loading.
Even better @LaurenzV @laurmaedje you can reproduce this with the minimal reproducible example below:
#set document(
date: none,
)
Test
Fwiw it seems like reproducibility has gotten even worse, since apparently now also the creation date is stored in the target PDF:
12 0 obj
<<
/Creator (Typst 0.11.0)
/CreationDate (D:20240417193127Z)
/ModDate (D:20240417193127Z)
>>
endobj
Unfortunately even freezing the system time via faketime doesn't seem to work, since
- apparently there's times still micro-adjustments done, faking and freezing the time to be
1970-01-02 00:00:00still resulted in the second sometimes being1, sometimes0. - there are also parts at the bottom of the document which seem to be hashes of the file paths?
trailer
<<
/Size 15
/Root 14 0 R
/Info 12 0 R
+ /ID [(/9ExdZ5vOtVgqt8s26BvCw==) (/9ExdZ5vOtVgqt8s26BvCw==)]
- /ID [(uqtU5+OrMh3sE+PhrM0Elw==) (uqtU5+OrMh3sE+PhrM0Elw==)]
>>
I guess it might be possible to make the files reproducible, still, by just searching for both culprits and deleting them. But I don't trust myself with enough knowledge about PDF and typst to know what this could impact.
Something like a --reproducible flag would be cool, theoretically. I can imagine it'd be quite a ton of work though, and makes e.g. the datetime module and fs access a headache.
@MultisampledNight just #set document(date: none) prevents that from happening. The IDs are also stable then.
Apologies, I misunderstood! I thought document was an old name for page, but it's very real still today: https://typst.app/docs/reference/model/document/
@Crissante I cannot reproduce this on 0.11.1. If you still can, please send the source file and the two differing PDFs. That would allow us to pin down the cause.