Fix duplicate DOCS entries when asciidoctor is present#3
Conversation
When asciidoctor is installed, DOCS is built by two paths: - Line 23: $(wildcard doc/*) picks up any committed .html files - Line 135: ASCIIDOC_HTML adds the generated .html targets If a .html file is committed alongside its .adoc source (as in doc/object_reference.html + doc/object_reference.adoc), the file appears in DOCS twice. This causes `install` to pass the same path to /usr/bin/install twice in a single invocation, which fails with: install: will not overwrite just-created '...html' with '...html' Fix by using $(filter-out) to remove any ASCIIDOC_HTML entries already present in DOCS before appending them, then $(sort) to deduplicate. This matches the approach already taken in Postgres-Extensions/pgxntool 2.x.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR modifies a single makefile variable assignment in Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
The correct fix is to update pgxntool, not hack it. |
Problem
When
asciidoctoris installed,make installfails with:DOCSends up containingdoc/object_reference.htmltwice:pgxntool/base.mk:$(wildcard doc/*)picks up the committed.htmlfileDOCS += $(ASCIIDOC_HTML)adds the same path again as a generated asciidoc targetBoth paths expand to the same filename, so
installreceives it twice in one invocation and refuses to overwrite a file it just wrote.Fix
Use
$(filter-out)to remove anyASCIIDOC_HTMLfiles already present inDOCSbefore appending, then$(sort)to deduplicate. This is the same approach already taken in Postgres-Extensions/pgxntool 2.x.Reproducer
Any project that commits its generated
.htmldoc alongside its.adocsource, withasciidoctorin PATH.