Skip to content

Commit 454e2e8

Browse files
author
Caspar van Leeuwen
committed
Add lscpu output to the build job. Add some suggestion for future comparison to a reference
1 parent cf64753 commit 454e2e8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

bot/build.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,18 @@ else
171171
fi
172172
echo "bot/build.sh: EESSI_ACCELERATOR_TARGET_OVERRIDE='${EESSI_ACCELERATOR_TARGET_OVERRIDE}'"
173173

174+
# check if CPU architecture of the build host matches our expectation
175+
lscpu_flags_line=$(lscpu | grep "Flags:")
176+
# strip leading "Flags:" and spaces, and put result in a bash array
177+
if [[ $lscpu_flags =~ Flags:\ (.*) ]]; then lscpu_flags=(${BASH_REMATCH[1]}); fi
178+
# for now, just print
179+
echo "bot/build.sh: CPU flags=${lscpu_flags[@]}"
180+
# todo: an actual comparison with a reference bash array, e.g. through
181+
# diff_result=$(diff <(printf "%s\n" "${lscpu_flags[@]}" | sort) <(printf "%s\n" "${lscpu_flags_ref[@]}" | sort))
182+
# if [ ! -z "$diff_result" ]; then
183+
# echo "bot/build.sh: ERROR: difference between reported lscpu flags and reference for this ($EESSI_SOFTWARE_SUBDIR_OVERRIDE) CPU architecture. This could mean an incorrect build host was used to build for this target.
184+
# fi
185+
174186
# get EESSI_OS_TYPE from .architecture.os_type in ${JOB_CFG_FILE} (default: linux)
175187
EESSI_OS_TYPE=$(cfg_get_value "architecture" "os_type")
176188
export EESSI_OS_TYPE=${EESSI_OS_TYPE:-linux}

0 commit comments

Comments
 (0)