Subject: bug#56893: rust-vergen inserts build timestamps, possible irreproducibility source

From: Maxime Devos <[email-masked]>
Date: Tue, 2 Aug 2022 19:14:54 +0200

The following phase works around the issue for me (for antioxidant) -- 
this makes "guix build --check" pass (at least for antioxidant):

> +    ;; TODO: SOURCE_DATE_EPOCH support would be nice.  Also maybe 
> better fit for a snippet?
> +    ;;
> +    ;; Make the rust-vergen reproducible and avoid causing 
> irreproducibility
> +    ;; in dependents.
> +    ("rust-vergen"
> +     ,#~((add-after 'unpack 'remove-timestamp-irreproducibility
> +       (lambda _
> +         (substitute* (find-files "." "\\.rs$")
> +           (("^extern crate chrono;") "extern crate chrono; use 
> chrono::Utc; use chrono::TimeZone;")
> +           (("^use chrono::Utc;") "use chrono::Utc; use 
> chrono::TimeZone;")

Should also work for cargo-build-system, but untested.

Greetings,
Maxime