Re: Automake 1.18 regression (?)

Frederic Berat via Discussion list for automake <[email protected]> Fri, 20 Jun 2025 20:46:35 +0200
Newsgroups gmane.comp.sysutils.automake.general
Message-ID <CAObJKZp6a4tmT_6G+Vq=L4pCJzRuraUN+3wJF_FC4eQjRwB15A@mail.gmail.com>
On Fri, Jun 20, 2025 at 6:07=E2=80=AFPM Karl Berry <[email protected]> w=
rote:

> Hi Frederic and all - I pushed the following tweaks to a few
> tests. With these changes, I was able to run make distcheck with
> SOURCE_DATE_EPOCH=3D86402 (among other values). Hope it suffices
> .. --thanks, karl. (And thanks Carlos for the info.)
>
>
Thanks, I'll make a mass rebuild during the weekend to see how it goes
with that.


>
> -------------------------------------------------------------------------=
----
> test: adapt tests for SOURCE_DATE_EPOCH.
>
> From https://lists.gnu.org/archive/html/automake/2025-06/msg00016.html.
>
> * t/mdate5.sh: allow years 19xx for old SOURCE_DATE_EPOCH.
> * t/txinfo-vtexi3.sh: likewise.
> * t/txinfo-vtexi4.sh: if SDE is set, use mdate-sh to parse it into
> the expected UPDATED and UPDATED-MONTH values.
> Report from Frederic Berat.
> * NEWS: mention this.
> diff --git a/NEWS b/NEWS
> index 02581e1d9..ac1930971 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -1,6 +1,11 @@
>  For planned incompatibilities in a possible future Automake 2.0 release,
>  please see NEWS-future and start following the advice there now.
>
> +* Bugs fixed
> +
> +  - Keep Automake tests working when SOURCE_DATE_EPOCH is set.
> +  (https://lists.gnu.org/archive/html/automake/2025-06/msg00016.html)
> +
>
>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=
~~~~
>  New in 1.18 (2025-05-25):
>
> diff --git a/t/mdate5.sh b/t/mdate5.sh
> index 11be50f13..14c524e9b 100644
> --- a/t/mdate5.sh
> +++ b/t/mdate5.sh
> @@ -29,16 +29,22 @@ echo "$*" # For debugging.
>  test $# =3D 3
>  case $1$3 in *[!0-9]*) exit 1;; esac
>  test $1 -lt 32
> -# Hopefully automake will be obsolete in 80 years ;-)
> -case $3 in 20[0-9][0-9]) :;; *) exit 1;; esac
> +case $3 in
> +  19[0-9][0-9]) :;; # for old SOURCE_DATE_EPOCH.
> +  20[0-9][0-9]) :;; # Hopefully automake will be obsolete in 80 years ;-=
)
> +  *) exit 1;;
> +esac
>  case $2 in
>    January|February|March|April|May|June|July|August) ;;
>    September|October|November|December) ;;
>    *) exit 1
>  esac
>
> -# Stricter checks on the year required a POSIX date(1) command.
> -if year=3D$(date +%Y) && test $year -gt 2010; then
> +# Stricter checks on the year required a POSIX date(1) command,
> +# and that SOURCE_DATE_EPOCH is not set.
> +if year=3D$(date +%Y) \
> +   && test -z "$SOURCE_DATE_EPOCH" \
> +   && test $year -gt 2010; then
>    test $year =3D $3 || exit 1
>  fi
>
> diff --git a/t/txinfo-vtexi3.sh b/t/txinfo-vtexi3.sh
> index d5ca81679..1c91fc547 100644
> --- a/t/txinfo-vtexi3.sh
> +++ b/t/txinfo-vtexi3.sh
> @@ -73,7 +73,9 @@ $AUTOMAKE
>
>  day=3D'([1-9]|1[0-9]|2[0-9]|3[01])'
>
>  month=3D'(January|February|March|April|May|June|July|August|September|Oc=
tober|November|December)'
> -year=3D'20[0-9][0-9]' # Hopefully automake will be obsolete in 80 years =
;-)
> +year=3D'(20|19)[0-9][0-9]' # Hopefully automake will be obsolete in 80
> years ;-)
> +                         # Allow 19xx for SOURCE_DATE_EPOCH possibilitie=
s.
> +#
>  date=3D"$day $month $year"
>
>  do_check ()
> diff --git a/t/txinfo-vtexi4.sh b/t/txinfo-vtexi4.sh
> index 1c76abda7..a69cc46f2 100644
> --- a/t/txinfo-vtexi4.sh
> +++ b/t/txinfo-vtexi4.sh
> @@ -28,11 +28,22 @@ required=3D'makeinfo tex texi2dvi grep-nonprint'
>  # differ depending on local time.
>  TZ=3DUTC0; export TZ
>
> -test $(LC_ALL=3DC date '+%u') -gt 0 && test $(LC_ALL=3DC date '+%u') -lt=
 8 \
> -  && day=3D$(LC_ALL=3DC date '+%d')   && test -n "$day" \
> -  && month=3D$(LC_ALL=3DC date '+%B') && test -n "$month" \
> -  && year=3D$(LC_ALL=3DC date '+%Y')  && test -n "$year" \
> -  || skip_ "'date' is not POSIX-compliant enough"
> +if test -n "$SOURCE_DATE_EPOCH"; then
> +  # use mdate-sh to parse SOURCE_DATE_EPOCH.
> +  get_shell_script mdate-sh
> +  result=3D`mdate-sh /irrelevant`
> +  echo "result of mdate-sh: $result"
> +  day=3D`echo $result | awk '{print $1}'`
> +  month=3D`echo $result | awk '{print $2}'`
> +  year=3D`echo $result | awk '{print $3}'`
> +else
> +  test $(LC_ALL=3DC date '+%u') -gt 0 && test $(LC_ALL=3DC date '+%u') -=
lt 8 \
> +    && day=3D$(LC_ALL=3DC date '+%d')   && test -n "$day" \
> +    && month=3D$(LC_ALL=3DC date '+%B') && test -n "$month" \
> +    && year=3D$(LC_ALL=3DC date '+%Y')  && test -n "$year" \
> +    || skip_ "'date' is not POSIX-compliant enough"
> +fi
> +#
>  day=3D$(echo "$day" | sed 's/^0//')
>
>  cat > configure.ac << END
>
> compile finished at Fri Jun 20 09:04:52 2025
>
>