Void::Log::Detail::state() was a static in an inline function, which is one object per DLL on Windows: a sink set from one DLL never saw events from another (a plugin's log lines, or any module but the one that set it). The state now lives in Void::LogState, a small compiled module with no dependencies, linked by every module that includes the facade (Async, System, Stacktrace, Testing; the rest through them), so INTERFACE modules can still log and no dependency cycle appears. Tests: VoidTests 1242 pass, 3 skip; run_with_args_builds_correct_argv and run_stdin_forwarded_to_cat fail on NixOS, which has no /bin/echo or /bin/cat (exit 127). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
20893d1bf3
commit
cd237207d4
7 files changed
+30
-12
No files matched your search
@@ -1 +1,3 @@
|
||||
void_add_module(Async)
|
||||
void_add_module(Async
|
||||
INTERNAL_DEPS LogState
|
||||
)
|
||||
@@ -0,0 +1,15 @@
|
||||
// The Void::Log facade's one state per process. Compiled into its own small
|
||||
// library rather than an inline function's static: Windows gives every DLL
|
||||
// that inlines a function its own static, so a sink set in one DLL would
|
||||
// never see the events of another. Every module that includes
|
||||
// <Void/Log/Log.hpp> links this (it has no dependencies of its own).
|
||||
#include <Void/Log/Log.hpp>
|
||||
|
||||
namespace Void::Log::Detail
|
||||
{
|
||||
State& state()
|
||||
{
|
||||
static State s;
|
||||
return s;
|
||||
}
|
||||
} // namespace Void::Log::Detail
|
||||
@@ -0,0 +1 @@
|
||||
void_add_module(LogState)
|
||||
@@ -5,7 +5,7 @@ else()
|
||||
endif()
|
||||
|
||||
void_add_module(Stacktrace
|
||||
INTERNAL_DEPS Functional
|
||||
INTERNAL_DEPS Functional LogState
|
||||
EXTERNAL_DEPS ${_void_stacktrace_target}
|
||||
DEPS_UNIX dl
|
||||
OPTIONS_UNIX -g -fno-omit-frame-pointer
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
void_add_module(System
|
||||
INTERNAL_DEPS Functional
|
||||
INTERNAL_DEPS Functional LogState
|
||||
EXTERNAL_DEPS Threads::Threads
|
||||
)
|
||||
@@ -1,3 +1,4 @@
|
||||
void_add_module(Testing
|
||||
INTERNAL_DEPS LogState
|
||||
OPTIONAL_DEPS Stacktrace Log Async Configuration Text
|
||||
)
|
||||
Reference in new issue
Block a user