build_oai: don't redirect compilations to a file

Redirecting to a file has the problem that it is difficult in the CI to
recover these files. Furthermore, at least with ninja, when running
build_oai interactively, the build output will only take some lines
(because ninja rewrites lines), so the change should not be that big to
users.

One CI function would print the entire output from build_oai to the
console. Since that output might be long now, do not do this. The file
is archived, anyway.
This commit is contained in:
Robert Schmidt
2025-08-11 16:11:35 +02:00
parent f3dab10de6
commit 35361db76b
3 changed files with 5 additions and 68 deletions
-59
View File
@@ -181,65 +181,6 @@ clean_all_files() {
rm -rf $dir/autotests/bin $dir/autotests/log $dir/autotests/*/build
}
###################################
# Compilers
###################################
#check_warnings:
# print error message if the compilation had warnings
#argument:
# $1: log file
check_warnings() {
#we look for 'warning:' in the compilation log file
#this is how gcc starts a warning
#this is not perfect, we may get false positive
warning_count=`grep "warning:" "$1" | grep -E -v "jobserver unavailable|disabling jobserver mode" | wc -l`
if [ $warning_count -gt 0 ]; then
echo_error "WARNING: $warning_count warnings. See $1"
fi
}
#check_errors:
# print error message if the compilation had errors
#argument:
# $1: log file
check_errors() {
#we look for 'error:' in the compilation log file
error_count=`grep -c "error:" "$1"`
if [ $error_count -gt 0 ]; then
echo_error "ERROR: $error_count error. See $1"
fi
}
compilations() {
[[ $# -eq 4 ]] || echo_fatal "compilations <dir> <logfile> <targets> <build-tool-opt>"
local dir=$1
local logfile=$2
local targets=$3
local build_tool_opt=$4
local verbose=$([ "$VERBOSE_COMPILE" == "1" ] && echo "-v" || echo "")
echo cd $OPENAIR_DIR/cmake_targets/$dir/build
cd $OPENAIR_DIR/cmake_targets/$dir/build
cmd="$CMAKE --build . ${verbose} --target ${targets} -- ${build_tool_opt}"
echo_info "Running \"${cmd}\"" $green
echo "Log file for compilation is being written to: $dlog/$logfile"
set +e
{
eval ${cmd}
ret=$?
} > $dlog/$logfile 2>&1
# Print the errors and warnings for CI purposes
grep -E -A5 -B5 "warning:|error:| Error " $dlog/$logfile || true
check_warnings "$dlog/$logfile"
if [[ $ret -eq 0 ]]; then
echo_success "$targets compiled"
else
check_errors "$dlog/$logfile"
echo_error "compilation of $targets failed"
exit 1
fi
}
############################################
# External packages installers
############################################