-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/archive/2017-10-17' into 10.3
- Loading branch information
Showing
354 changed files
with
20,614 additions
and
1,637 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#!/bin/bash | ||
warn_path=$1 | ||
warn_mode=$2 # 'late', 'early' or 'both' | ||
shift 2 | ||
|
||
warn_file="$warn_path/compile.warnings" | ||
suppress_file="$warn_path/suppress.warnings" | ||
|
||
# suppress_warnings: | ||
# | ||
# 1. treat STDIN as sequence of warnings (w) delimited by ^~~~... lines | ||
# | ||
# 2. sanitize each w to matchable m: | ||
# a. ignore 'In file included from' lines; | ||
# b. protect BRE chars; | ||
# c. ignore text coords (NNN:NNN); | ||
# d. convert multiline to X-delimited single line. | ||
# | ||
# 3. match sanitized m against X-delimited suppress.warnings: | ||
# if match not found print w to STDOUT. | ||
|
||
suppress_warnings() | ||
{ | ||
[ -f "$suppress_file" ] || { | ||
cat | ||
return | ||
} | ||
[ -z "$suppress_file" ] && { | ||
cat > /dev/null | ||
return | ||
} | ||
local m w from | ||
IFS="" | ||
while read -r l | ||
do | ||
w="$w$l"$'\n' | ||
|
||
[[ $l =~ ^"In file included from " ]] && { | ||
from=1 | ||
continue | ||
} | ||
|
||
[[ $from && $l =~ ^[[:space:]]+"from " ]] && | ||
continue | ||
|
||
unset from | ||
|
||
if [[ $l =~ ^[[:space:]]*~*\^~*$ ]] | ||
then | ||
cat "$suppress_file" | tr '\n' 'X' | /bin/grep -Gq "$m" || | ||
echo "$w" | ||
unset m w | ||
else | ||
# Protect BRE metacharacters \.[*^$ | ||
l=${l//\\/\\\\} | ||
l=${l//./\\.} | ||
l=${l//[/\\[} | ||
l=${l//-/\\-} | ||
l=${l//\*/\\*} | ||
l=${l//^/\\^} | ||
l=${l//\$/\\\$} | ||
# replace text coords line:char with BRE wildcard | ||
[[ $l =~ ^(.*:)[[:digit:]]+:[[:digit:]]+(.*)$ ]] && | ||
l=${BASH_REMATCH[1]}[[:digit:]]\\+:[[:digit:]]\\+${BASH_REMATCH[2]} | ||
m="$m$l"$'X' | ||
fi | ||
done | ||
} | ||
|
||
exec 3>&1 | ||
"$@" 2>&1 1>&3 | suppress_warnings | ( | ||
cmderr=`cat` | ||
|
||
if [[ -n "$cmderr" ]]; then | ||
if [[ "$cmderr" =~ error: ]]; then | ||
echo "$cmderr" >&2 | ||
exit | ||
fi | ||
[[ "$warn_mode" != "late" ]] && | ||
echo "$cmderr" >&2 | ||
[[ "$warn_mode" != "early" && "$cmderr" =~ (warning|note): ]] && | ||
echo "$cmderr" >> "$warn_file" | ||
fi | ||
) | ||
|
||
exit ${PIPESTATUS} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
IF(NOT DEFINED WARN_MODE) | ||
IF(CMAKE_BUILD_TYPE MATCHES "Debug") | ||
SET(WARN_MODE "late") | ||
ELSE() | ||
SET(WARN_MODE "early") | ||
ENDIF() | ||
ENDIF() | ||
|
||
IF(NOT WARN_MODE STREQUAL "early" AND | ||
NOT WARN_MODE STREQUAL "late" AND | ||
NOT WARN_MODE STREQUAL "both") | ||
MESSAGE(FATAL_ERROR "Unknown WARN_MODE: expected 'early', 'late' or 'both'") | ||
ENDIF() | ||
|
||
SET_DIRECTORY_PROPERTIES(PROPERTIES RULE_LAUNCH_COMPILE | ||
"bash ${CMAKE_SOURCE_DIR}/BUILD/capture_warnings.sh ${CMAKE_BINARY_DIR} ${WARN_MODE}") | ||
SET_DIRECTORY_PROPERTIES(PROPERTY ADDITIONAL_MAKE_CLEAN_FILES | ||
"${CMAKE_BINARY_DIR}/compile.warnings") | ||
ADD_CUSTOM_TARGET(rm_compile.warnings ALL | ||
COMMAND rm -f compile.warnings | ||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
ADD_CUSTOM_TARGET(print_warnings ALL | ||
COMMAND bash -c '[ -f compile.warnings ] && { echo "Warnings found:" \; cat compile.warnings \; echo "" \; } \; true' | ||
DEPENDS mysqld rm_compile.warnings | ||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}") | ||
|
||
IF(TARGET explain_filename-t) | ||
ADD_DEPENDENCIES(print_warnings explain_filename-t) | ||
ENDIF() | ||
|
||
IF(TARGET mysql_client_test) | ||
ADD_DEPENDENCIES(print_warnings mysql_client_test) | ||
ENDIF() | ||
|
||
IF(TARGET udf_example) | ||
ADD_DEPENDENCIES(print_warnings udf_example) | ||
ENDIF() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.