[MDEV-27540] Different OpenSSL versions mix up in build depending on cmake options Created: 2022-01-18 Updated: 2022-08-02 Resolved: 2022-01-20 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Compiling, SSL |
| Affects Version/s: | N/A |
| Fix Version/s: | 10.8.1, 10.5.17, 10.6.9, 10.7.5 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Elena Stepanova | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
It has probably always been so and affects all versions, just not as obvious as it is with OpenSSL 3. I didn't check existing main trees. Please update affects/fix versions as needed. Building with WITH_SSL=<custom path> causes a version mix up:
Same happens with
This works:
|
| Comments |
| Comment by Vladislav Vaintroub [ 2022-01-19 ] | ||||||
|
I did not remember there is -DWITH_SSL=path , but it seems to be own invention for something that is already available in standard CMake. The official way to tell cmake the directory of custom OpenSSL is -DOPENSSL_ROOT_DIR, and this is what I used, together with WITH_SSL=system (to trigger FIND_PACKAGE(OpenSSL)). The variable is listed under HINTS in CMake documentation in https://cmake.org/cmake/help/v3.22/module/FindOpenSSL.html Here is how I used it https://github.com/MariaDB/server/commit/2cc5fa65d34a566e7c1a046d5f61c95b357664d2 | ||||||
| Comment by Elena Stepanova [ 2022-01-19 ] | ||||||
|
Please see the description:
And yes, same also happens with -DOPENSSL_ROOT_DIR -DWITH_SSL=system, without other parameters:
If you mean Windows, I have no information about any mixup there. My Windows doesn't have alternative openssl installations. | ||||||
| Comment by Vladislav Vaintroub [ 2022-01-19 ] | ||||||
|
I did not mean Windows , but since you mentioned it, I can report that, that there exists Appveyor environment, accessible to general public, with 3 versions of openssl 1.1.0, 1.1.1 and 3.0 installed side-by-side (s. https://www.appveyor.com/docs/windows-images-software/) There, -DWITH_SSL=system -DOPENSSL_ROOT_DIR=C:\path\specific\to\openssl-version alone does help.
| ||||||
| Comment by Elena Stepanova [ 2022-01-19 ] | ||||||
So, it worked for you on Linux, then? Which Linux, which cmake? I had the above with at least cmake 3.18.4, maybe others but I don't have other versions handy. If you are saying that it works somewhere, I can check.
I didn't mean custom installations, I meant having a "default" one while trying to build with non-default, as will be very common on Linuxes for the next many months at least. Getting rid of the default installation of openSSL libraries on Linux seems difficult, at least I couldn't manage it without removing what seems to be a half of the system. | ||||||
| Comment by Vladislav Vaintroub [ 2022-01-19 ] | ||||||
|
On Linux, I did not ever test mix of default and custom openssl. My reports about OPENSSL_ROOT_DIR working are based only on by primary build environment. On Linux, IIRC, I uninstalled default, and "sudo make installed" the 3.0 to get it working. | ||||||
| Comment by Sergei Golubchik [ 2022-01-20 ] | ||||||
|
it's a cmake bug, fixed in 3.23.0. We'll have to implement a workaround. | ||||||
| Comment by Sergei Golubchik [ 2022-01-20 ] | ||||||
|
pushed in a preview branch |