Commit Graph

40 Commits

Author SHA1 Message Date
Jan Friesse
066508666e
spec: Migrate to SPDX license (#487)
Both Fedora and openSUSE now recommends to use SPDX shortname format
for License.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2023-06-07 07:18:46 +01:00
Chrissie Caulfield
a3aedbc419
tests: allow -j to work (#485)
build: fix several issues with building tests

- MAINTAINERCLEANFILES should not rely on conditionals
  that could or could not clean files.

- EXTRA_DIST should not rely on conditonals that could
  or could not add files to the final tarball.
  sources should always ship.

- CLEANFILES should not rely on conditionals as
  ./configure can be done in between builds leaving
  stray files around.

- (cosmetic) move distclean-local: target with clean-local.

- drop old ipc_sock.test, start.test and resources.test
  shell files.

- fix make distcheck -j:
  - stop shipping or not shipping libstat_wrapper.so.
    libtool will only generate the .so when installing
    a shared library (--enable-install-tests).
  - make libstat_wrapper a module in a similar fashion
    of _failure_injection.
  - build ipc_sock.test in a similar fashion as ipc.test
    and link as module _libstat_wrapper.la.
    this solves multiple issues of having the binary
    in the final test builddir, no need to detect if
    libstat_wrapper.so is installed or not and workaround
    libtool different linking methods for inst vs noinst
    libraries.

- fix ipc.test linking with GLIB that should not be
  dependent on HAVE_FAILURE_INJECTION.

Run tests in parallel with dependancies
Make sure the two IPC tests use different socket names
Shortedn some names so they fit with the new ipc-names
remove ipc-test-name-sock
Fix resources.test now that ipc_sock is being run properly

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
2023-05-26 20:21:43 +02:00
Fabio M. Di Nitto
93f9975617
Doxygen2man (#388)
* doxygen2man: Add utility to generate man pages from doxygen

This is in here from kronosnet so it cna be used by other parts
of the cluster stack.

* [man] drop trailing white spaces

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>

* [build] cleanup variable names

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>

* [build] add conditionals to use internal or external doxygen2man

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>

* Update .gitignore

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>

Co-authored-by: Christine Caulfield <ccaulfie@redhat.com>
2020-03-18 10:29:38 +01:00
Fabio M. Di Nitto
44386edf7d [tests] enable building / shipping of libqb-tests.rpm
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2019-03-26 11:31:05 +00:00
Chrissie Caulfield
926e851fbb
log: Remove more dead code from linker callsites (#331)
Thanks for the review
2018-11-12 15:55:33 +00:00
Jan Pokorný
454610697b
tests: new sort of tests dubbed "functional", cover linker vs. logging
These are for quick manual sanity checking, assuming the target audience
-- maintainers -- are clear on the context of use and the purpose
(perhaps with the help of static files for comparison and/or additional
checking harness, usually available through "make check", but not to be
confused with regular unit + broader tests).  These test are meant to be
compiled on demand only, not during the standard building routine, for
which a trick leveraging GNUmakefile-Makefile precedence with GNU make
was devised (GNU make/gmake already required by configure script for
other reasons [some pattern-based matching not available with FreeBSD's
default "make", IIRC], so this introduces no new build dependency).

The respective new tests are meant to simulate logging variants in two
different library consumption models:
  a. regular: linking against system-wide library
  b. developmental: consuming library from a local sub-checkout tree,
                    using libtool conventions and hence attaching the
                    library through libqb.la intermediate library
                    descriptor of libtool
and between up to three possibly affected logging system participants
(discrete compilation units):
  1. libqb itself will emit log messages in boundary conditions or
     for tracing purposes
  2. client program that consumes libqb's logging API directly
  3. ditto, but the client program furthermore links with a library
     (referred to as "interlib") that itself exercises the logging
     API (it's also linked with libqb) -- through induction, this
     should cover whole class of N interlib cases

Especially the latter perspective makes for a test matrix to possibly
(hopefully) demonstrate a fix allowing to cope with the changed
behaviour of ld from binutils 2.29+ wrt. boundaries denoting symbols for
a (custom) orphan section that are no longer externally visible.  Such
commit is in the pipeline...

Developmental consumption model (a.) is now also tested automatically
in Travis CI runs and as a part of %check within upstream-suggested
libqb.spec for RPM packaging, whereas the regular one (b.) serves as
a building block for new log_test_mock.sh runner of said test matrix
-- it iterates through all the possible permutations of linker-imposed
implicit visibility of mentioned symbols between various affected
link participants all making use of logging (see 1. - 3. above) so as
to demonstrate A/ the impact of the problem (see table below), and
subsequently B/ that the fix is effective in all these situations
(updated table will be provided as well) once it lands.  This script
also allows convoluting the test matrix further, notably with on-demand
defusing the self-checks based on QB_LOG_INIT_DATA macro, which is
of significance as demonstrated below (and will become even more
important with upcoming patches in this series).

* * *

Current state for such matrix, in which participants 1. - 3. map like:
  1. ~ libqb(Y)
  2. ~ "direct"
  3. ~ libX(Y)  [a.k.a. interlib]
and where "X(Y)" denotes "X linked with linker Y":
  X(a) .. ld.bfd < 2.29
  X(b) .. ld.bfd = 2.29 (and only 2.29),
goes like this:

+=========+=========+=========+=========+=========+=========+=========+
#client(x)#        libqb(a) usage       #        libqb(b) usage       #
#   vvv   #---------+---------+---------+---------+---------+---------+
#    V    #  direct | libX(a) : libX(b) #  direct | libX(a) : libX(b) #
+=========+=========+=========+=========+=========+=========+=========+
#  x = a  #   OK    |   OK    : BAD[*2] # BAD[*1] | BAD[*D] : BAD[*3] #
#  x = b  # BAD[*A] | BAD[*B] : BAD[*C] # BAD[*1] | BAD[*C] : BAD[*3] #
+=========+=========+=========+=========+=========+=========+=========+

whereas if we swap 2.29 for 2.29.1, i.e., X(b) .. ld.bfd = 2.29.1, we
can observe a somewhat simpler story (DEP ~ "depends"):

+=========+=========+=========+=========+=========+=========+=========+
#client(x)#        libqb(a) usage       #        libqb(b) usage       #
#   vvv   #---------+---------+---------+---------+---------+---------+
#    V    #  direct | libX(a) : libX(b) #  direct | libX(a) : libX(b) #
+=========+=========+=========+=========+=========+=========+=========+
#  x = a  #   OK    |   OK    : DEP[*J] # BAD[*1] | BAD[*1] : BAD[*L] #
#  x = b  # DEP[*I] | DEP[*I] : DEP[*K] # BAD[*1] | BAD[*1] : BAD[*L] #
+=========+=========+=========+=========+=========+=========+=========+

* * *

[*1] client logging not working
[*2] interlib logging not working
[*3] both client and interlib logging not working

[*A] boils down to [*1], unless QB_LOG_INIT_DATA used on client side,
     which fails on 'implicit callsite section is populated' assertion
[*B] boils down to [*1], unless QB_LOG_INIT_DATA used on interlib side,
     which fails on 'implicit callsite section is populated' assertion
[*C] boils down to [*3], unless QB_LOG_INIT_DATA used on interlib side,
     which fails on 'implicit callsite section is populated' assertion
[*D] boils down to [*3], unless QB_LOG_INIT_DATA used on interlib side,
     which makes it boil down just to [*1] (hypothesis: mere internal
     self-reference to the section's boundary symbols makes them
     overcome some kind of symbol garbage collection at the linkage
     stage, so they are exposed even they wouldn't be otherwise as
     demonstrated with the initial, plain case of [*3])

[*I] boils down to [*1], unless QB_LOG_INIT_DATA used on client side,
     which makes it, likely through self-reference keepalive (see
     below) work OK
[*J] boils down to [*2], unless QB_LOG_INIT_DATA used on interlib side,
     which makes it, likely through self-reference keepalive (see
     below) work OK
[*K] boils down to [*3], unless QB_LOG_INIT_DATA used on both client
     and interlib side, which makes it, likely through self-reference
     keepalive (see below) work OK  (it's expected that this a mere
     composite of situations [*I] and [*J] with consequences as stated)
[*L] boils down to [*3], unless QB_LOG_INIT_DATA used on interlib side
     (sufficient?), which makes it, likely through self-reference
     keepalive (see below) boil down just to [*1]

* * *

Note: as observed with [*D] case (libqb linked with ld.bfd < 2.29
whereas interlib and its client linked with ld.bfd = 2.29), the exact
availability of a working logging doesn't depend solely on the linkers
in question, but generally (further investigation out of scope) the
conclusion is that when 2.29 ld.bfd is involved somewhere in the chain
of logging-related discrete compilation units, also (self-)referencing
of the section's boundary denoting symbols is a deciding factor whether
particular logging source will be honored.  This may be a result of
some internal linkage garbage collection mechanisms involved.
Anyway, it is supposed that the fix to broken-by-linkage logging can be
proclaimed complete once all combinations pass barring QB_LOG_INIT_DATA
usage (incurring the mentioned active referential use of the symbols),
along with a spin using it everywhere for good measure.

For another level of the analysis depth, one can further play with
combinations of -n{sc,cl,il} options (explained upon -h switch) to
log_test_mock.sh (taking an oracle, this is added mostly to justify
the upcoming self-check test change because linker-script-based
workaround for newer linkers will cause the section boundary symbols
to be present regardless if that section is utilized, leading to
a self-inflicted breakage due to these empty section symbols suddenly
winning in the symbol resolution mechanism).

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2017-12-12 20:46:02 +01:00
Jan Pokorný
2906830717
maint: make -devel package dependency on the main package arch-qualified
Beside the fact that libqb.so file delivered with that package is indeed
referring to arch-preserving binary library (present in the same,
arch-specific path as the libqb.so happens to reside), it's also
a matter of being disciplined per what distros reasonably require:
https://fedoraproject.org/wiki/Packaging:Guidelines#Requiring_Base_Package

The syntactic provision at hand was introduced in rpm 4.6.0
(8+ years ago): http://rpm.org/user_doc/arch_dependencies.html

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2017-11-15 22:59:29 +01:00
Jan Pokorný
602d04dacf
build: drop allegedly no longer intrusive syslog-tests opt-in switch
The intention behind enabling the syslog tests on demand (642f74d) was
to tread cautiously as libtool used to alert that something controversial
is going on:

$ ./autogen.sh && ./configure --enable-syslog-tests && make check
> ...
> *** Warning: Linking the executable log.test against the loadable module
> *** _syslog_override.so is not portable!
> ...

owing to the fact that _syslog_override.so is being linked (through
libtool) with LDFLAGS=-module.

In fact, the issue did go away with a fix to the "make install" process
(ebcff54) for which _syslog_override.so* files were being picked
undesirably prior to the fix, which manifested itself also on
"make rpm" (hence the respective commit message):

> RPM build errors:
>     Installed (but unpackaged) file(s) found:
>    /usr/lib64/_syslog_override.so
>    /usr/lib64/_syslog_override.so.0
>    /usr/lib64/_syslog_override.so.0.0.0

The explanation for the secondary positive effect on the mentioned
libtool's warning going away is rather simple:
"lib" prefix switches the expectations about the result as a library
(also due to "libdir" destination) rather than as an executable object.
Change like that ensures the result is what libtool's manual calls
"dynamic module that can be opened by lt_dlopen" rather than "runtime
library that cannot" in the context of Mac OS X, which was likely the
cause of the portability warning.
(https://www.gnu.org/software/libtool/manual/libtool.html#FOOT10)

And because the tests themselves are run through the libtool wrapper
scripts capable of relinking and other magic

What libtool manual has to say on this topic:
> Note that libtool modules don’t need to have a "lib" prefix. However,
> Automake 1.4 or higher is required to build such modules.
referring to version released 15+ years back, which is assumed anyway.
(https://www.gnu.org/software/libtool/manual/libtool.html#Modules-for-libltdl)

* * *

That being said, there's now no longer a reason to have "syslog-tests"
enablement conditionalized (no longer supposed intrusive), hence enable
them unconditionally along the other libcheck-based tests
-- whenever libcheck is detected.

This changeset also drops any trace of --enable-syslog-tests switch
in various places using that (spec file, Travis CI configuration)
making for a complete vaporizatio of this choice.
2016-12-12 12:18:37 +01:00
Jan Pokorný
6da5cc1368
maint: qb-blackbox man page should accompany the binary 2016-09-22 20:59:40 +02:00
Jan Pokorný
8ab2799599
tests: ensure verbose output on failure w/ more recent automake
...so as to obtain a first glance diagnostics in all cases with possibly
remote build system preventing other means of investigation.
2016-04-28 21:56:05 +02:00
Chrissie Caulfield
63b97b2dea Merge pull request #199 from jnpkrn/CI-make-rpm
CI: make sure RPM can be built all the time
2016-03-10 09:18:49 +00:00
Jan Pokorný
9c8814522d
CI: make sure RPM can be built all the time
This is to prevent issues like the one being fixed with ebcff54
(https://github.com/ClusterLabs/libqb/pull/197).

Also, plain "make" invocation is dropped as it is an integral part
of "make rpm" (%build phase in libqb.spec).
2016-03-09 15:34:26 +01:00
Jan Pokorný
df5e8d6295
build: switch to XZ tarball format for {,s}rpm packaging
References:
http://rpm.org/gitweb?p=rpm.git;a=commit;h=8078d0b (~2009)
http://rpm.org/gitweb?p=rpm.git;a=commit;h=3d63df6 (ditto)
2016-03-08 21:38:37 +01:00
Jan Pokorný
4239f4b833
build: enable syslog tests when configuring in spec
...hence make syslog tests executed in %check.
2016-03-01 14:37:31 +01:00
Jan Pokorný
4fd4e5e71b
spec cleanup: drop redundant %{buildroot} cleaning
References:
http://pkgs.fedoraproject.org/cgit/rpms/redhat-rpm-config.git/commit/?id=159a65f
(~2010)
2016-02-03 15:44:40 +01:00
Jan Pokorný
4037a3684d
spec cleanup: summary should not end with a dot
References:
https://fedoraproject.org/wiki/Common_Rpmlint_issues#summary-ended-with-dot
https://en.opensuse.org/openSUSE:Specfile_guidelines#Summary

+ it's an internal inconsistency with Summary for -devel package
2016-02-03 15:44:04 +01:00
Jan Pokorný
b7108edaff
spec cleanup: get rid of redundant %clean section
References:
http://rpm.org/gitweb?p=rpm.git;a=commit;h=3fc5824 (~2009)
2016-02-03 09:59:33 +01:00
Jan Pokorný
11a5cea3a6
spec cleanup: remove ignored BuildRoot tag
References:
http://rpm.org/gitweb?p=rpm.git;a=commit;h=6c06519 (~2008)
2016-02-03 09:59:05 +01:00
Jan Pokorný
018fbfa5f2
spec cleanup: get rid of redundant defattr
References (first one is a direct trigger):
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/KEO7AX3JXR2TY6OVL4M7HDISZ6YIJNKU/#2UFET77NHMJTG4NA2ECRVH2KO3W56ZWD
http://rpm.org/gitweb?p=rpm.git;a=commit;h=47ea5da (~2004)
2016-02-03 09:58:38 +01:00
Ken Gaillot
d41b234a65 doc: improve README and RPM description 2015-08-18 09:14:51 -05:00
David Vossel
ec8de8d461 Fix: spec: reference correct url in spec file 2014-02-19 12:38:37 -05:00
Andrew Beekhof
80d33e80a6 Fix removal of automatically installed doc files when building rpms 2012-08-23 10:22:18 +10:00
Andrew Beekhof
d670515da1 Add the blackbox reader manpage to the spec file 2012-05-28 12:49:01 +10:00
Angus Salkeld
c41f2c93a0 Add a tool to dump the blackbox.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 11:16:00 +10:00
Angus Salkeld
93a0506d69 Fix references to README
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-06-23 14:46:36 +10:00
Angus Salkeld
42e63c278d SPEC: make the spec file more like the fedora one.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-30 12:47:40 +11:00
Angus Salkeld
9fac3c204e RPM: make the spec more like a fedora spec file
fix tarball url
add procps to BuildRequires
add a "make check" section
change %(buildroot) to $RPM_BUILD_ROOT

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-01-31 11:24:30 +11:00
Angus Salkeld
87b2392f07 RPM: add missing build dependancies
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-01-09 17:22:58 +11:00
Angus Salkeld
487f611cb9 BUILD: improve the rpm building
copy corosync's rpm build system.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-01-09 17:22:24 +11:00
Angus Salkeld
9745d4feb7 Add a resizable array that doesn't move memory.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-19 07:05:54 +11:00
Angus Salkeld
e7b46822d5 ATOMIC: fix make distcheck
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-19 07:05:54 +11:00
Angus Salkeld
57af215a96 Remove timer.c (rather use mainloop)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-12 21:53:52 +11:00
Angus Salkeld
08e5a9004d Add a priority based main loop.
This is to try and get a better balance in the amount
of processing between IPC and totem in corosync.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-12 21:53:52 +11:00
Angus Salkeld
72fdbae734 SPEC: Fix the rpm spec file
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-06 20:39:09 +11:00
Angus Salkeld
bd2c07f739 Add a ringbuffer based off the one in logsys.
This ringbuffer is usable across processes.
the point is to use this for IPC to provide async
connections from client to server, but with inherient
flow control.

This still needs a bit of clean up, but committing now
for feedback and as it is quite functional.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-06-10 12:44:27 +10:00
Angus Salkeld
6255c651df Fix the installation of libqb.pc
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-05-31 11:21:03 +10:00
Angus Salkeld
7cfb5e472f Roll all little libs into libqb.
This really makes things simpler (to produce and use).

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-05-27 11:34:58 +10:00
Angus Salkeld
caecbe6542 Re-license to LGPL 2.1
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-05-25 06:11:59 +10:00
Angus Salkeld
f0834863c6 fix "make distcheck"
I am sure that I am going to learn one day :(

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-04-29 21:24:21 +10:00
Angus Salkeld
40f235a889 libtool and code re-structure
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-04-15 23:25:29 +10:00