PSMDB-2021 Fix dynamic linking of ldap-related libraries#1762
Conversation
- split 'ldapmanager' library into 'ldapmanagerbase' and 'ldapmanager' - make 'ldap_options' depend on 'ldapmanagerbase' and 'service_context'
Backport Policy Overview@igorsol, This branch ( Next step: Please re-open this PR against Please reach out in #server-release if you have any questions. |
There was a problem hiding this comment.
Pull request overview
This PR fixes LDAP-related dynamic linking issues by breaking a cyclic dependency between ldapmanager and ldap_options. It does so by splitting the LDAP manager into a “base” library (core ServiceContext decoration/get/set) and an “impl” library (OpenLDAP-dependent implementation and startup registration), and updating build dependencies accordingly.
Changes:
- Split LDAP manager into
ldap_manager_base(core API/decoration) andldap_manager(implementation + LDAP syslibs). - Move the
CreateLDAPManagerServiceContext constructor action fromldap_manager.cppintoldap_manager_impl.cpp. - Update Bazel deps so
ldap_optionsdepends onservice_contextandldap_manager_base, and remove the legacy SCons build file for this directory.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/mongo/db/ldap/ldap_manager_impl.cpp | Hosts LDAP manager creation/registerer and implementation, now owns the constructor action. |
| src/mongo/db/ldap/ldap_manager.h | Adjusts interface (removes create(), makes invalidateConnections() pure virtual) and includes. |
| src/mongo/db/ldap/ldap_manager.cpp | Becomes base-only: ServiceContext decoration + get/set, removing impl construction/registration. |
| src/mongo/db/ldap/SConscript | Removes old SCons library definition for ldapmanager. |
| src/mongo/db/ldap/BUILD.bazel | Introduces ldap_manager_base and redefines ldap_manager as impl-only with LDAP syslibs. |
| src/mongo/db/BUILD.bazel | Updates ldap_options deps to include service_context and ldap_manager_base. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Break cyclic dependency 'ldapmanager' -> 'ldap_options' -> 'ldapmanager by splitting 'ldapmanager' library into 'ldapmanagerbase' and 'ldapmanager' and making 'ldap_options' depend on 'ldapmanagerbase'.
Make 'ldap_options' depend on 'service_context' to fix undefined reference errors.