From: Christian Franke <Christian.Franke@t-online.de>
To: cygwin-apps@cygwin.com
Subject: Re: [PATCH cygport] Add initial support for SOURCE_DATE_EPOCH
Date: Thu, 24 Aug 2023 08:09:40 +0200 [thread overview]
Message-ID: <a245e4f0-cdad-8230-5ed4-c2b051903791@t-online.de> (raw)
In-Reply-To: <2aa9ce84-9cab-8c77-f1fd-c7c9142af233@Shaw.ca>
Brian Inglis via Cygwin-apps wrote:
> On 2023-08-23 11:39, Christian Franke via Cygwin-apps wrote:
>> A small step towards reproducible packaging...
>>
>> Currently only tested with upcoming smartmontools package - contains
>> only exe, man, doc files (no dll, lib, ...). Multiple cygport runs
>> produce binary identical distribution tarballs if SOURCE_DATE_EPOCH
>> (from the past) is specified in the cygport file.
>
> What format is this variable?
Unix epoch, see: https://reproducible-builds.org/docs/source-date-epoch/
Some tools like gcc and gropdf already support this:
$ echo '__DATE__ __TIME__' | SOURCE_DATE_EPOCH=1672531200 gcc -E -xc -
# 0 "<stdin>"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "<stdin>"
"Jan 1 2023" "00:00:00"
$ TZ=UTC SOURCE_DATE_EPOCH=1672531200 man -Tpdf ls | TZ=UTC pdfinfo -
Creator: groff version 1.23.0
Producer: gropdf version 1.23.0
CreationDate: Sun Jan 1 00:00:00 2023 UTC
ModDate: Sun Jan 1 00:00:00 2023 UTC
...
If binutils, gzip and tar also would support this, the patch would be
empty :-)
> Would be best to use some ISO format e.g.
>
> %Y-%m-%dT%H:%M:%SZ or
> %Y-%m-%dT%H:%M:%S [local]
>
> that is human readable and can be used by all POSIX command options
> [e.g. see touch(1p) -d] that accept date-time stamps.
I use this in smartmontools.cygport:
SOURCE_DATE=2023-08-23
SOURCE_DATE_EPOCH=$(date -d "$SOURCE_DATE UTC" +%s)
This relies on GNU date, BSD date is very different, a POSIX-only date
would be useless in this context.
> Could do with docs and NEWS entries for new variables, otherwise
> packagers do not know it exists, and how to use it e.g.
>
> #****f* Information/BUILD_REQUIRES
> # SYNOPSIS
> ...
Of course this should be documented, but I left this for a later patch.
--
Regards,
Christian
next prev parent reply other threads:[~2023-08-24 6:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-23 17:39 Christian Franke
2023-08-24 2:45 ` Brian Inglis
2023-08-24 6:09 ` Christian Franke [this message]
2023-08-24 6:27 ` ASSI
2023-08-24 6:36 ` Christian Franke
2023-08-28 15:12 ` Christian Franke
2023-08-28 15:51 ` ASSI
2023-08-29 8:52 ` Christian Franke
2023-10-29 16:05 ` Jon Turney
2023-10-30 17:43 ` Christian Franke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a245e4f0-cdad-8230-5ed4-c2b051903791@t-online.de \
--to=christian.franke@t-online.de \
--cc=cygwin-apps@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).