Bug #106730 build MySQL shell 8.0.27 from source failed
Submitted: 15 Mar 2022 6:58 Modified: 17 Mar 2022 14:07
Reporter: Ye Jinrong Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Document Store: MySQL Shell Severity:S3 (Non-critical)
Version:8.0.27 OS:Any
Assigned to: CPU Architecture:Any

[15 Mar 2022 6:58] Ye Jinrong
Description:
build mysql shell 8.0.27 from source

```
tar zxf mysql-shell-8.0.27-src.tar.gz
cd mysql-shell-8.0.27-src
mkdir bld
cd bld

cmake .. -DMYSQL_SOURCE_DIR=/opt/mysql-8.0.27 \
-DMYSQL_BUILD_DIR=/opt/mysql-8.0.27/bld/ \
-DHAVE_PYTHON=1 -DWITH_PROTOBUF=bundled
```

report the error log:
```
-- Performing Test supports_std - Success
CMake Error at CMakeLists.txt:457 (STRING_PREPEND):
  Unknown CMake command "STRING_PREPEND".

-- Configuring incomplete, errors occurred!
See also "/opt/mysql-shell-8.0.27-src/bld/CMakeFiles/CMakeOutput.log".
```

Compare CMakeLists.txt in MySQL shell 8.0.25, It is found that some codes are indeed missing. Just supplement the following codes:
```
MACRO(STRING_PREPEND STRING_VAR INPUT)
  SET(${STRING_VAR} "${INPUT}${${STRING_VAR}}")
ENDMACRO()
```

How to repeat:
as above
[15 Mar 2022 15:31] MySQL Verification Team
Hi Mr. Jinrong,

Thank you for your bug report.

We would like to check whether you are using the recommended versions and releases of  `cmake` , Python, C/C++ compiler etc .........

Check our release notes on dev.mysql.com whether you are using the recommended versions of the software required to build MySQL shell.

Also, please just try to download binary, since there is no need for you to buiild it yourself.
[16 Mar 2022 13:21] Ye Jinrong
```
$ gcc --version
gcc (GCC) 10.3.1 20210422 (Red Hat 10.3.1-1)

$ cmake --version
cmake version 3.20.2

$ python3 --version
Python 3.6.8
```

I download mysql-server and mysql-shell source code tarball package from
- https://dev.mysql.com/downloads/mysql/
- https://dev.mysql.com/downloads/shell/

file size and checksum are:
```
$ md5sum mysql-8.0.27.tar.gz mysql-shell-8.0.27-src.tar.gz
e39fd767f6a6377b58d116ef10f31064  mysql-8.0.27.tar.gz
8140861ec194330d529bc3eafcffab74  mysql-shell-8.0.27-src.tar.gz

$ ls -la mysql-8.0.27.tar.gz mysql-shell-8.0.27-src.tar.gz
-rw-r--r-- 1 root root 285550905 Mar 15 06:12 mysql-8.0.27.tar.gz
-rw-r--r-- 1 root root  81013338 Mar 15 06:12 mysql-shell-8.0.27-src.tar.gz
```
[16 Mar 2022 14:48] MySQL Verification Team
Hi,

Check out whether it is different in 8.0.28.
[17 Mar 2022 3:21] Ye Jinrong
There is no problem with 8.0.28. There is the following code in CMakeLists.txt:

```
MACRO(STRING_PREPEND STRING_VAR INPUT)
  SET(${STRING_VAR} "${INPUT}${${STRING_VAR}}")
ENDMACRO()
```
[17 Mar 2022 14:07] MySQL Verification Team
Hi Mr. Jinrong,

It seems that what you are reporting is a duplicate of the bug fixed in the release 8.0.28.

Hence, all you need to do is upgrade.