Bug #98286 MySQL Shell doesn't build against Python 3.8
Submitted: 19 Jan 2020 13:12 Modified: 27 Apr 2020 18:04
Reporter: Frederick Zhang Email Updates:
Status: Closed Impact on me:
Category:Shell General / Core Client Severity:S3 (Non-critical)
Version:8.0.19 OS:Linux
Assigned to: CPU Architecture:x86
Tags: mysql shell

[19 Jan 2020 13:12] Frederick Zhang
It seems that MySQL Shell doesn't support Python 3.8 yet. When compiling against Python 3.8 headers, it fails due to errors such as

> mysql-shell/src/mysql-shell-8.0.19-src/mysqlshdk/scripting/python_array_wrapper.cc:367:1: error: missing field 'tp_vectorcall' initializer [-Werror,-Wmissing-field-initializers]

This particular one was probably caused by [1], which added a new field to PyTypeObject [2], but there might still be other issues.

[1] https://github.com/python/cpython/pull/13185
[2] https://github.com/python/cpython/pull/13185/files#diff-b5db2632fa7acaf3b44abb56f18b9615R2...

How to repeat:
1. Download source codes of both mysql-boost and mysql-shell
2. Compile mysqlclient and mysqlxclient with bundled protobuf
3. Compile MySQL Shell

By the way, I maintain the MySQL Shell AUR package [1] for Arch Linux, so the easiest way to reproduce this issue is probably downloading the PKGBUILD and applying the following patch.

diff --git a/PKGBUILD b/PKGBUILD
index a549b22..e7119bd 100644
@@ -1,32 +1,30 @@
 # Maintainer: Frederick Zhang <frederick888@tsundere.moe>
 # Contributor: Raphaƫl Doursenaud <rdoursenaud@free.fr>
 pkgdesc='An interface supporting development and administration for the MySQL Server'
 arch=('x86_64' 'i686')
-  "mysql-shell-$pkgver-src.tar.gz.asc::https://dev.mysql.com/downloads/gpg/?file=mysql-shell-$pkgver-src.tar.gz"
+  "mysql-shell-$pkgver-src.tar.gz.asc::https://dev.mysql.com/downloads/gpg/?file=mysql-shell-$pkgver-src.tar.gz&p=43"
-  "mysql-boost-$pkgver.tar.gz.asc::https://dev.mysql.com/downloads/gpg/?file=mysql-boost-$pkgver.tar.gz"
+  "mysql-boost-$pkgver.tar.gz.asc::https://dev.mysql.com/downloads/gpg/?file=mysql-boost-$pkgver.tar.gz&p=23"
-  "1e04f2c53ed21a220e93f1d96e06aeda"
-  "SKIP"
-  "b63e84d8ba2bbd6f82df12fc6dfb8d51"
-  "SKIP"
-  "adfafc8512ab65fd3cf7955ef0100ff5"
+         'SKIP'
+         '1e42b9bd431059430c7617f24608609a'
+         'SKIP'
+         'adfafc8512ab65fd3cf7955ef0100ff5')
-depends=('python2' 'openssl')
+depends=('python' 'openssl')
 makedepends=('v8-6.7-static' 'cmake' 'clang' 'zip' 'zlib' 'libsasl' 'rpcsvc-proto' 'python2' 'python2-colorama' 'python2-pylint' 'python2-lazy-object-proxy' 'python2-singledispatch' 'python2-wrapt' 'ninja' 'git' 'wget')
 build() {
   cd "$srcdir/mysql-$pkgver"

[1] https://aur.archlinux.org/packages/mysql-shell/
[29 Jan 2020 11:57] MySQL Verification Team
Hello Frederick,

Thank you for the report and feedback.

[29 Jan 2020 11:58] MySQL Verification Team
Build details

Attachment: 98286.build (application/octet-stream, text), 365.18 KiB.

[27 Apr 2020 17:21] Frederick Zhang
I was able to build Shell 8.0.20 against Python 3.8.2.
[27 Apr 2020 18:04] Frederick Zhang
By the way I managed to build 8.0.20 with GCC 9.3.0 but again failed with Clang 10 (logs attached). Not all errors were about Python this time though. I haven't got Clang 8 as mentioned in INSTALL so perhaps it's just a problem of incompatibility with newer compilers.
[27 Apr 2020 18:05] Frederick Zhang
8.0.20 build log using Clang 10.0.0

Attachment: mysql-shell-clang-10.log (text/x-log), 20.62 KiB.