always build extensions with appropriate version of pg_config #1071
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.
There is a flaw in the building of extensions bg_mon, pg_auth_mon, set_user, pg_permissions, pg_profile, and anything in
EXTRA_EXTENSIONS
.The way the extensions are built is:
When the
PGOLDVERSIONS
variable is populated in ascending order (e.g.15 16
), everything is built correctly.However, when
PGOLDVERSIONS
is populated in descending order (e.g.16 15
), the extensions are built (multiple times) against the highest PG version in that variable.This is because pg_config is resolved in the build environment to reference the PostgreSQL installation with the highest major version.
So when a higher version is installed before any lower versions, the extensions are built against the higher version repeatedly.
The fix is pretty simple, and already used for building some other extensions.
We can pass PG_CONFIG variable set to appropriate
$version
(the iterator over the PostgreSQL major version) to make, and consequently the extensions are always built against all PG versions, regardless of their ordering.building current head with "correct" order of PGOLDVERSIONS:
building current head with "bad" order of PGOLDVERSIONS
building fix with "bad" order of PGOLDVERSIONS
Best regards
Julian