Commit graph

3786 commits

Author SHA1 Message Date
888099466f release prep: remove defunct autotools buildsystem 2013-10-29 03:47:50 +01:00
d15ec47f9e DOC: some further round-up and polishsing 2013-10-28 06:14:42 +01:00
2c4ed4ca91 DOC: update and polish the building tutorial 2013-10-28 00:19:03 +01:00
9652c7ec5e Debian/Repo: reorganise the Git repository URLs
all debian package repositories are now located below
git://lumiera.org/debian/...
2013-10-27 10:18:38 +01:00
8b088d201e DOC: complete the "Contributing" tutorial with some proposed tasks to work on 2013-10-27 08:42:46 +01:00
39230436a3 DOC: slightly shorten and re-structure the "Contributing" tutorial
- prefer lower headline levels, more structuring
- turn some headlines into bullet lists
- cross-link to the "Building Lumiera" tutorial
2013-10-27 08:41:40 +01:00
a2c27dbcaa DOC: minor formatting tweaks to Benny's "contributing" page 2013-10-26 00:51:07 +02:00
bc185742aa DOC: rewrite and improve the 'contributing' tutorial; a Git 'mini HOWTO' 2013-10-26 00:03:19 +02:00
6822a9e2fb DOC: reorganise the Doxygen configuration and structure
- upgrade the configuration to a current version
- provide a frontpage with cross-links to other documentation
- define a set of modules; relevant classes and files can be
  added to these, to create a exploration path for new readers
