Skip to content

Commit a3bce17

Browse files
committed
Automate the maintenance of SO_MINOR_VERSION for our shared libraries.
Up to now we've manually adjusted these numbers in several different Makefiles at the start of each development cycle. While that's not much work, it's easily forgotten, so let's get rid of it by setting the SO_MINOR_VERSION values directly from $(MAJORVERSION). In the case of libpq, this dev cycle's value of SO_MINOR_VERSION happens to be "10" anyway, so this switch is transparent. For ecpg's shared libraries, this will result in skipping one or two minor version numbers between v9.6 and v10, which seems like no big problem; and it was a bit inconsistent that they didn't have equal minor version numbers anyway. Discussion: <[email protected]>
1 parent 41fb35f commit a3bce17

File tree

5 files changed

+20
-18
lines changed

5 files changed

+20
-18
lines changed

src/interfaces/ecpg/compatlib/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ include $(top_builddir)/src/Makefile.global
1616
PGFILEDESC = "ECPG compat - compatibility library for ECPG"
1717
NAME= ecpg_compat
1818
SO_MAJOR_VERSION= 3
19-
SO_MINOR_VERSION= 9
19+
SO_MINOR_VERSION= $(MAJORVERSION)
2020

2121
override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
2222
-I$(libpq_srcdir) -DFRONTEND $(CPPFLAGS)

src/interfaces/ecpg/ecpglib/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ include $(top_builddir)/src/Makefile.global
1616
PGFILEDESC = "ECPG - embedded SQL in C"
1717
NAME= ecpg
1818
SO_MAJOR_VERSION= 6
19-
SO_MINOR_VERSION= 9
19+
SO_MINOR_VERSION= $(MAJORVERSION)
2020

2121
override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
2222
-I$(libpq_srcdir) -I$(top_builddir)/src/port -DFRONTEND $(CPPFLAGS)

src/interfaces/ecpg/pgtypeslib/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ include $(top_builddir)/src/Makefile.global
1616
PGFILEDESC = "pgtypes - library for data type mapping"
1717
NAME= pgtypes
1818
SO_MAJOR_VERSION= 3
19-
SO_MINOR_VERSION= 8
19+
SO_MINOR_VERSION= $(MAJORVERSION)
2020

2121
override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
2222
-DFRONTEND $(CPPFLAGS)

src/interfaces/libpq/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ include $(top_builddir)/src/Makefile.global
1717
# shared library parameters
1818
NAME= pq
1919
SO_MAJOR_VERSION= 5
20-
SO_MINOR_VERSION= 10
20+
SO_MINOR_VERSION= $(MAJORVERSION)
2121

2222
override CPPFLAGS := -DFRONTEND -DUNSAFE_STAT_OK -I$(srcdir) $(CPPFLAGS) -I$(top_builddir)/src/port -I$(top_srcdir)/src/port
2323
ifneq ($(PORTNAME), win32)

src/tools/RELEASE_CHANGES

+16-14
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,12 @@ Starting a New Development Cycle
7373
for example,
7474
git push origin master:refs/heads/REL9_2_STABLE
7575

76+
* Add new branch's name to list in src/tools/git_changelog
77+
7678
* Increment the major version number in src/tools/version_stamp.pl
7779

7880
* Run "src/tools/version_stamp.pl devel", then run autoconf
7981

80-
* Add version tag to src/tools/git_changelog
81-
82-
* Bump minor library versions, major if appropriate (see below)
83-
o Look for SO_MINOR_VERSION macros in
84-
src/interfaces/ecpg/compatlib/Makefile
85-
src/interfaces/ecpg/ecpglib/Makefile
86-
src/interfaces/ecpg/pgtypeslib/Makefile
87-
src/interfaces/libpq/Makefile
88-
8982

9083
Creating Back-Branch Release Notes
9184
==================================
@@ -139,8 +132,7 @@ function which would give the new field a suitable default value.
139132
Adding a new function should NOT force an increase in the major version
140133
number. (Packagers will see the standard minor number update and install
141134
the new library.) When the major version is increased all applications
142-
which link to the library MUST be recompiled - this is not desirable. When
143-
the major version is updated the minor version gets reset.
135+
which link to the library MUST be recompiled - this is not desirable.
144136

145137
Minor Version
146138
=============
@@ -150,9 +142,19 @@ the library has changed, typically a change in source code between releases
150142
would mean an increase in the minor version number so long as it does not
151143
require a major version increase.
152144

153-
Given that we make at least minor changes to our libraries in every major
154-
PostgreSQL version, we always bump all minor library version numbers at the
155-
start of each development cycle as a matter of policy.
145+
Given that we make at least some changes to our libraries in every major
146+
PostgreSQL version, we always bump all minor library version numbers in
147+
each development cycle as a matter of policy. This is currently mechanized
148+
by referencing the MAJORVERSION make macro in the value of SO_MINOR_VERSION
149+
for each shared library. As of v10, SO_MINOR_VERSION is simply equal to
150+
MAJORVERSION in all cases. If we ever make an incompatible break in a
151+
library's API, forcing a major version bump, we could continue to increase
152+
SO_MINOR_VERSION (thus, perhaps, going from libpq.so.5.12 to libpq.so.6.13),
153+
or we could reset SO_MINOR_VERSION to zero, using makefile code along the
154+
lines of
155+
SO_MINOR_VERSION= $(shell expr $(MAJORVERSION) - 13)
156+
so that the number continues to increase automatically in later branches.
157+
For now, that complication is not necessary.
156158

157159
Minimizing Changes
158160
==================

0 commit comments

Comments
 (0)