Fix macOS build failure from libtool version mismatch

Merged
JA
2mo ago
+96-20

Every open PR has been failing the same Build MacOS dylib job since early August, which gates the Linux/Windows/test jobs (they show as skipping). One root cause, not five.

Failure

libtool: Version mismatch error.  This is libtool 2.5.4 Debian-2.5.4-4, but
libtool: the definition of this LT_INIT comes from libtool 2.6.2.
make[1]: *** [libarchive/archive_acl.lo] Error 63

build-macos.sh ran aclocal && automake && autoconf before configuring xz and libarchive. aclocal rewrites aclocal.m4 from the host libtool.m4 but leaves the tarball’s build/autoconf/ltmain.sh alone, so the generated libtool script and the LT_INIT macro come from different libtool releases.

That stayed benign while the runner’s libtool matched the tarball’s 2.5.4. It broke the moment Homebrew moved to 2.6.2 — which is why all five open PRs started failing simultaneously without any of them touching the native build. The build workflow only runs on PR branches, so main never surfaced it.

Why the regeneration existed

It was guarding a real problem, so this doesn’t just delete it. These tarballs ship files generated by a specific automake; if mtimes fall out of dependency order, make fires the autotools rebuild rules and demands the exact tool version:

build/autoconf/missing: line 85: automake-1.17: command not found
make: *** [Makefile.in] Error 1

Regenerating avoided that but traded it for the libtool coupling above.

Fix

Stamp the generated files in dependency order instead, so no rebuild rule fires at all:

configure.ac/Makefile.am/m4 -> aclocal.m4 -> configure -> config.h.in -> Makefile.in

The tarball’s own generated files are kept and stay mutually consistent, so neither the host automake version nor the host libtool version can affect the build — the class of breakage goes away rather than moving.

This also replaces the previous xz-only timestamp workaround, which touched files in the wrong order (leaving aclocal.m4 newer than configure and Makefile.in) and only worked because the four touch calls usually landed within the same second.

libxml2 is deliberately excluded: it is built via its own autogen.sh, a full self-consistent autoreconf that refreshes ltmain.sh too.

Verification

Run locally on macOS against the real tarballs:

  • Reproduced Error 63 by putting 2.6.2 LT_INIT macros over the tarball’s 2.5.4 ltmain.sh — confirms the root cause.
  • Reproduced the automake-1.17: command not found path from timestamp skew — confirms the regeneration’s original purpose is still needed.
  • With the fix, built from a worst-case-skewed tree (aclocal.m4/configure.ac forced newest): configure and make succeed with 0 rebuild rules fired, and aclocal.m4/ltmain.sh both remain the tarball’s own 2.5.4.
  • Validated for both 3.8.8 (current main) and 3.8.9 (#261) — 3.8.9 ships the same 2.5.4 ltmain.sh, so it would hit the identical failure.

shellcheck findings unchanged versus main (34 → 34, none in the new code); pre-commit passes.

Note my local libtool is 2.5.4, so the local runs cannot exercise the 2.6.2 mismatch directly — CI on this PR is the real end-to-end check.

Follow-up

The five open PRs (#255, #261, #264, #265, #266) need rebasing onto main once this lands to pick up the fix.


Summary by cubic

Prevents macOS dylib failures by removing libtool version coupling and deflakes a progress reporting test. Previously we regenerated autotools files and created automake-1.17 symlinks (mixing host libtool.m4 with tarball ltmain.sh) and used async Progress<T> in tests; now we keep tarball-generated files, stamp timestamps to block rebuild rules, drop the symlinks, and use a synchronous IProgress in the test.

  • Add normalize_autotools_timestamps with explicit tiers (via autotools_stamp_tier) that backdate the whole tree, then stamp aclocal.m4 → configure → config.h.in → Makefile.in; applied to libarchive, xz, and lzo; exclude libxml2 (built via its own autogen.sh).
  • Remove aclocal && automake && autoconf for xz/libarchive in the macOS build and delete automake-1.17/aclocal-1.17 symlink creation.
  • Replace racy Progress<T> usage in WriterTests with an inline SynchronousProgress to make assertions deterministic.

Rollout

  • Build/test-only change; no runtime impact.
  • Rebase open PRs onto main after merge to restore macOS CI.