On 2026-11-27, Vagrant Cascadian wrote: > The embedded documentation tarballs include timestamps and user and > group information: > > │ │ │ ├── ./usr/mcstas/3.5/doc/manuals/mcstas-components-html.tgz > │ │ │ │ ├── mcstas-components-html.tgz-content > │ │ │ │ │ ├── file list > │ │ │ │ │ │ @@ -1,743 +1,743 @@ > │ │ │ │ │ │ --rw-r--r-- 0 pbuilder1 (1111) pbuilder1 (1111) 186746 > 2027-12-28 07:48:37.000000 Component_manual.html > │ │ │ │ │ │ --rw-r--r-- 0 pbuilder1 (1111) pbuilder1 (1111) 89544 > 2027-12-28 07:48:37.000000 Component_manual16.html > ... > │ │ │ │ │ │ +-rw-r--r-- 0 pbuilder2 (2222) pbuilder2 (2222) 186746 > 2026-11-25 01:56:23.000000 Component_manual.html > │ │ │ │ │ │ +-rw-r--r-- 0 pbuilder2 (2222) pbuilder2 (2222) 89544 > 2026-11-25 01:56:23.000000 Component_manual16.html ... > Subject: [PATCH 2/6] docs/manuals/mcstas/CMakeLists.txt: Pass arguments to tar > for reproducible tarballs. > > https://reproducible-builds.org/docs/archives/ > --- > docs/manuals/mcstas/CMakeLists.txt | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/docs/manuals/mcstas/CMakeLists.txt > b/docs/manuals/mcstas/CMakeLists.txt > index 8c577123..3e45e39e 100644 > --- a/docs/manuals/mcstas/CMakeLists.txt > +++ b/docs/manuals/mcstas/CMakeLists.txt > @@ -141,7 +141,7 @@ if(HTLATEX_EXECUTABLE AND BASH_EXECUTABLE AND > PYTHON3_EXECUTABLE) > COMMAND "${HTLATEX_EXECUTABLE}" "${DOC}.tex" > "html,3,mathjax,charset=utf-8" " -cvalidate -cunihtf -utf8" "" > COMMAND "${PYTHON3_EXECUTABLE}" > "${CMAKE_CURRENT_SOURCE_DIR}/inject-toc-sidebar.py" "${DOC}" > COMMAND "${BASH_EXECUTABLE}" "-c" "cat > '${CMAKE_CURRENT_SOURCE_DIR}/html-style-overrides.css' >> '${DOC}.css'" > - COMMAND "${BASH_EXECUTABLE}" "-c" "tar czf '${DOC}-html.tgz' > ${DOC}*.html ${DOC}.css figures 2>/dev/null || tar czf '${DOC}-html.tgz' > ${DOC}*.html ${DOC}.css" > + COMMAND "${BASH_EXECUTABLE}" "-c" "tar --sort=name --mtime=@0 > --owner=0 --group=0 --numeric-owner -czf '${DOC}-html.tgz' ${DOC}*.html > ${DOC}.css figures 2>/dev/null || tar --sort=name --mtime=@0 --owner=0 > --group=0 --numeric-owner -czf '${DOC}-html.tgz' ${DOC}*.html ${DOC}.css" > WORKING_DIRECTORY "${PROJECT_BINARY_DIR}" > DEPENDS "${PROJECT_BINARY_DIR}/${DOC}.pdf" > "${CMAKE_CURRENT_SOURCE_DIR}/html-style-overrides.css" > "${CMAKE_CURRENT_SOURCE_DIR}/generate-xbb-files.sh" > "${CMAKE_CURRENT_SOURCE_DIR}/inject-toc-sidebar.py" > COMMENT "Building HTML version of ${DOC} (tex4ht/MathJax), injecting > TOC sidebar, and packaging as ${DOC}-html.tgz"
I forgot to mention...
the documentation recommends using --mtime=@${SOURCE_DATE_EPOCH} here,
but for some reason it was not available at this point during the
build. I also tried using "string(TIMESTAMP source_date_epoch "%s" UTC)"
and then pass "--mtime=@${source_date_epoch}" ... there may be some
quirky cmake nuances I am not catching here, or cmake shell invocation,
etc.
If for some reason, setting --mtime=@0 causes some problems, exploring a
little further how to extract SOURCE_DATE_EPOCH in the right context
will be needed.
Also, this patch may not be acceptible for upstream, as it uses syntax
for GNU tar. BSD tar takes a slightly different syntax, which might need
a separate fallback in the "tar || tar" chain... (it not obvious to me
why there is already a tar fallback in the upstream code).
live well,
vagrant
signature.asc
Description: PGP signature

