git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/3] Documentation: allow overriding timestamps of generated asciidoc

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Nov 22, 2017, 01:15 UTC
Message-ID
<20171122011531.GQ3429@aiede.mtv.corp.google.com>
In-Reply-To
<20171122005433.kwv4bin6y65xuxm5@genre.crustytoothpaste.net>
Hi,
brian m. carlson wrote:
> On Tue, Nov 21, 2017 at 03:34:32PM -0800, Jonathan Nieder wrote:
Show 12 quoted lines
>> --- a/Documentation/Makefile
>> +++ b/Documentation/Makefile
>> @@ -410,6 +410,7 @@ $(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
>>  howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
>>  	$(QUIET_GEN)$(RM) $@+ $@ && \
>>  	'$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(wildcard howto/*.txt)) >$@+ && \
>> +	$(if $(SOURCE_DATE_EPOCH),touch -d '@$(SOURCE_DATE_EPOCH)' $@+ &&) \
>
> touch -d @SECONDS isn't POSIX compliant, and non-Linux systems don't
> provide it.  POSIX only allows certain fixed format, and I assume that
> non-Linux parties (maybe OpenBSD) will want to have reproducible builds
> as well.

Interesting. My knee-jerk preference is still to go with this patch as-is for now, since the non-portability only triggers when SOURCE_DATE_EPOCH is set.

Show 18 quoted lines
> It's unfortunate for shell users that this variable is in seconds from
> the epoch, since there's no portable way to format such a time in shell.
> (POSIX doesn't allow date(1) to format anything but the current time.)
>
> My proposed solution was to use Perl to do so, and simply require that
> if you wanted a reproducible build, then you had to have Perl.  That
> would, of course, require a separate variable in the Makefile holding
> the formatted date.
>
> Maybe something like the following in the Makefile:
>
> ifndef NO_PERL
> SOURCE_DATE_TIMESTAMP=$(shell perl -MPOSIX -e 'print strftime("%FT%TZ", gmtime($ENV{SOURCE_DATE_EPOCH}));')
> endif
>
> and then:
>
> +	$(if $(SOURCE_DATE_TIMESTAMP),touch -d '$(SOURCE_DATE_TIMESTAMP)' $@+ &&) \
Neat.  I can play with this a little.

http://asciidoc.org/CHANGELOG.html is stale but asciidoc still seems to be getting changes at https://github.com/asciidoc/asciidoc. I wonder how difficult it would be to add any required SOURCE_DATE_EPOCH support there.

Longer term, I wonder what it would take to move to a markup language that is more widely known, like commonmark.

Thanks, Jonathan

Previous: brian m. carlsonNext: Junio C Hamano
Message 4 of 10 in “Improving build reproducibility”
  1. 0/3 Improving build reproducibilityJonathan Nieder, Nov 21, 2017
  2. 1/3 Documentation: allow overriding timestamps of generated asciidocJonathan Nieder, Nov 21, 2017
  3. brian m. carlsonNov 22, 2017
  4. Jonathan NiederNov 22, 2017
  5. Junio C HamanoNov 22, 2017
  6. Anders KaseorgNov 22, 2017
  7. Junio C HamanoNov 22, 2017
  8. Jonathan NiederNov 22, 2017
  9. 2/3 git-gui: sort entries in optimized tclIndexJonathan Nieder, Nov 21, 2017
  10. 3/3 generate-cmdlist: avoid non-deterministic outputJonathan Nieder, Nov 21, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.