Skip to content

Commit

Permalink
Force epoch for typesetting (see #9)
Browse files Browse the repository at this point in the history
At present, this is modelled with the idea that an epoch at the
command line forces for both check and doc. We could have

    texlua build.lua doc -E <date> -f

so you also have to explicitly force: seems over-the-top to
me.
  • Loading branch information
josephwright committed Jun 29, 2017
1 parent 09ab41d commit 1cd90e0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
3 changes: 3 additions & 0 deletions l3build.dtx
Expand Up @@ -136,6 +136,9 @@
\luavarset{makeindexexe} {"makeindex"}{MakeIndex executable}
\luavarset{makeindexopts}{""} {MakeIndex options}
\luavarseparator
\luavarset{forcecheckepoch}{"true"} {Force epoch when running tests}
\luavarset{forcedocepoch} {"false"} {Force epoch when typesetting}
\luavarseparator
\luavarset{asciiengines}{\{"pdftex"\}}{Engines which should log as sure ASCII}
\luavarset{checkruns} {1} {How many times to run a check file before comparing the log.}
\luavarset{epoch} {1463734800} {Epoch (Unix date) to set for test runs.}
Expand Down
33 changes: 25 additions & 8 deletions l3build.lua
Expand Up @@ -159,6 +159,14 @@ bibtexopts = bibtexopts or "-W"
makeindexexe = makeindexexe or "makeindex"
makeindexopts = makeindexopts or ""
-- Forcing epoch
if forcecheckepoch == nil then
forcecheckepoch = true
end
if forcedocepoch == nil then
forcedocepoch = true
end
-- Other required settings
asciiengines = asciiengines or {"pdftex"}
checkruns = checkruns or 1
Expand Down Expand Up @@ -1392,13 +1400,14 @@ function runtest(name, engine, hide, ext, makepdf)
-- Avoid spurious output from (u)pTeX
os_setenv .. " GUESS_INPUT_KANJI_ENCODING=0"
.. os_concat ..
-- Fix the time of the run
os_setenv .. " SOURCE_DATE_EPOCH=" .. epoch
.. os_concat ..
os_setenv .. " SOURCE_DATE_EPOCH_TEX_PRIMITIVES=1"
.. os_concat ..
os_setenv .. " FORCE_SOURCE_DATE=1"
.. os_concat ..
if forcetestepoch then
os_setenv .. " SOURCE_DATE_EPOCH=" .. epoch
.. os_concat ..
os_setenv .. " SOURCE_DATE_EPOCH_TEX_PRIMITIVES=1"
.. os_concat ..
os_setenv .. " FORCE_SOURCE_DATE=1"
.. os_concat ..
end
-- Ensure lines are of a known length
os_setenv .. " max_print_line=" .. maxprintline
.. os_concat ..
Expand Down Expand Up @@ -1496,7 +1505,15 @@ function runtool(subdir, dir, envvar, command)
return(
run(
typesetdir .. "/" .. subdir,
os_setenv .. " " .. envvar .. "=." .. os_pathsep
if forcedocepoch then
os_setenv .. " SOURCE_DATE_EPOCH=" .. epoch
.. os_concat ..
os_setenv .. " SOURCE_DATE_EPOCH_TEX_PRIMITIVES=1"
.. os_concat ..
os_setenv .. " FORCE_SOURCE_DATE=1"
.. os_concat ..
end
os_setenv .. " " .. envvar .. "=." .. os_pathsep
.. abspath(localdir) .. os_pathsep
.. abspath(dir .. "/" .. subdir)
.. (typesetsearch and os_pathsep or "") ..
Expand Down

0 comments on commit 1cd90e0

Please sign in to comment.