-
Notifications
You must be signed in to change notification settings - Fork 455
Find-SASL cleanup #1405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find-SASL cleanup #1405
Conversation
Tweak importing of libsasl2 for user requirements Tweaks the import of libsasl2 so that at import-time we don't *require* the pkg-config files, since the dynamic library's dep on libsasl should be sufficient to satisfy the runtime linking.
Build +test-cxx-driver to run a default mongo-cxx-driver using the local mongo-c-driver as the driver backend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Minor comment.
@@ -282,6 +282,10 @@ function(_generate_pkg_config_content out) | |||
$<GENEX_EVAL:$<TARGET_PROPERTY:pkg_config_LIBS>> | |||
$<REMOVE_DUPLICATES:$<TARGET_PROPERTY:INTERFACE_LINK_OPTIONS>> | |||
) | |||
|
|||
# XXX: Could we define a genex that can transform the INTERFACE_LINK_LIBRARIES to a list of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the XXX:
intended to be here, or is it a placeholder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a callout to future readers that may know better than I do, since the current way its handled is sub-optimal but not "broken" to warrant a "TODO" or "FIXME".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM, though one task failure may need to be investigated:
The MinGW task appears to fail to locate libsasl2:
[2023/09/15 21:08:31.592] CMake Error at C:/Users/mci-exec/AppData/Local/mongo-c-driver/tmp.pTUuQRMADo/cmake-3.25.2-windows-x86_64/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
[2023/09/15 21:08:31.593] Could NOT find SASL2 (missing: SASL2_VERSION SASL2_INCLUDE_DIR
[2023/09/15 21:08:31.593] SASL2_LIBRARY) (Required is at least version "2.0")
Earthfile
Outdated
alpine-test-env-base: | ||
ARG --required version | ||
FROM +alpine-base --version=$version | ||
RUN apk add libsasl snappy pkgconfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RUN apk add libsasl snappy pkgconfig | |
RUN apk add libsasl snappy |
Remove package config dependency? I assume this is no longer needed due to 0c76946. Comment applies to other package config dependencies in this file: pkgconf
and pkg-config
@@ -47,9 +49,17 @@ def __init__(self, *, suffix: str, target: str) -> None: | |||
"amazon2", | |||
] | |||
|
|||
# Other optoins: SSPI (Windows only), AUTO (not reliably test-able without more environments) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Other optoins: SSPI (Windows only), AUTO (not reliably test-able without more environments) | |
# Other options: SSPI (Windows only), AUTO (not reliably test-able without more environments) |
* Redefine the handling of SASL imports Tweak importing of libsasl2 for user requirements Tweaks the import of libsasl2 so that at import-time we don't *require* the pkg-config files, since the dynamic library's dep on libsasl should be sufficient to satisfy the runtime linking. * Add FeatureSummary * Bump Earthly version, allow setting sasl options * Include dependencies for finding libsasl2 * Define more Earthly tasks * make _mongo_pick public, tweak signature of bool01 * Add Earthly target for testing against cxx-driver Build +test-cxx-driver to run a default mongo-cxx-driver using the local mongo-c-driver as the driver backend. * Better Earthly target docs * Fix SASL path finding for Windows, and use parallel Make
This is the first of several smaller changes that will go together into a full refactoring of the libmongoc build. This piece targets the SASL support library, with a few aside fixes.
Changed
The
FindSASL2.cmake
module, despite having theFind
name prefix, did not behave as a proper find-module. This refactoring changes the module to behave as a find-module and generates anIMPORTED
library target against which libmongoc can link. This also resulted in changes to the installed mongoc targets to support the downstream users to link against a libsasl2. Whereas the prior install hard-coded the path to sasl2 within the -targets.cmake file, this change adds a level of indirection_mongoc::detail::sasl
that is resolved at import-time to the SASL implementation that is available and that matches what the targets were built against.The code that decided which SASL to use was tangled, but the actual decision process is not complex. This refactors that process to a more straightforward implementation.
Additional Earthly targets and tasks have been defined to test the SASL on/off configurations.
Aside: Use the FeatureSummary module from CMake to print a definitive summary of enabled/disabled features and found/missing packages at the end of the configure process.
Aside: A
test-cxx-driver
target in Earthly, which will perform a simple build of the C++ driver using the built result of the C driver. This does not have any EVG tasks, it's just for local testing (for now).