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
+1 -1
View File
@@ -43,7 +43,7 @@ class Native():
ret = ssh.run(f"C_INCLUDE_PATH={DPDK_PATH}/include/ PKG_CONFIG_PATH={DPDK_PATH}/lib64/pkgconfig/ {base}/build_oai {options} > {base}/build_oai.log", timeout=900)
success = ret.returncode == 0
logs = ssh.run(f"cat {base}/build_oai.log", silent=True)
logging.debug(f"build finished with code {ret.returncode}, output:\n{logs.stdout}")
logging.debug(f"build finished with code {ret.returncode}")
archiveArtifact(ssh, ctx, f'{base}/build_oai.log')
+4 -8
View File
@@ -37,7 +37,6 @@ set_openair_env
conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
HW=""
VERBOSE_COMPILE=0
BUILD_DIR=ran_build
DISABLE_HARDWARE_DEPENDENCY="False"
CMAKE_BUILD_TYPE="RelWithDebInfo"
@@ -98,8 +97,6 @@ Options:
Makes the unitary tests Layer 1 simulators
-V | --vcd
Adds a debgging facility to the binary files: GUI with major internal synchronization events
--verbose-compile
Shows detailed compilation instructions in makefile
--build-doxygen
Builds doxygen based documentation.
--trace-asn1c-enc-dec
@@ -314,10 +311,6 @@ function main() {
echo_info "Setting gtk-wave output"
CMAKE_CMD="$CMAKE_CMD -DENABLE_VCD_FIFO=True"
shift;;
--verbose-compile)
VERBOSE_COMPILE=1
echo_info "Will compile with verbose instructions"
shift;;
--build-doxygen)
CMAKE_CMD="$CMAKE_CMD -DGENERATE_DOXYGEN=ON"
TARGET_LIST="$TARGET_LIST doc"
@@ -475,7 +468,10 @@ function main() {
CMAKE_CMD="$CMAKE_CMD ../../.."
echo_info "Running \"$CMAKE_CMD\""
eval $CMAKE_CMD
compilations $BUILD_DIR all.txt "$TARGET_LIST" "${BUILD_TOOL_OPT}"
cmd="$CMAKE --build . --target ${TARGET_LIST} -- ${BUILD_TOOL_OPT}"
echo_info "Running \"${cmd}\"" $green
eval $cmd
ret=$?
if [ "$UE" = 1 ] ; then
echo_info "Generate LTE USIM default sim content UE specific part"
-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
############################################