← Back to team overview

maria-developers team mailing list archive

Re: Compiling default MariaDB with OpenSSL in Windows

 

Braiam,

Without full log, from the short snippet you provided, it is impossible to tell where it failed. I guess is that if gen_lex_token  is that it mostly likely was Bison. Gnuwin32 has some subtle bugs. It has known not to work when installed into default location (or any location with space).  And this  fact was specifically mentioned (in bold letters) in our build instructions for Windows https://mariadb.com/kb/en/library/Building_MariaDB_on_Windows/ . Furthermore gnuwin32 bison is known not  to work, if you PATH environment variable contains spaces between components, as in “C:\path1 ; C:\path2”

Luckily, there are now better alternatives to  abandonware gnuwin32, that you can use. In 10.3 (but not earlier), you can also use winflexbison from here https://github.com/lexxmark/winflexbison/releases (drop into a directory in PATH). or you can use Cygwin’s bison.

Remove CMakeCache.txt or the whole bld directory, if you rebuild.

You can build with reasonably recent versions of CMake.  I use  3.11 and 3.12 , and expect all 3.x to be functioning,  but this was not checked for a long time.

I am aware of the plans to remove yassl. I’m all for providing MariaDB compiled with OpenSSL. Yet from what I have heard, is that we cannot easily ship MariaDB with OpenSSL on Windows, as long as OpenSSL remains under its current “custom” license.  Hopefully they can complete the promised switch to Apache License at some point, and then we can ship MariaDB on Windows with OpenSSL (and then we would need to fix CI, but this is matter of hours).



From: Braiam Peguero<mailto:braiamp@xxxxxxxxx>
Sent: Thursday, 13 September 2018 21:51
To: Vladislav Vaintroub<mailto:vvaintroub@xxxxxxxxx>
Cc: maria-developers@xxxxxxxxxxxxxxxxxxx<mailto:maria-developers@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Maria-developers] Compiling default MariaDB with OpenSSL in Windows

Hi,

Could you tell me what version of cmake are you using? I spin up a vm on azure
with VS, installed all the prerequisites and now cmake complains that
it can't find
bison. I could workaround specifically setting the path to bison, but
then it failed
because it can't find cmd.exe:


       "C:\mariadb\bld\package.vcxproj" (default target) (1) ->
       "C:\mariadb\bld\ALL_BUILD.vcxproj" (default target) (3) ->
       "C:\mariadb\bld\storage\rocksdb\mysql_ldb.vcxproj" (default
target) (159) ->
       "C:\mariadb\bld\storage\rocksdb\rocksdb_aux_lib.vcxproj"
(default target) (160) ->
       "C:\mariadb\bld\storage\rocksdb\rocksdblib.vcxproj" (default
target) (162) ->
       (Lib target) ->
         sync_point_impl.obj : warning LNK4221: This object file does
not define any previously undefined public symbol
       s, so it will not be used by any link operation that consumes
this library [C:\mariadb\bld\storage\rocksdb\rocks
       dblib.vcxproj]
         thread_status_util_debug.obj : warning LNK4221: This object
file does not define any previously undefined publ
       ic symbols, so it will not be used by any link operation that
consumes this library [C:\mariadb\bld\storage\rock
       sdb\rocksdblib.vcxproj]


       "C:\mariadb\bld\package.vcxproj" (default target) (1) ->
       "C:\mariadb\bld\ALL_BUILD.vcxproj" (default target) (3) ->
       "C:\mariadb\bld\storage\archive\archive.vcxproj" (default target) (17) ->
       "C:\mariadb\bld\sql\gen_mysqld_lib.vcxproj" (default target) (18) ->
       "C:\mariadb\bld\sql\sql.vcxproj" (default target) (20) ->
       "C:\mariadb\bld\sql\gen_lex_token.vcxproj" (default target) (25) ->
       (CustomBuild target) ->
         C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.tar
       gets(209,5): error MSB6006: "cmd.exe" exited with code 1.
[C:\mariadb\bld\sql\gen_lex_token.vcxproj]

    2 Warning(s)
    1 Error(s)

If I were a betting man, I would bet that it is a cmake bug. The same
happens with 10.4.

BTW, there are plans to remove yassl
https://jira.mariadb.org/browse/MDEV-16475 so
having a windows+openssl CI would be necessary.

