Open AumyF opened 2 years ago
I think SATySFi can have an option to give a random seed to generate reproducible results.
After some searching, I found that upcoming camlpdf 2.5 introduces CAMLPDF_REPRODUCIBLE_IDS
environment variable ^1 which ensures reproducible ids. I think it would be modester to use a method like this rather than fixing a random seed.
I just found it too and was wondering why it does not work in my environment...
Anyway, this issue will be closed when camlpdf is updated to 2.5.
Current code calls the id generating function Pdf.generate_id
via (SATySFi) HandlePdf.write_to_file
→ (CamlPDF) Pdfwrite.pdf_to_file
→ Pdfwrite.pdf_to_file_options
→ Pdfwrite.change_id
→ Pdf.generate_id
.
Pdfwrite.pdf_to_file_options
function does not call Pdfwrite.change_id
if mkid
argument is false
^1. It might be another choice to use Pdfwrite.pdf_to_file_options
with mkid
= false
in HandlePdf.write_to_file
, and attach an ID in SATySFi side.
camlpdf 2.5 has been released, so upgrading it can solve the issue. However, the changelog says that the feature is for testing. Are there any downsides using fixed ID for PDF files? Or should we pass an ID as command-line options or generate it reproducibly on SATySFi side?
It affects Nix, which requires deterministic build.