MySQL编码时,如果修改了一些接口文件(具体哪些文件,下文会说到),编译时会产生ABI检测失败的错误,比如:
CMake Error at ... (MESSAGE):
ABI check found difference between
.../mysql-8.0.3-rc/include/mysql/plugin_keyring.h.pp
and .../abi_check.out
顾名思义,abi文件比较失败。
查看mysql-8.0.3-rc/cmake/abi_check.cmake,一定要读注释,可以发现哪些接口文件被abi check,如果我们修改了这些文件,则abi check会失败!
abi_check.cmake:
{CMAKE_SOURCE_DIR}/include/mysql/plugin_audit.h
{CNAKE_SOURCE_DIR}/include/mysql/plugin_ftparser.h
{CMAKE_SOURCE_DIR}/include/mysql/mysql.h
...
如果我们修改了上面这些文件,发生了abi check失败的错误,怎么办?
查看mysql-8.0.3-rc/cmake/do_abi_check.cmake,有注释如下:
# A developer with a justified API change will then do a
# mv <build directory>/abi_check.out include/mysql/plugin.pp
# to replace the old canons with the new ones.
上述注释给出了解决方法:
如果用户不可避免地修改了API文件,那么将编译产生的abi_check.out(abi check失败会在make目录下产生)拷贝为对应的.pp文件