On Sat, Sep 8, 2018 at 4:41 PM, Vladislav Vaintroub
<vvaintroub@xxxxxxxxx> wrote:
>
>
> Hi,
>
> you cannot build because of the build for OpenSSL on Windows was broken,
> until I fixed it couple of minutes ago. We do not build with OpenSSL often
> on Windows, so it can be broken from time to time.
>
>
>
> I had no success Shining Light distro. Link is fine, but there are runtime
> errors as described in https://www.openssl.org/docs/faq.html#PROG3 . I did
> not try the workaround with applink.c that they propose.
>
>
>
> What worked for me however, was a static openssl build using vcpkg, a
> Windows library manager from https://github.com/Microsoft/vcpkg
>
>
>
> The whole procedure, including building vcpkg itself (instructions assume
> cmd command prompt), if you would like to right now. Or you can wait until
> next 10.3 comes out
>
>
>
> 1.Bootstrap vcpkg
>
>
>
>    C:
>
>    cd \
>
>    git clone https://github.com/Microsoft/vcpkg.git
>
>    cd vcpkg
>
>    bootstrap-vcpkg.bat
>
>
>
> 2.Install static openssl for x64
>
>
>
>    vcpkg install openssl-windows:x64-windows-static
>
>
>
>
>
> 3.Clone a fresh 10.3
>
>
>
>    cd \
>
>    git clone https://github.com/mariadb/server -b 10.3  10.3
>
>
>
> 4. Build with vcpkg-provided openssl
>
>
>
>    cd 10.3 && mkdir bld && cd bld
>
>    cmake -G "Visual Studio 15 Win64" ..
> -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake
> -DVCPKG_TARGET_TRIPLET=x64-windows-static -DWITH_SSL=system
>
>    cmake --build . --config RelWithDebinfo --target package -- -m
>
>
>
>
>
> From: Braiam Peguero
> Sent: Thursday, August 23, 2018 10:03 PM
> To: maria-developers@xxxxxxxxxxxxxxxxxxx
> Subject: [Maria-developers] Compiling default MariaDB with OpenSSL in
> Windows
>
>
>
> Hi,
>
> Following Georg Richter recommendations for compiling MariaDB on
>
> Windows 64bit, with OpenSSL using the following cmake commands:
>
>
>
> cmake .. -DWITH_SSL=system -G "Visual Studio 15 2017 Win64"
>
> cmake --build . --config relwithdebinfo --target package
>
>
>
> However, several recipes fail to build, for the following errors:
>
>
>
> "builddir\mysys_ssl\mysys_ssl.vcxproj" (default target) (8) ->
>
> (ClCompile target) ->
>
>   c:\users\braiam\src\mariadb-10.3.9\mysys_ssl\my_crypt.cc(42): error
>
> C3861: 'bzero': identifier not found [C:\Users\br
>
> aiam\src\mariadb-10.3.9\bld\mysys_ssl\mysys_ssl.vcxproj]
>
>
>
> and
>
>
>
> "builddir\package.vcxproj" (default target) (1) ->
>
> "builddir\ALL_BUILD.vcxproj" (default target) (3) ->
>
> "builddir\libmariadb\sha256_password.vcxproj" (default target) (205) ->
>
> (Link target) ->
>
>   sha256_pw.obj : error LNK2019: unresolved external symbol BIO_free
>
> referenced in function auth_sha256_client [C:\User
>
> s\braiam\src\mariadb-10.3.9\bld\libmariadb\sha256_password.vcxproj]
>
>   sha256_pw.obj : error LNK2019: unresolved external symbol
>
> BIO_new_mem_buf referenced in function auth_sha256_client [
>
> builddir\libmariadb\sha256_password.vcxproj]
>
>   sha256_pw.obj : error LNK2019: unresolved external symbol RSA_size
>
> referenced in function auth_sha256_client [C:\User
>
> s\braiam\src\mariadb-10.3.9\bld\libmariadb\sha256_password.vcxproj]
>
>   sha256_pw.obj : error LNK2019: unresolved external symbol
>
> RSA_public_encrypt referenced in function auth_sha256_clien
>
> t [builddir\libmariadb\sha256_password.vcxproj]
>
>   sha256_pw.obj : error LNK2019: unresolved external symbol RSA_free
>
> referenced in function auth_sha256_client [C:\User
>
> s\braiam\src\mariadb-10.3.9\bld\libmariadb\sha256_password.vcxproj]
>
>   sha256_pw.obj : error LNK2019: unresolved external symbol
>
> PEM_read_bio_RSA_PUBKEY referenced in function auth_sha256_
>
> client [builddir\libmariadb\sha256_password.vcxproj]
>
>   sha256_pw.obj : error LNK2019: unresolved external symbol
>
> ERR_clear_error referenced in function auth_sha256_client [
>
> builddir\libmariadb\sha256_password.vcxproj]
>
>   builddir\libmariadb\RelWithDebInfo\sha256_password.dll : fatal error
>
> LNK1120: 7 unresol
>
> ved externals [builddir\libmariadb\sha256_password.vcxproj]
>
>
>
> Using the OpenSSL 1.1.0i 64bit binaries from Shinning Light
>
> Productions. Using the 1.0.2p version produce even more linking
>
> errors. I also used FireDaemon but failed. Is there a recommended
>
> Windows binary for compiling? Or do I need to compile my own openssl?
>
>
>
> --
>
> Braiam Peguero
>
>
>
> _______________________________________________
>
> Mailing list: https://launchpad.net/~maria-developers
>
> Post to     : maria-developers@xxxxxxxxxxxxxxxxxxx
>
> Unsubscribe : https://launchpad.net/~maria-developers
>
> More help   : https://help.launchpad.net/ListHelp
>
>



--
Braiam Peguero


References