Make GNU autogen optional: commit the AutoOpts-generated files (#895 phase 1) - #1028
Merged
Conversation
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>
7 tasks
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.
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-helpand the config-file behavior (used bymake testitself, viatcpprep --load-opts config) disappeared. But the runtime — the vendoredlibopts/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
src/*_opts.c/h,src/tcpedit/tcpedit_stub.hand the man pages are now in git, generated reproducibly (relative.defpaths in the headers;NETMAPFLAGSdropped from generation after proving output is byte-identical with and without it)..defis newer. When autogen is missing, configure substitutesscripts/missing-autogen, so a firing rule fails with clear instructions (install autogen, ortouchthe outputs if the.defcontent is unchanged) instead of silently building stale parsers.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.scripts/check-generated-opts.shregenerates everything into a scratch copy and diffs against the committed files (man-page.THdates normalized). The Linux tests job runs it on every push, so committed output can never drift from the.defsources.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
.defpaths error clearly on both (verified with autogen removed)..defis byte-stable (git diffempty).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