From 454e2e8e2500d33ffe5d47332d80fc439d2d6974 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Tue, 11 Nov 2025 23:17:47 +0100 Subject: [PATCH 1/3] Add lscpu output to the build job. Add some suggestion for future comparison to a reference --- bot/build.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bot/build.sh b/bot/build.sh index 91c66c78..d02cf86e 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -171,6 +171,18 @@ else fi echo "bot/build.sh: EESSI_ACCELERATOR_TARGET_OVERRIDE='${EESSI_ACCELERATOR_TARGET_OVERRIDE}'" +# check if CPU architecture of the build host matches our expectation +lscpu_flags_line=$(lscpu | grep "Flags:") +# strip leading "Flags:" and spaces, and put result in a bash array +if [[ $lscpu_flags =~ Flags:\ (.*) ]]; then lscpu_flags=(${BASH_REMATCH[1]}); fi +# for now, just print +echo "bot/build.sh: CPU flags=${lscpu_flags[@]}" +# todo: an actual comparison with a reference bash array, e.g. through +# diff_result=$(diff <(printf "%s\n" "${lscpu_flags[@]}" | sort) <(printf "%s\n" "${lscpu_flags_ref[@]}" | sort)) +# if [ ! -z "$diff_result" ]; then +# 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. +# fi + # get EESSI_OS_TYPE from .architecture.os_type in ${JOB_CFG_FILE} (default: linux) EESSI_OS_TYPE=$(cfg_get_value "architecture" "os_type") export EESSI_OS_TYPE=${EESSI_OS_TYPE:-linux} From 7c9c9f95b37026968e7dd8c66116a1e78fdbd2f7 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Wed, 12 Nov 2025 13:54:12 +0100 Subject: [PATCH 2/3] Log full lscpu and os-release output in separate files in the bot job dir --- bot/build.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bot/build.sh b/bot/build.sh index d02cf86e..3b9b7cf9 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -177,7 +177,11 @@ lscpu_flags_line=$(lscpu | grep "Flags:") if [[ $lscpu_flags =~ Flags:\ (.*) ]]; then lscpu_flags=(${BASH_REMATCH[1]}); fi # for now, just print echo "bot/build.sh: CPU flags=${lscpu_flags[@]}" -# todo: an actual comparison with a reference bash array, e.g. through +# Also, log the full lscpu and os-release info: +lscpu > _bot_job${SLURM_JOB_ID}.lscpu +cat /etc/os-release > _bot_job${SLURM_JOB_ID}.os + +# TODO: an actual comparison with a reference bash array, e.g. through # diff_result=$(diff <(printf "%s\n" "${lscpu_flags[@]}" | sort) <(printf "%s\n" "${lscpu_flags_ref[@]}" | sort)) # if [ ! -z "$diff_result" ]; then # 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. From 5bf5d16bb72d1a8fe01deb29ba613cc996c55763 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Wed, 12 Nov 2025 13:57:07 +0100 Subject: [PATCH 3/3] Switch order --- bot/build.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bot/build.sh b/bot/build.sh index 3b9b7cf9..e33d0647 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -171,16 +171,16 @@ else fi echo "bot/build.sh: EESSI_ACCELERATOR_TARGET_OVERRIDE='${EESSI_ACCELERATOR_TARGET_OVERRIDE}'" -# check if CPU architecture of the build host matches our expectation +# Log the full lscpu and os-release info: +lscpu > _bot_job${SLURM_JOB_ID}.lscpu +cat /etc/os-release > _bot_job${SLURM_JOB_ID}.os + +# Also: fetch CPU flags into an array, so that we can implement a hard check against a reference lscpu_flags_line=$(lscpu | grep "Flags:") # strip leading "Flags:" and spaces, and put result in a bash array if [[ $lscpu_flags =~ Flags:\ (.*) ]]; then lscpu_flags=(${BASH_REMATCH[1]}); fi # for now, just print echo "bot/build.sh: CPU flags=${lscpu_flags[@]}" -# Also, log the full lscpu and os-release info: -lscpu > _bot_job${SLURM_JOB_ID}.lscpu -cat /etc/os-release > _bot_job${SLURM_JOB_ID}.os - # TODO: an actual comparison with a reference bash array, e.g. through # diff_result=$(diff <(printf "%s\n" "${lscpu_flags[@]}" | sort) <(printf "%s\n" "${lscpu_flags_ref[@]}" | sort)) # if [ ! -z "$diff_result" ]; then