Add make print-pgtle target for combined pg_tle install files - #94
Draft
jnasbyupgrade wants to merge 1 commit into
Draft
Add make print-pgtle target for combined pg_tle install files#94jnasbyupgrade wants to merge 1 commit into
make print-pgtle target for combined pg_tle install files#94jnasbyupgrade wants to merge 1 commit into
Conversation
`print-pgtle` prints the generated pg_tle registration SQL for each
extension to stdout instead of running it, letting a consumer build a
combined multi-extension install file without needing to know the
extension name or which `pg_tle/` version-range directory applies:
$(MAKE) --no-print-directory -C ../deps/cat_tools print-pgtle >> pgtle-all.sql
Depends on `pgtle` (regenerates SQL first, like `run-pgtle`). Selects
the directory via the new `PGXNTOOL_PGTLE_TARGET_VERSION` variable (an
actual pg_tle version like `1.5.2`) if set, otherwise via the installed
pg_tle version (same detection `run-pgtle` uses). Deliberately not
named bare `PGTLE_VERSION` or reusing `PGXNTOOL_PGTLE_VERSION`: the
former would reopen the issue Postgres-Extensions#78 collision with a CI job's env var of
that name, and the latter holds a range, not an exact version -- two
different concepts that would silently diverge if collapsed into one
variable.
`--no-print-directory` is required whenever this is invoked
recursively for stdout capture: GNU Make auto-prints "Entering
directory"/"Leaving directory" to stdout for recursive invocations,
which would otherwise corrupt the redirected file. Documented
prominently since it's easy to miss.
Documents the new target and variable in README.asc (+ regenerated
README.html).
Related changes in pgxntool-test:
- test/sequential/04-pgtle.bats: PGXNTOOL_PGTLE_TARGET_VERSION directory
selection, non-collision with bare PGTLE_VERSION, and a regression
test for the --no-print-directory requirement
- test/standard/pgtle-install.bats: DB-fallback and not-installed error
path coverage
Fixes Postgres-Extensions#21.
Co-Authored-By: Claude <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
1 task
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
Adds a
make print-pgtletarget that prints the generated pg_tle registration SQL for each extension to stdout instead of running it, so a consumer can build a combined multi-extension install file:pgtle(regenerates SQL first, likerun-pgtle).PGXNTOOL_PGTLE_TARGET_VERSIONvariable (an actual pg_tle version like1.5.2, not a range) selects the directory; falls back to the installed pg_tle version if unset.PGTLE_VERSION(would reopen the pgtle.sh: Makefile's PGTLE_VERSION variable silently collides with a consumer's same-named env var #78 collision) or reusingPGXNTOOL_PGTLE_VERSION(that holds a range, a different concept).Entering directory/Leaving directoryto stdout on recursive invocation, corrupting a redirected combined file unless--no-print-directoryis passed. Called out prominently in README.asc and base.mk.Companion PR
pgxntool-test: Postgres-Extensions/pgxntool-test#(link added once opened)
Test plan
Fixes #21.