Commit 152c83d4 authored by Otto Kekäläinen's avatar Otto Kekäläinen Committed by Sergei Golubchik

MDEV-20392: Skip ABI check if 'diff' is not found

Not all environments have 'diff' installed. Most notably CentOS 8
does not have diff out-of-the-box. Thus users running 'cmake .' and
'make' would fail to build MariaDB, and they would think the error
was in ABI incompatibilities due to the error message emitted by CMake
when in reality simply 'diff' was missing.

This fixes it and makes the developer experience better by simply
skipping the diffing if 'diff' is not found.

Closes #1846
parent 396864c6
......@@ -74,7 +74,9 @@ FOREACH(file ${ABI_HEADERS})
FILE(REMOVE ${tmpfile})
EXECUTE_PROCESS(
COMMAND diff -w ${file}.pp ${abi_check_out} RESULT_VARIABLE result)
IF(NOT ${result} EQUAL 0)
IF(result MATCHES "No such file or directory")
MESSAGE("Command 'diff' not found. ABI check for ${file} skipped.")
ELSEIF(NOT result EQUAL 0)
IF(ABI_UPDATE)
EXECUTE_PROCESS(COMMAND mv -v ${abi_check_out} ${file}.pp)
ELSE(ABI_UPDATE)
......@@ -84,4 +86,3 @@ FOREACH(file ${ABI_HEADERS})
ENDIF()
FILE(REMOVE ${abi_check_out})
ENDFOREACH()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment