From 35361db76b9181f0dde4c38fd93623ac74793d80 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 7 Aug 2025 13:11:12 +0200 Subject: [PATCH] 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. --- ci-scripts/cls_native.py | 2 +- cmake_targets/build_oai | 12 +++---- cmake_targets/tools/build_helper | 59 -------------------------------- 3 files changed, 5 insertions(+), 68 deletions(-) diff --git a/ci-scripts/cls_native.py b/ci-scripts/cls_native.py index 3dde286c3a..83c1b14b37 100644 --- a/ci-scripts/cls_native.py +++ b/ci-scripts/cls_native.py @@ -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') diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 3b43d69911..b1b305c596 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -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" diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index f13dd314ef..2c79659991 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -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 " - 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 ############################################