Skip to content
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

MariaDB_Connector_C: update to 3.1.12 #4278

Merged
merged 9 commits into from
Jan 20, 2022
Merged

MariaDB_Connector_C: update to 3.1.12 #4278

merged 9 commits into from
Jan 20, 2022

Conversation

KristofferC
Copy link
Member

@KristofferC KristofferC commented Jan 18, 2022

To pick up new archs, ref JuliaDatabases/MySQL.jl#184

cc @quinnj (he should probably review before mering)

@giordano
Copy link
Member

Note that to build for new architectures you need to change version number (and require Julia v1.6): #2763

@giordano
Copy link
Member

Wow, this script is old

@giordano
Copy link
Member

giordano commented Jan 18, 2022

You probably need to refresh the mingw patches from https://github.com/msys2/MINGW-packages/tree/0d166976f9786c635cebb81570c30973a874ae1a/mingw-w64-libmariadbclient (but note those are for v3.1.12)

@KristofferC
Copy link
Member Author

Yep, I'll go to 3.1.12 then

@giordano
Copy link
Member

giordano commented Jan 18, 2022

Failures on Windows:

[18:12:02] /workspace/srcdir/mariadb-connector-c/libmariadb/secure/schannel.c: In function ‘ma_tls_connect’:
[18:12:02] /workspace/srcdir/mariadb-connector-c/libmariadb/secure/schannel.c:342:36: error: ‘SP_PROT_TLS1_0_CLIENT’ undeclared (first use in this function)
[18:12:02]        Cred.grbitEnabledProtocols|= SP_PROT_TLS1_0_CLIENT;
[18:12:02]                                     ^
[18:12:02] /workspace/srcdir/mariadb-connector-c/libmariadb/secure/schannel.c:342:36: note: each undeclared identifier is reported only once for each function it appears in
[18:12:02] /workspace/srcdir/mariadb-connector-c/libmariadb/secure/schannel.c:344:36: error: ‘SP_PROT_TLS1_1_CLIENT’ undeclared (first use in this function)
[18:12:02]        Cred.grbitEnabledProtocols|= SP_PROT_TLS1_1_CLIENT;
[18:12:02]                                     ^
[18:12:02] /workspace/srcdir/mariadb-connector-c/libmariadb/secure/schannel.c:346:36: error: ‘SP_PROT_TLS1_2_CLIENT’ undeclared (first use in this function)
[18:12:02]        Cred.grbitEnabledProtocols|= SP_PROT_TLS1_2_CLIENT;
[18:12:02]                                     ^
[...]
[18:12:02] /workspace/srcdir/mariadb-connector-c/libmariadb/secure/schannel.c: At top level:
[18:12:02] /workspace/srcdir/mariadb-connector-c/libmariadb/secure/schannel.c:443:1: error: unknown type name ‘SecPkgContext_CipherInfo’
[18:12:02]  static const char *cipher_name(const SecPkgContext_CipherInfo *CipherInfo)
[18:12:02]  ^
[18:12:02] /workspace/srcdir/mariadb-connector-c/libmariadb/secure/schannel.c:449:19: error: request for member ‘dwCipherSuite’ in something not a structure or union
[18:12:02]      if (CipherInfo->dwCipherSuite == cipher_map[i].cipher_id)
[18:12:02]                    ^
[18:12:02] /workspace/srcdir/mariadb-connector-c/libmariadb/secure/schannel.c: In function ‘ma_tls_get_cipher’:
[18:12:02] /workspace/srcdir/mariadb-connector-c/libmariadb/secure/schannel.c:457:3: error: unknown type name ‘SecPkgContext_CipherInfo’
[18:12:02]    SecPkgContext_CipherInfo CipherInfo = { SECPKGCONTEXT_CIPHERINFO_V1 };
[18:12:02]    ^
[18:12:02] /workspace/srcdir/mariadb-connector-c/libmariadb/secure/schannel.c:457:43: error: ‘SECPKGCONTEXT_CIPHERINFO_V1’ undeclared (first use in this function)
[18:12:02]    SecPkgContext_CipherInfo CipherInfo = { SECPKGCONTEXT_CIPHERINFO_V1 };
[18:12:02]                                            ^
[18:12:02] /workspace/srcdir/mariadb-connector-c/libmariadb/secure/schannel.c:465:47: error: ‘SECPKG_ATTR_CIPHER_INFO’ undeclared (first use in this function)
[18:12:02]    sRet= QueryContextAttributesA(&sctx->hCtxt, SECPKG_ATTR_CIPHER_INFO, (PVOID)&CipherInfo);
[18:12:02]                                                ^

