Commit Graph

6 Commits

Author SHA1 Message Date
Chrissie Caulfield
6d35611524
doxygen2man: Add option to read copyright line from the header file (#415)
* doxygen2man: Add option to read copyright line from the header file

This should help make builds reproducible.

I tried various methods of getting the date, using 'git' is no use as
it could be run from a tarball, using the file date doesn't work either
so this seems a reasonable compromise.

* man: Use SOURCE_EPOCH to make manpage dates reproducible

Also add build-aux/update-copyright.sh to keep header file
copyright lines up-to-date.

All code taken from knet
2020-09-09 15:06:55 +01:00
Chrissie Caulfield
633f2624a7
logging: Remove linker 'magic' and just use statics for logging callsites (#322)
It is my (and several others') opinion that the linker 'magic' used to maintain callsite data in libqb is hugely over complicated and unnecessarily fragile. It's main purpose seems to have been to improve performance but empirical testing shows this to be tiny at best. The overhead of sprintf makes minor optimisations in this code pointless.

With this code removed, libqb allocates callsites using a C static variable at run-time. This sounds bad but in actuality it merely moves the allocation from program load time to the first few milliseconds of program run-time. Applications like corosync and pacemaker spend most of their time in small loops doing the same work over and over again so the overhead doesn't apply and jitter does not occur.

We've tested this with corosync and pacemaker under valgrind and massif and the differences are minimal and even then only show up under artificial stress testing.

For this change I've bumped the soname up to 20 to indicate this is an incompatible change. I'm open to suggestions as to a release number but am currently thinking of 2.0.0
2018-09-27 09:20:06 +01:00
Jan Pokorný
c011b12fca
Low: fix internal object symbol's leak & expose run-time lib version
The object in question has never been published through the header file,
hence it's presumably safe to make it static as it's meant to be.

On the other hand, QB_LOG_INIT_DATA macro from qblog.h has already
started to depend on that symbol so as to locate the library handle
for libqb itself correctly.  This is trivially fixed by finally exposing
library versioning info in run-time ("online") as a structure with
members corresponding to compile-time ("offline") counterparts from
qbconfig.h header file, which are admittedly of very limited use
as opposed to the newly introduced dynamic info, plus lower-cased
equivalent of QB_VER_STR.  Better than to roll out a futile data object
serving as an artificial anchor for the above purpose, and this was
due for a while, afterall.

In turn, also bump "current" and "age" of fields of the libtool's
"-version-info" versioning system.

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2017-12-12 23:23:46 +01:00
Jan Pokorný
5accb7ae8c
API: header-based versioning: s/PATCH/MICRO
Under the influence of libxml2 and considering that actual "patch"
information in fact, if significant, ends up encoded in QB_VER_REST,
shift away from convention codified, e.g., by semver.org (not adored
by libqb, anyway) and rename designated PATCH component of the version
to MICRO accordingly.

Note that at this point, after a release without any header-based
versioning present and just a few commits after it was tentatively
introduced, it's a painless change.  Once this PATCH nomenclature
is leaked into a full release, there's no way to get rid of it
reasonably...
2016-04-18 19:08:28 +02:00
Jan Pokorný
137b3dea5b
API: introduce alternative, header-based versioning
Mainly as a light-weight alternative to full-blown autoconf/pkg-config
machineries, whereby one can:

* workaround functionality not present in libqb up to 1.0 (inclusive)
  - note that this versioning schema is being introduced *after*
    1.0.0 release so one cannot tell that version from any older,
    but will be able to safely identify any later one (1.0.1+)
    and act accordingly
  - example:
  #if !defined(QB_VER_MAJOR) || ((QB_VER_MAJOR == 1) && (QB_VER_MINOR < 1))
  #warning "Feature X not supported"
  int do_foo(int arg) { };
  #else
  int
  do_foo(int arg)
  {
      /* use feature X of libqb */
  }
  #endif

* make its program report libqb API version it was built with by
  emitting QB_VER_STR symbolic string (see tests/print_ver.c for example)

Also added is a print_ver test program to:

* emit how original unparsed version is parsed to particular components
  defined in qbconfig.h (QB_VER_{MAJOR,MINOR,PATCH} symbolic integer
  constants and QB_VER_REST symbolic string) when being compiled

* emit mentioned QB_VER_STR symbolic string joining the components
  back to a single string, plus the components themselves

Resolves: https://github.com/ClusterLabs/libqb/issues/186
2016-04-01 23:19:40 +02:00
Angus Salkeld
b7e83fd3b2 LOG: add dynamic callsites (for platforms that don't support __attribute__(section)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-14 16:05:38 +10:00