Skip to content

do not link to OpenSSL in MinGW task #1570

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

Merged
merged 2 commits into from
Apr 3, 2024

Conversation

kevinAlbs
Copy link
Collaborator

@kevinAlbs kevinAlbs commented Apr 3, 2024

This PR intends to fix the failing link-with-cmake-mingw task (example):

[2024/04/02 15:34:08.441] CMake Error at C:/Users/mci-exec/AppData/Local/mongo-c-driver/tmp.qA7z0pyqSC/cmake-3.29.0-windows-x86_64/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
[2024/04/02 15:34:08.441]   Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
[2024/04/02 15:34:08.441]   system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY
[2024/04/02 15:34:08.441]   OPENSSL_INCLUDE_DIR)
[2024/04/02 15:34:08.441] Call Stack (most recent call first):
[2024/04/02 15:34:08.441]   C:/Users/mci-exec/AppData/Local/mongo-c-driver/tmp.qA7z0pyqSC/cmake-3.29.0-windows-x86_64/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
[2024/04/02 15:34:08.441]   C:/Users/mci-exec/AppData/Local/mongo-c-driver/tmp.qA7z0pyqSC/cmake-3.29.0-windows-x86_64/share/cmake-3.29/Modules/FindOpenSSL.cmake:682 (find_package_handle_standard_args)
[2024/04/02 15:34:08.441]   src/libmongoc/CMakeLists.txt:204 (find_package)
[2024/04/02 15:34:08.441]   src/libmongoc/CMakeLists.txt:160 (_use_named_tls_lib)
[2024/04/02 15:34:08.441]   src/libmongoc/CMakeLists.txt:231 (_pick_which_tls_lib)

Here is a patch build with these changes applied and the task link-with-cmake-mingw task passing: https://spruce.mongodb.com/version/660da4c4b9585300076ee2e0

This is a follow-up to #1566. Upgrading to CMake 3.29.0 fixed OpenSSL tasks with Visual Studio, but not the MinGW task. The error locating OpenSSL with the MinGW generator was reported to CMake here: https://gitlab.kitware.com/cmake/cmake/-/issues/25859. The response noted:

IIUC, that installation is the Shining Light Productions distribution which is only for the MSVC ABI, not the GNU ABI (MinGW). You need to use an OpenSSL package that's meant for MinGW.

I am not sure how valuable it is to test linking to OpenSSL when building with MinGW. This PR changes to use ENABLE_SSL=WINDOWS to use Windows Secure Channel to keep test coverage of building with MinGW.

@kevinAlbs kevinAlbs requested a review from rcsanchez97 April 3, 2024 19:00
@kevinAlbs
Copy link
Collaborator Author

PR has been updated to disable linking to OpenSSL on the MinGW task. I expect the OpenSSL install on Windows hosts is for the Windows ABI (not MinGW). The response in https://gitlab.kitware.com/cmake/cmake/-/issues/25859 clued me to this:

IIUC, that installation is the Shining Light Productions distribution which is only for the MSVC ABI, not the GNU ABI (MinGW). You need to use an OpenSSL package that's meant for MinGW.

Here is a patch build with latest changes passing on link-with-cmake-mingw: https://spruce.mongodb.com/version/660db63c100c21000725f6ac/tasks?page=0&sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC&taskName=mingw

@kevinAlbs kevinAlbs merged commit 6ab9e7b into mongodb:master Apr 3, 2024
kevinAlbs added a commit that referenced this pull request Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants