mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00
Merge remote-tracking branch 'origin/topic/timw/fix-coverage-build'
* origin/topic/timw/fix-coverage-build: CI: Use llvm-cov-18 on Cirrus for building coverage data
This commit is contained in:
commit
a4d7587bca
3 changed files with 34 additions and 18 deletions
6
CHANGES
6
CHANGES
|
@ -1,3 +1,9 @@
|
||||||
|
7.0.0-dev.258 | 2024-05-15 20:00:41 -0700
|
||||||
|
|
||||||
|
* CI: Use llvm-cov-18 on Cirrus for building coverage data (Tim Wojtulewicz, Corelight)
|
||||||
|
|
||||||
|
* CI: Add missing lcov package to ubuntu 24 Dockerfile (Tim Wojtulewicz)
|
||||||
|
|
||||||
7.0.0-dev.254 | 2024-05-13 17:40:37 -0700
|
7.0.0-dev.254 | 2024-05-13 17:40:37 -0700
|
||||||
|
|
||||||
* CI: Use clang-18 on Ubuntu 24 for sanitizers builds, enable TSan builds (Tim Wojtulewicz)
|
* CI: Use clang-18 on Ubuntu 24 for sanitizers builds, enable TSan builds (Tim Wojtulewicz)
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
7.0.0-dev.254
|
7.0.0-dev.258
|
||||||
|
|
|
@ -21,6 +21,21 @@ BASE="$(cd "$CURR" && cd ../../ && pwd)"
|
||||||
TMP="${CURR}/tmp.$$"
|
TMP="${CURR}/tmp.$$"
|
||||||
mkdir -p $TMP
|
mkdir -p $TMP
|
||||||
|
|
||||||
|
GCOV_CMD=""
|
||||||
|
if [ -n "${CIRRUS_TASK_NAME}" ]; then
|
||||||
|
GCOV_CMD="$(which llvm-cov-18)"
|
||||||
|
if [ -n "${GCOV_CMD}" ]; then
|
||||||
|
GCOV_CMD="${GCOV_CMD} gcov"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
GCOV_CMD="$(which gcov)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${GCOV_CMD}" ]; then
|
||||||
|
echo "gcov is not installed on system, aborting"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# DEFINE CLEANUP PROCESS
|
# DEFINE CLEANUP PROCESS
|
||||||
function finish {
|
function finish {
|
||||||
rm -rf $TMP
|
rm -rf $TMP
|
||||||
|
@ -97,26 +112,21 @@ echo "ok"
|
||||||
# 3a. Run gcov (-p to preserve path) and move into tmp directory
|
# 3a. Run gcov (-p to preserve path) and move into tmp directory
|
||||||
# ... if system does not have gcov installed, exit with message.
|
# ... if system does not have gcov installed, exit with message.
|
||||||
echo -n "Creating coverage files... "
|
echo -n "Creating coverage files... "
|
||||||
if which gcov >/dev/null 2>&1; then
|
(cd "$TMP" && find "$BASE" -name "*.o" -exec ${GCOV_CMD} -p {} \; >/dev/null 2>&1)
|
||||||
(cd "$TMP" && find "$BASE" -name "*.o" -exec gcov -p {} \; >/dev/null 2>&1)
|
NUM_GCOVS=$(find "$TMP" -name *.gcov | wc -l)
|
||||||
NUM_GCOVS=$(find "$TMP" -name *.gcov | wc -l)
|
if [ $NUM_GCOVS -eq 0 ]; then
|
||||||
if [ $NUM_GCOVS -eq 0 ]; then
|
echo "no gcov files produced, aborting"
|
||||||
echo "no gcov files produced, aborting"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Account for '^' that occurs in macOS due to LLVM
|
|
||||||
# This character seems to be equivalent to ".." (up 1 dir)
|
|
||||||
for file in $(ls $TMP/*.gcov | grep '\^'); do
|
|
||||||
mv $file "$(sed 's/#[^#]*#\^//g' <<<"$file")"
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "ok, $NUM_GCOVS coverage files"
|
|
||||||
else
|
|
||||||
echo "gcov is not installed on system, aborting"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Account for '^' that occurs in macOS due to LLVM
|
||||||
|
# This character seems to be equivalent to ".." (up 1 dir)
|
||||||
|
for file in $(ls $TMP/*.gcov | grep '\^'); do
|
||||||
|
mv $file "$(sed 's/#[^#]*#\^//g' <<<"$file")"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "ok, $NUM_GCOVS coverage files"
|
||||||
|
|
||||||
# 3b. Prune gcov files that fall outside of the Zeek tree:
|
# 3b. Prune gcov files that fall outside of the Zeek tree:
|
||||||
# Look for files containing gcov's slash substitution character "#"
|
# Look for files containing gcov's slash substitution character "#"
|
||||||
# and remove any that don't contain the Zeek path root.
|
# and remove any that don't contain the Zeek path root.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue