Skip to content

framework: suppress autotools reruns when timestamps are skewed#1530

Draft
novas0x2a wants to merge 6 commits into
mainfrom
suppress-autotools-reruns
Draft

framework: suppress autotools reruns when timestamps are skewed#1530
novas0x2a wants to merge 6 commits into
mainfrom
suppress-autotools-reruns

Conversation

@novas0x2a

Copy link
Copy Markdown
Collaborator

RBE's Content-Addressable Storage strips per-file mtimes, so autotools
source tarballs that ship with carefully ordered timestamps
(configure.ac < aclocal.m4 < configure < Makefile.in) can end
up with equal or reversed timestamps. When make notices this, it tries
to re-run aclocal/autoconf/automake to regenerate the build system —
which fails because the real autotools aren't part of our controlled
environment and the correct version might not be in the PATH.

This is especially insidious because it's flaky: local builds preserve
timestamps via symlinks and pass fine, then the RBE build fails, then
the RBE retry passes because the local build cached the result; the
timestamps are not part of the cache-key interface.

Setting AUTOCONF=true, AUTOHEADER=true, AUTOMAKE=true, and
ACLOCAL=true makes any accidental rerun a silent no-op. This is the
standard technique used by Debian, Yocto, and rpmbuild for building from
release tarballs. The env vars are only injected when the user has not
explicitly requested autotools regeneration via autoconf, autoreconf,
or autogen.

RBE's Content-Addressable Storage strips per-file mtimes, so autotools
source tarballs that ship with carefully ordered timestamps
(`configure.ac` < `aclocal.m4` < `configure` < `Makefile.in`) can end
up with equal or reversed timestamps. When make notices this, it tries
to re-run aclocal/autoconf/automake to regenerate the build system —
which fails because the real autotools aren't part of our controlled
environment and the correct version might not be in the PATH.

This is especially insidious because it's flaky: local builds preserve
timestamps via symlinks and pass fine, then the RBE build fails, then
the RBE retry passes because the local build cached the result; the
timestamps are not part of the cache-key interface.

Setting `AUTOCONF=true`, `AUTOHEADER=true`, `AUTOMAKE=true`, and
`ACLOCAL=true` makes any accidental rerun a silent no-op. This is the
standard technique used by Debian, Yocto, and rpmbuild for building from
release tarballs. The env vars are only injected when the user has not
explicitly requested autotools regeneration via `autoconf`, `autoreconf`,
or `autogen`.
Our autotools-rerun suppression (previous commit) unmasked a latent
issue in m4: gnulib's `iconv_open-*.h` regeneration rules are
unconditional (not guarded by `AM_MAINTAINER_MODE`) and invoke `gperf`,
which isn't available in the sandbox. Previously, autotools itself would
fail first, masking this.

`configure_in_place` gives us a writable source tree (the rules write to
`$(srcdir)`), and `GPERF=true` as a make variable override makes the
regeneration a no-op. The generated headers are platform-specific lookup
tables only `#include`'d on AIX/HP-UX/IRIX/OSF/Solaris/z/OS, so empty
files are harmless on Linux and macOS.
@novas0x2a novas0x2a force-pushed the suppress-autotools-reruns branch from 7174c0f to 8f6f04d Compare April 11, 2026 06:44
Same timestamp-skew pattern as the autotools tools: `makeinfo` (texinfo
docs) and `help2man` (man page generation) are configure-substituted
variables that fire when their outputs look stale. This was previously
masked by aclocal/automake failures aborting the build first.

autoconf and libtool both fail with `makeinfo: command not found` on RBE
once the autotools suppression lets the build proceed far enough to hit
the doc-generation rules.
Same gnulib iconv_open-*.h pattern as m4 — unconditional gperf rules
that fire when RBE flattens timestamps.
autoconf's man page rules invoke help2man via the missing script, which
overrides the env var we set in the framework. Pass HELP2MAN=true as a
make variable override instead.

bison tries to bootstrap itself (YACC rule regenerates parse-gram.c
using the bison binary being built). configure_in_place flattens all
source timestamps to the same value, preventing make from seeing stale
outputs and triggering the self-referential rebuild.
@novas0x2a novas0x2a marked this pull request as draft April 13, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant