Skip to content

Make GNU autogen optional: commit the AutoOpts-generated files (#895 phase 1) - #1028

Merged
fklassen merged 3 commits into
v4.6.0-beta1from
feature-895-optional-autogen
Jul 19, 2026
Merged

Make GNU autogen optional: commit the AutoOpts-generated files (#895 phase 1)#1028
fklassen merged 3 commits into
v4.6.0-beta1from
feature-895-optional-autogen

Conversation

@fklassen

Copy link
Copy Markdown
Member

Summary

Phase 1 of #895 (GNU autogen is EOL; Debian Bug#1076243 wants the Build-Depends dropped).

Why this shape: the reverted #991 replaced the AutoOpts runtime with hand-written getopt, which is why --load-opts, --more-help and the config-file behavior (used by make test itself, via tcpprep --load-opts config) disappeared. But the runtime — the vendored libopts/ tearoff — was never the problem; only autogen the generator is dying. This PR removes the build-dependency while leaving the runtime completely untouched, so every option behavior is preserved by construction.

Changes

  • Committed generated output: src/*_opts.c/h, src/tcpedit/tcpedit_stub.h and the man pages are now in git, generated reproducibly (relative .def paths in the headers; NETMAPFLAGS dropped from generation after proving output is byte-identical with and without it).
  • autotools: rules regenerate in the source tree only when a .def is newer. When autogen is missing, configure substitutes scripts/missing-autogen, so a firing rule fails with clear instructions (install autogen, or touch the outputs if the .def content is unchanged) instead of silently building stale parsers.
  • CMake: regeneration moves to configure time (execute_process) — which also eliminates the last build-time autogen invocation and, with it, the class of parallel-generation races fixed recently. Same clear failure when stale without autogen.
  • Drift protection: scripts/check-generated-opts.sh regenerates everything into a scratch copy and diffs against the committed files (man-page .TH dates normalized). The Linux tests job runs it on every push, so committed output can never drift from the .def sources.
  • CI proof: the macOS tests job, both cmake-build jobs, and cpp-linter now run without autogen installed.

Phase 2 (future)

The drift script doubles as the equivalence oracle for replacing autogen entirely: a new in-tree generator (e.g. Python emitting the same libopts descriptor tables + man pages) must pass the identical comparison while autogen still exists to compare against. Filed as the follow-up direction in #895.

Testing

  • Both build systems build from scratch with autogen physically removed from the system.
  • Stale-.def paths error clearly on both (verified with autogen removed).
  • Regeneration after touching a .def is byte-stable (git diff empty).
  • Full sudo make test, make dist, and the drift check all pass.

Refs #895 (phase 1 of 2 — issue stays open for the generator replacement)

🤖 Generated with Claude Code

galastar and others added 3 commits July 19, 2026 06:01
Phase 1 of #895. GNU autogen is EOL (Debian Bug#1076243) and Debian
wants the Build-Depends gone. The failed approach (#991) replaced the
AutoOpts *runtime* with getopt and lost --load-opts, --more-help and
the config-file behavior the test suite itself depends on. The runtime
(vendored libopts tearoff) was never the problem - only autogen the
generator is dying.

So: commit the generated output, keep the runtime untouched.

- src/*_opts.c/h, src/tcpedit/tcpedit_stub.h and the man pages are now
  committed, generated reproducibly (relative def paths, no NETMAPFLAGS
  - proven byte-identical with and without it)
- automake rules regenerate in the source tree (cd $(srcdir)) only when
  a .def is newer; when autogen is missing, configure substitutes
  scripts/missing-autogen so a firing rule fails with instructions
  instead of silently keeping stale output
- CMake regenerates at configure time via execute_process (this also
  removes the last build-time autogen run and with it the recently
  fixed parallel-generation race), and fails with the same clear
  message when stale without autogen
- scripts/check-generated-opts.sh regenerates everything in a scratch
  copy and diffs against the committed files (man page .TH dates
  normalized); CI runs it on Linux so committed output can never drift
  from the .def sources. It doubles as the phase 2 equivalence oracle
  for a future autogen replacement generator.
- CI proof: the macOS tests job, both cmake-build jobs and cpp-linter
  now run WITHOUT autogen installed

Verified: both build systems build from scratch with autogen removed
from the system; stale-def paths error clearly on both; regeneration
after touching a .def is byte-stable; full test suite and make dist
pass; drift check green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
IS_NEWER_THAN treats equal timestamps as newer, and a fresh git
checkout gives every file the same mtime - so no-autogen CI builds
fataled on 'stale' files that were current. Compare epoch seconds with
GREATER instead, matching make's semantics.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The generated *_opts.c/h files are vendored generator output, not code
we maintain; clang-tidy findings in them are not actionable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@fklassen
fklassen merged commit e09e110 into v4.6.0-beta1 Jul 19, 2026
5 checks passed
@fklassen
fklassen deleted the feature-895-optional-autogen branch July 19, 2026 13:20
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.

2 participants