- fix a lot of errors in documentation comments
- use a custom configuration for the documentation pages
- tweak the navigation, the sections and further arrangements
2013-10-25 06:34:38 +02:00
974c670d41 fix **** in doxygen comments
to make them stand out more prominently, some entity comments
where started with a line of starts. Unfortunately, doxygen
(and javadoc) only recogise comments which are started exactly
with /**

This caused quite some comments to be ignored by doxygen.
Credits to Hendrik Boom for spotting this problem!

A workaround is to end the line of stars with *//**
2013-10-24 23:06:36 +02:00
7967f6270d bugfix: don't call the dtor on failed objects
When a ctor throws, the dtors of sub-objects have already been
invoked. The object itself never existed, strictly speaking,
and thus the dtor must not be invoked. Usually the runtime system
handles matters automatically this way, but since we're doing
here placement new into an array, we're responsible ourselves

This error was uncovered by compiling with Clang.
GCC automatically neutralised this erroneous dtor invocation.
2013-10-21 05:17:59 +02:00
d0f195d8c2 remove superfluous shutdown of config-system
...startup and shutdown happen automatically through ConfigFacade.
2013-10-21 03:03:16 +02:00
3a119ca9dd remove diagnostic msgs 2013-10-21 02:55:33 +02:00
7204c58680 Ticket #934: refactor DependencyFactory back to local memory management
This removes the central clean-up registry;
Instead, now the InstanceHolder manages the lifecycle of
the service instances placed into static memory; the net effect
is that DependencyFactory and instances are created and destroyed
together, locally for each usage scope
2013-10-21 02:42:43 +02:00
52c83b860b DependencyFactory: remove the ability to restart a service explicitly
We don't need this ability and it pushes us into using a
central registry. This solution turned out to be problematic
when loading dynamic libraries (plug-ins).
2013-10-21 02:06:01 +02:00
dcae33a173 debugging: diagnostic msgs on singleton creation/destruction 2013-10-21 00:32:55 +02:00
a889e5ee8b restore santity check against double creation of singletons
this check may look weird, but in fact a similar check in the
old version of the singleton factory helped us spot a problem
with Clang, most likely but of the compiler or runtime system
2013-10-20 22:40:14 +02:00
a344604f1b Clang(#928): adjustments regarding scope and visibility
Clang doesn't allow to declare a private nested class as friend.
This is unfortunate, but likely correct to the letter of the standard.

As a workaround, now we're creating the instances within a static
function of DependencyFactory -- in the end this improves readability


A second issue fixed with this changeset is the scope of the
marker function. Clang is right, this isn't ADL, thus an inline
friend definition is simply not visible outside the class.
2013-10-20 21:51:28 +02:00
bfba22f41a move test mock support into separate header. Write comments (closes #934) 2013-10-20 03:48:23 +02:00
d43a4c2c86 resolve problem with static initialisation order
...uncovered by the better checks of the new DependencyFactory!
2013-10-20 03:21:24 +02:00
0ea37402d2 Ticket #934: switch entire code-base to use the new Singleton factory
lib::Depend<TY>  works as drop-in replacement for lib::Singleton<TY>

This changeset removes the convoluted special cases like
SingletonSub and MockInjector.
2013-10-20 03:19:36 +02:00
7b3c68898a move header for test support 2013-10-20 01:24:49 +02:00
b225120d09 reworkted Singleton / DependencyFactory unit test pass 2013-10-20 00:34:21 +02:00
24792c1f19 brainstorming: how to implement the test mock injection 2013-10-19 23:37:00 +02:00
739a473f7e implemented the standard code path of DependencyFactory
still mising: a mechanism to inject mock objects temporarily
2013-10-19 03:32:49 +02:00
ed7f975748 draft the creation and lifecycle facilities 2013-10-19 00:07:06 +02:00
78c7036678 reshape the management interface
now using static functions; which simplifies building
a scoped object to install a mock automatically within
unit tests.
2013-10-18 20:15:29 +02:00
7000a40602 WIP: stubbed factory functions 2013-10-18 02:49:37 +02:00
319da4bff6 WIP: improve the API 2013-10-18 01:10:03 +02:00
f93c7f8930 WIP: draft internal structure of dependency factory 2013-10-16 04:46:20 +02:00
567ab3819b WIP: draft an improved version of the Singleton factory
...this would both improve our general design and circumvent
the problems with Clang and static variables
2013-10-14 01:18:56 +02:00
843d75ac2a test.sh: double VSize limits to prevent frequent test suite failure
especially the DiagnosticContext_test seemst to hit the
previously set limits regularily, which is somewhat strange
2013-10-13 02:50:04 +02:00
08cae2617d fix insideous problem with mutex initialisation
explanation: we use pthread_once to define a mutex type descriptor,
used to define some of our mutexes as recursive mutexes. Now,
pthread_once relies on a counter stored in a given location;
we used a non-exported global var for this counter.

Unfortunately this ties the mutex initialisation to the static
initialisation of the compilation unit holding this counter variable.
Theoretically it would be possible (we never observed such an incident)
that, during static initialisation, a singleton was brought up,
which requires a class-scoped lock, implemented as recursive mutex.
And it would be possible for this singleton locking to happen prior
to initialisation of the mentioned counter variable.

As a fix, I've moved the counter varialbe into a function scoped
static variable, since that is guaranteed by the C++ runtime system
to be initialised at first usage of the function, irrespective of the
initialisation order of the enclosing compilation units
2013-10-13 01:48:27 +02:00
2b437b49ad DOC: switch on TOC and footnotes on some pages 2013-10-07 04:41:19 +02:00
d9141931a9 investigation of a problem with Clang
posted also to Stackoverflow. http://stackoverflow.com/questions/19212474/clang-links-to-different-locations-when-referring-a-templated-static-variable-fr
2013-10-07 02:03:14 +02:00
67523269fc clean-up and comments for the singleton factory 2013-10-07 01:58:13 +02:00
66b62e2146 remove superfluous template parameter dependency 2013-10-07 01:58:13 +02:00
48431d822d Build: adjust versions and naming to comply with Debian/Jessie
Note: this drops some backwards compatibility. We're targeting now
roughly the range between Ubuntu-Precise (LTS) and Debian/testing,
with Debian/stable as the reference system.

The naming scheme for Boost-Libraries was adjusted with Boost-1.42
for Unix-Platforms. Now the '-mt' suffix isn't included any more, but
the libraries available through the usual packaging mechanisms can be
assumed to be thread safe.

See also http://issues.lumiera.org/ticket/759
2013-10-07 01:52:57 +02:00
cdb3d3045a BUG: Clang shows a problem when accessing templated static variable through separate compilation units
this is really creepy: the same(!) instance of the singleton factory
sees different addresses of the class static variable, depending on
the compilation unit.

Please note that the type of the concrete factory function is *erased*
when exiting the constructor function of ConfigurableHolder
2013-10-06 23:17:18 +02:00
4bd9eeb8ee bughunt: re-create the whole 2nd layer with a configurable product type --> HIT
Now we've reprduced the problematic situation in isolation
2013-10-06 23:17:18 +02:00
675b2070ce bughunt: attempt to rebuild the problematic structure stand-alone... --> MISS
this is only a stripped-down version of the basic singleton, without
the indirection. Unsurprisingly, this doesn't exhibit the problem yet
2013-10-06 23:17:18 +02:00
0e8a1f1e08 bughunt: use a single SingletonSub instance in two compilation units --> HIT
basically this reproduces the problem in a simplified setup.
Especially note that we're going through a single instance of the factory,
yet still this single instance 'sees' two different locations of the
class static variable
2013-10-06 23:17:18 +02:00
72bd94e141 bughunt: replace the ConfigResolver with a direct instantiation of Singleton -> MISS
thus not lib::Singleton is the culprit, it must be lib::SingletonSubclass
2013-10-06 23:17:18 +02:00
10a511d29c bughunt: build testcase statically linked
...but still dynamically linking against the core lib
But the actual template instantiations happen now within the two
compilation units, which are linked statically.

When looking into the symbol table, we can see that the static
field is emitted two times

readelf -W target/clang-static-init -s | c++filt |less
2013-10-06 23:17:18 +02:00
cec78fdc58 bughunt: extract a call sequence leading to a strange init error with Clang
Observations:
 - the initial observation was that we get two instances of the config rules service
 - obviously this it is *not* the initialisation of a static variable accessed from
    multiple compilation units. But the access from two compilation units is crucial
 - we can exclude the effect of all other initialisation. It *is* in SingletonSubclass
 - we can exclude the effect of dynamic linking. Even two translation units
    linked statically exhibit the same problem

rebuild this test case in the research area, to be able to verify with various compilers
2013-10-06 23:17:18 +02:00
6d064cb7b7 Clang(#928): clarify instantiation of dependent template
clang-3.2 requires a clarification here (while previous versions
of clang and GCC automatically resolved the ambiguity by assuming
use of a nested, dependent template).
2013-10-06 23:15:49 +02:00
f136220131 Clang(#928): fix re-entrance error in testcode
Clang seems to evaluate the terms of a function call in another order
than GCC -- this uncovered re-entrance errors in some metaprogramming tests,
where we re-used a global formatter object in recursive instantiations.
2013-09-28 01:16:22 +02:00
961936ce9d Clang-3.0(#932): workaround for a known problem of Clang-3.0 (Debian/stable)
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20121203/069267.html

http://stackoverflow.com/questions/13521163/variadic-template-as-template-parameter-deduction-works-with-gcc-but-not-with-c

Clang aborts the template type deduction due to different size of the argument lists;
in fact the missmatching arguments can be filled in perfectly from the default template arguments.

As a workaround, we'll include an unused placeholder type parameter into the templated function,
to make the match succeed.
2013-09-27 23:28:29 +02:00
cb80d4001a Clang(#928): refactor OutputSlot implementation to resolve a scoping problem
Clang is more insistent when it comes to enforcing 'protected' visibility.
Since in this case the basic design can be considered sane and optimal, the
only (and obvious) solution is to nest the PIMPL into a default base class
for implementation; this mirrors the structure of the interface.
2013-09-27 23:25:51 +02:00
4ea20f0e74 Clang(#928): fix inconsistencies and compilation problems
Compilation with Clang 3.0 (which is available in Debian/stable) fails,
mostly due to some scoping and naming inconsistencies which weren't detected
by GCC. At some instances, Clang seems to have problems to figure out a
perfectly valid type definition; these can be resolved by more explicit
typing (which is preferrable anyway)
2013-09-27 23:23:13 +02:00