Browse Source

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
pull/1857/head
Otto Kekäläinen 5 years ago
committed by Sergei Golubchik
parent
commit
152c83d49c
  1. 5
      cmake/do_abi_check.cmake

5
cmake/do_abi_check.cmake

@ -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()
Loading…
Cancel
Save