-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
Build
The current mechanism for MONGO_INITIALIZER involves passing the name of a function as a string to a callback. To make the callback work, the library containing the initializer must be declared as a public dependency in the library dependency graph.
We would like to have a mechanism for automatically determining whether a dependency exists between any two nodes of our dependency graph. However, because the current MONGO_INITIALIZER mechanism does not create an explicit symbol dependency between nodes in our library graph, we must treat all declared public dependencies as necessary. This also creates future problems because the libdeps graph continues to grow over time, resulting in a ludicrously large set of intermediate shared libraries in our shared build.
We propose that the current MONGO_INITIALIZER mechanism be replaced with uses of std::function passed to the callback. This would create a symbol dependency that we're able to analyze with tools such as libabigail. Explicit symbol dependencies would enable us to further develop libdeps graph tools which can automatically trim the graph and allow us to suggest changes which would collapse it into fewer nodes. A smaller libdeps graph would, in turn, result in greatly-reduced build times and start times (see DAG-1964) for dynamic builds.