framework: suppress autotools reruns when timestamps are skewed#1530
Draft
novas0x2a wants to merge 6 commits into
Draft
framework: suppress autotools reruns when timestamps are skewed#1530novas0x2a wants to merge 6 commits into
novas0x2a wants to merge 6 commits into
Conversation
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.
7174c0f to
8f6f04d
Compare
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 endup 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, andACLOCAL=truemakes any accidental rerun a silent no-op. This is thestandard 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.