From 9fd3e49a085a05721a0cc2d2b1e03e36831c9b36 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Sep 2025 08:28:33 +0200 Subject: [PATCH 1/4] Add simplified build script build-codec.sh --- main-basop.yml | 3 +- snippets/basop/build-codec.sh | 52 +++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 snippets/basop/build-codec.sh diff --git a/main-basop.yml b/main-basop.yml index fda6a3f..efc81bc 100644 --- a/main-basop.yml +++ b/main-basop.yml @@ -285,7 +285,8 @@ workflow: - if [ "$DELTA_ODG" = "true" ]; then comp_args="${comp_args} --odg_bin"; MEASURES_FOR_REPORT="$MEASURES_FOR_REPORT DELTA_ODG"; fi - if [ "$SPLIT_COMPARISON" = "true" ]; then comp_args="${comp_args} --split-comparison"; fi - - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-and-create-float-ref-outputs.sh + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-codec.sh ivas-float-update _ref + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-codec.sh HEAD # DMX comparison only in manual job with no other metrics - if [ "$COMPARE_DMX" = "true" ]; then diff --git a/snippets/basop/build-codec.sh b/snippets/basop/build-codec.sh new file mode 100644 index 0000000..26b081c --- /dev/null +++ b/snippets/basop/build-codec.sh @@ -0,0 +1,52 @@ +#! /bin/bash + +# Usage: build-codec.sh [] +# +# Checks out , builds executables, optionally appends and returns to current branch + +set -euxo pipefail + +cd "${CI_PROJECT_DIR}" + +commit=$1 +if [ $# -eq 2 ]; then + suffix=$2 + suffix_msg="suffix $2" +else + suffix="" + suffix_msg="no suffix" +fi + +echo "Building binaries from commit $ref_to_check_out with $suffix_msg" + +current_commit_sha="$(git rev-parse HEAD)" + +restore_stash() { + if [[ "$(git stash list)" != "" ]]; then + git stash pop + fi +} +trap restore_stash EXIT + +# store potential changes +# should never fail, even if there is nothing to be stored +git stash + +git checkout "$commit" + +bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/activate-debug-mode-info-if-set.sh + +make clean +make -j "$(nproc)" + +# avoid errors in mv when renaming to same file +if [ -n $suffix ]; then + mv IVAS_cod IVAS_cod"$suffix" + mv IVAS_dec IVAS_dec"$suffix" + mv IVAS_rend IVAS_rend"$suffix" + if [ -f ISAR_post_rend ]; then mv ISAR_post_rend ISAR_post_rend"$suffix"; fi +fi +# return to current branch +git restore . +git rev-parse HEAD >"$commit_file" +git checkout "$current_commit_sha" -- GitLab From 8d362fd265bea9eb7b94e9350fd040a08fe79294 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Sep 2025 08:49:16 +0200 Subject: [PATCH 2/4] Correct missing variable --- snippets/basop/build-codec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/basop/build-codec.sh b/snippets/basop/build-codec.sh index 26b081c..c630c4e 100644 --- a/snippets/basop/build-codec.sh +++ b/snippets/basop/build-codec.sh @@ -17,7 +17,7 @@ else suffix_msg="no suffix" fi -echo "Building binaries from commit $ref_to_check_out with $suffix_msg" +echo "Building binaries from commit $commit with $suffix_msg" current_commit_sha="$(git rev-parse HEAD)" -- GitLab From a4513f8956fd35589c288637a0b848b171ff6104 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Sep 2025 09:22:17 +0200 Subject: [PATCH 3/4] Remove commit file from build-codec.sh --- snippets/basop/build-codec.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/snippets/basop/build-codec.sh b/snippets/basop/build-codec.sh index c630c4e..7bc323a 100644 --- a/snippets/basop/build-codec.sh +++ b/snippets/basop/build-codec.sh @@ -48,5 +48,4 @@ if [ -n $suffix ]; then fi # return to current branch git restore . -git rev-parse HEAD >"$commit_file" git checkout "$current_commit_sha" -- GitLab From 8fa9fc616be5a132b3edf54e67392bb63f46c080 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 26 Sep 2025 09:32:45 +0200 Subject: [PATCH 4/4] Fix syntax error for checking empty string --- snippets/basop/build-codec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/basop/build-codec.sh b/snippets/basop/build-codec.sh index 7bc323a..baf4ae1 100644 --- a/snippets/basop/build-codec.sh +++ b/snippets/basop/build-codec.sh @@ -40,7 +40,7 @@ make clean make -j "$(nproc)" # avoid errors in mv when renaming to same file -if [ -n $suffix ]; then +if [ -n "$suffix" ]; then mv IVAS_cod IVAS_cod"$suffix" mv IVAS_dec IVAS_dec"$suffix" mv IVAS_rend IVAS_rend"$suffix" -- GitLab