Fix PGXS DOCS collision: use extension-specific filenames#34
Open
iemejia wants to merge 1 commit into
Open
Conversation
PGXS installs DOCS to a flat shared directory: /usr/share/doc/postgresql-doc-XX/extension/ Multiple extensions using DOCS = README.md collide at the same path, causing silent overwrites in multi-extension installations and Docker-based layering. Generate README.prefix.md and TESTS.prefix.md from source files at build time so installed doc files have unique names.
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.
Fixes #33
Problem
PGXS installs files listed in
DOCSto a flat shared directory:With
DOCS = $(wildcard *.md), bothREADME.mdandTESTS.mdareinstalled to this shared directory. The generic
README.mdfilenamecollides with any other extension that also declares
DOCS = README.md(e.g.,
postgres_protobuf,temporal_tables). When multiple extensionsare installed on the same system or composed via Docker
COPY --fromlayers, the last one silently overwrites the others.
Solution
Change
DOCSto use a*.prefix.mdwildcard pattern. Extension-specificfilenames are generated at build time by copying the source markdown files:
README.md->README.prefix.mdTESTS.md->TESTS.prefix.mdThis way:
.gitignoreand cleaned bymake cleanChanges
Makefile:DOCS = $(wildcard *.prefix.md)+ copy rules + clean target.gitignore: ignore the generated files