Sigh. No idea what's the issue

@KristofferC KristofferC changed the title MariaDB_Connector_C: modify file to trigger rebuild MariaDB_Connector_C: update to 3.1.12 Jan 18, 2022
@KristofferC
Copy link
Member Author

I guess we can just keep using the old version but rebuild for new archs?

@giordano
Copy link
Member

You still need to change somehow the version number

@KristofferC
Copy link
Member Author

Actually, I think we still need one of the old patches (https://github.com/JuliaPackaging/Yggdrasil/pull/4278/files#diff-3720a2f4358b70332d69cd4a36076ec2fe65ad7ba25c9327e62e4f3699b8d326)

@giordano
Copy link
Member

mariadb-corporation/mariadb-connector-c#136 looks relevant

@KristofferC
Copy link
Member Author

I'm AFK so feel free to push it, otherwise I do it in a few hours.

@KristofferC
Copy link
Member Author

Hmmm

[18:14:18] CMakeFiles/remote_io.dir/objects.a(remote_io.c.obj):remote_io.c:(.text+0x372): undefined reference to `__imp_select'
[18:14:18] CMakeFiles/remote_io.dir/objects.a(remote_io.c.obj):remote_io.c:(.text+0x46e): undefined reference to `__imp_select'
[18:14:18] /opt/x86_64-w64-mingw32/bin/../lib/gcc/x86_64-w64-mingw32/4.8.5/../../../../x86_64-w64-mingw32/bin/ld: CMakeFiles/remote_io.dir/objects.a(remote_io.c.obj): bad reloc address 0x8 in section `.data'
[18:14:18] collect2: error: ld returned 1 exit status
[18:14:18] make[2]: *** [CMakeFiles/remote_io.dir/build.make:116: remote_io.dll] Error 1

@giordano
Copy link
Member

select error fixed, next up:

[21:19:28] cd /workspace/srcdir/mariadb-connector-c/build/libmariadb && /opt/bin/i686-w64-mingw32-libgfortran3-cxx03/i686-w64-mingw32-gcc --sysroot=/opt/i686-w64-mingw32/i686-w64-mingw32/sys-root/ -DHAVE_DLOPEN -DHAVE_REMOTEIO=1 -DHAVE_SCHANNEL -DHAVE_TLS -DMARIADB_MACHINE_TYPE=\"i686\" -DMARIADB_SYSTEM_TYPE=\"Windows\" -DSIZEOF_CHARP=4 -D_CRT_SECURE_NO_WARNINGS @CMakeFiles/mariadbclient.dir/includes_C.rsp -std=c99 -D_WIN32_WINNT=0x0601 -Wunused -Wlogical-op -Wno-uninitialized -Wall -Wextra -Wformat-security -Wno-init-self -Wwrite-strings -Wdeclaration-after-statement -Wno-undef -Wno-unknown-pragmas -O3 -DNDEBUG -DDBUG_OFF   -D HAVE_COMPRESS -D LIBMARIADB -D THREAD -o CMakeFiles/mariadbclient.dir/ma_charset.c.obj   -c /workspace/srcdir/mariadb-connector-c/libmariadb/ma_charset.c
[21:19:28] In file included from /workspace/srcdir/mariadb-connector-c/plugins/auth/ref10/crypto_hash_sha512.h:2:0,
[21:19:28]                  from /workspace/srcdir/mariadb-connector-c/plugins/auth/ref10/open.c:3:
[21:19:28] /workspace/srcdir/mariadb-connector-c/include/ma_crypt.h:74:1: error: unknown type name ‘MA_HASH_CTX’
[21:19:28]  MA_HASH_CTX *ma_hash_new(unsigned int algorithm, MA_HASH_CTX *ctx);
[21:19:28]  ^
[21:19:28] /workspace/srcdir/mariadb-connector-c/include/ma_crypt.h:74:50: error: unknown type name ‘MA_HASH_CTX’
[21:19:28]  MA_HASH_CTX *ma_hash_new(unsigned int algorithm, MA_HASH_CTX *ctx);
[21:19:28]                                                   ^
[21:19:28] /workspace/srcdir/mariadb-connector-c/include/ma_crypt.h:83:19: error: unknown type name ‘MA_HASH_CTX’
[21:19:28]  void ma_hash_free(MA_HASH_CTX *ctx);
[21:19:28]                    ^
[21:19:28] /workspace/srcdir/mariadb-connector-c/include/ma_crypt.h:96:20: error: unknown type name ‘MA_HASH_CTX’
[21:19:28]  void ma_hash_input(MA_HASH_CTX *ctx,
[21:19:28]                     ^
[21:19:28] /workspace/srcdir/mariadb-connector-c/include/ma_crypt.h:108:21: error: unknown type name ‘MA_HASH_CTX’
[21:19:28]  void ma_hash_result(MA_HASH_CTX *ctx, unsigned char *digest);
[21:19:28]                      ^
[21:19:28] /workspace/srcdir/mariadb-connector-c/include/ma_crypt.h: In function ‘ma_hash’:
[21:19:28] /workspace/srcdir/mariadb-connector-c/include/ma_crypt.h:155:3: error: unknown type name ‘MA_HASH_CTX’
[21:19:28]    MA_HASH_CTX *ctx= NULL;
[21:19:28]    ^
[21:19:28] /workspace/srcdir/mariadb-connector-c/include/ma_crypt.h:157:3: error: unknown type name ‘MA_HASH_CTX’
[21:19:28]    MA_HASH_CTX dctx;
[21:19:28]    ^

At least they all seem to be the same issue...

@KristofferC
Copy link
Member Author

@giordano
Copy link
Member

giordano commented Jan 20, 2022

It's about SSL stuff, but I don't think it's related because I believe they go through different code paths. However I'm confused by the error because MA_HASH_CTX for Windows should be defined in https://github.com/mariadb-corporation/mariadb-connector-c/blob/7d304d26c787a3f0430624db977b615aba56e4bb/include/ma_crypt.h#L47-L56, and by adding an #error line in that branch I can confirm we go through that one.

Edit: fixed by mariadb-corporation/mariadb-connector-c@2d5a511

@giordano
Copy link
Member

[10:15:16] /workspace/srcdir/mariadb-connector-c/libmariadb/secure/schannel_certs.c: In function ‘pem_file_to_string’:
[10:15:16] /workspace/srcdir/mariadb-connector-c/libmariadb/secure/schannel_certs.c:98:18: error: ‘SEC_E_INVALID_PARAMETER’ undeclared (first use in this function)
[10:15:16]      SetLastError(SEC_E_INVALID_PARAMETER);
[10:15:16]                   ^

This is really bizarre: apparently they have the issue with undefined SEC_E_INVALID_PARAMETER elsewhere, but they defined these macros...in a .c file, instead of a header that can be included by multiple files: https://github.com/mariadb-corporation/mariadb-connector-c/blob/7d304d26c787a3f0430624db977b615aba56e4bb/plugins/auth/sspi_errmsg.c#L32-L49 🤦 Copying these definitions makes the compilation successful for me. Sigh.

@giordano
Copy link
Member

@quinnj if you're happy with it, this is now good to go

@KristofferC
Copy link
Member Author

Thanks for all the help and sleuthing Mosé

@quinnj
Copy link
Contributor

quinnj commented Jan 20, 2022

Amazing work both of you; thanks so much for doing this.

@giordano giordano merged commit f16b91e into master Jan 20, 2022
@giordano giordano deleted the kc/mariadb branch January 20, 2022 15:54
simeonschaub pushed a commit to simeonschaub/Yggdrasil that referenced this pull request Feb 23, 2022
* MariaDB_Connector_C: modify file to trigger rebuild

* update compat and version

* [MariaDB_Connector_C] Fix deprecation warnings

* go to 3.1.12, refresh mingw patches

* add back patch

* [MariaDB_Connector_C] Resume another patch needed for MinGW

* [MariaDB_Connector_C] Add one more patch for MinGW

* [MariaDB_Connector_C] One last patch for MinGW

* [MariaDB_Connector_C] Build for all Musl platforms, including non-Intel ones

Limitation for ARM platforms seems to be gone:
https://gitlab.alpinelinux.org/alpine/aports/-/commit/ead72f039293e37c40fff47da0ef0adc5d6172de
Compilation for armv6l was indeed successful (it wasn't explicitly filtered
out).

Co-authored-by: Mosè Giordano <[email protected]>
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.

3 participants