Experimental Physics and Industrial Control System
I think that any module which exports an API should be exporting its
version number. This simplifies managing API changes in dependent code.
Base has been doing this for a long time, both as a header file
(epicsVersion.h) and Make variables (cf. configure/CONFIG_BASE_VERSION).
As I recently went through this exercise with the pvDataCPP and
pvAccessCPP modules I thought it might be worth explaining a recipe for
support modules to do the same while keeping the version number in only
one place.
The components of version number are kept in "configure/CONFIG_PVD"
which is installed as "$(INSTALL_LOCATION/cfg/CONFIG_PVD". This file
will be automatically included in dependent builds since at least
3.14.12.4 (and maybe back to 3.14.10).
https://github.com/epics-base/pvDataCPP/blob/master/configure/CONFIG_PVD
CONFIG_PVD is installed using
https://github.com/epics-base/pvDataCPP/blob/master/configure/Makefile#L5
The next step is to push the version number into a C header. For PVD I
chose to have a two part header, with one part being generated from a
template (pvdVersionNum.h) and the other static (pvdVersion.h). This
could also be done with only the one file, as with epicsVersion.h.
https://github.com/epics-base/pvDataCPP/blob/master/src/pv/pvdVersionNum.h%40
The rules to expand this template (using expandVars.pl from Base):
https://github.com/epics-base/pvDataCPP/blob/master/src/Makefile#L34
Note that the library SONAME is also set to the release version. This
is a safe default for those who don't want to think ABI versioning.
The header is installed as well:
https://github.com/epics-base/pvDataCPP/blob/master/src/pv/Makefile#L15
Attachment:
signature.asc
Description: OpenPGP digital signature
- Replies:
- Re: exporting module versions Andrew Johnson
- Navigate by Date:
- Prev:
Jenkins build is back to normal : epics-base-3.15-mac-test #149 APS Jenkins
- Next:
Re: exporting module versions Andrew Johnson
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
<2017>
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Jenkins build is back to normal : epics-base-3.15-mac-test #149 APS Jenkins
- Next:
Re: exporting module versions Andrew Johnson
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
<2017>
2018
2019
2020
2021
2022
2023
2024