Load DCCL codec plugin shared libraries from AppConfig and GOBY_LOAD_SHARED_LIBRARY - #400
Open
tsaubergine with Copilot wants to merge 3 commits into
Open
Load DCCL codec plugin shared libraries from AppConfig and GOBY_LOAD_SHARED_LIBRARY#400tsaubergine with Copilot wants to merge 3 commits into
tsaubergine with Copilot wants to merge 3 commits into
Conversation
Co-authored-by: tsaubergine <732276+tsaubergine@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Find cleaner way to load external shared libraries for DCCL plugins
Load DCCL codec plugin shared libraries from AppConfig and GOBY_LOAD_SHARED_LIBRARY
Aug 7, 2026
tsaubergine
marked this pull request as ready for review
August 12, 2026 12:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
External DCCL codec plugins (
libdccl_arithmetic.so,libdccl_native_protobuf.so) had no general loading path: only a handful of apps (pAcommsHandler, goby_bridge, goby_liaison, goby_logger) had a bespokeload_shared_libraryoption, none of which registered codecs with the middleware DCCL codec used by the intervehicle layer, andgobydhad no option at all.This adds a single loading mechanism at the
goby::middleware::Applicationlevel, so it works for every Goby app includinggobyd.Changes
AppConfig: newrepeated string load_shared_library = 60(ADVANCED). Each entry may itself contain several libraries separated by:,;or,, matching the existingToolSharedLibraryLoaderconvention.DCCLSerializerParserHelperBase::load_library(): thestd::stringwrapper arounddccl::Codec::load_library()is replaced by an implementation thatdlopens withRTLD_LAZY | RTLD_NODELETE(consistent with the rest of Goby, and avoiding dccl'sdlclose-on-destruct which can leave dangling Protobuf descriptor memory) and throwsgoby::Exceptionon failure. Handles are tracked and de-duplicated, and re-applied whenever the codec is created or replaced (codec()/set_codec()). Avoid*overload is added for already-opened handles.Application: newload_shared_libraries()invoked from the constructor after logger setup and before any DCCL use; readsGOBY_LOAD_SHARED_LIBRARYfirst, then config entries.ToolSharedLibraryLoader: libraries opened bygoby zeromq publish/subscribe(-l/GOBY_TOOL_LOAD_SHARED_LIBRARY) are now also registered with the DCCL codec, so plugin codecs they contain are usable.src/test/middleware/dccl_load_library: a message using the externaldccl.native_protobufcodec throws before loading and round-trips after; repeat loads are a no-op; a missing library throws.doc230_application.md.Notes for review
GOBY_LOAD_SHARED_LIBRARYis read explicitly rather than via(goby.field).cfg.env, since env bindings are only generated for top-level config fields andAppConfigis nested underapp.load_shared_libraryoptions are left untouched; this is additive.