Skip to content
Permalink
Browse files
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
  • Loading branch information
ottok authored and vuvova committed Jun 10, 2021
1 parent 396864c commit 152c83d
Showing 1 changed file with 3 additions and 2 deletions.
@@ -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()

0 comments on commit 152c83d

Please sign in to comment.