From e1b52cf71ee740b128c7b08ccd4372dedf7741cc Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Thu, 12 Dec 2024 07:47:14 +0100 Subject: [PATCH 1/4] gitlab-ci: update macOS images to Sonoma The macOS Ventura images we use for GitLab CI runners have been deprecated. Update them to macOS 14, aka Sonoma. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4abfbc3e20..d4709aaef6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -90,10 +90,10 @@ test:osx: parallel: matrix: - jobname: osx-clang - image: macos-13-xcode-14 + image: macos-14-xcode-15 CC: clang - jobname: osx-reftable - image: macos-13-xcode-14 + image: macos-14-xcode-15 CC: clang artifacts: paths: From 33b06fa603958ba936ea7602c9b81d10ffcd08bb Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Thu, 12 Dec 2024 07:47:15 +0100 Subject: [PATCH 2/4] ci/lib: remove duplicate trap to end "CI setup" group We exlicitly trap on EXIT in order to end the "CI setup" group. This isn't necessary though given that `begin_group ()` already sets up the trap for us. Remove the duplicate trap. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- ci/lib.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/lib.sh b/ci/lib.sh index 74b430be23..de3a95cea1 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -56,7 +56,6 @@ group () { } begin_group "CI setup" -trap "end_group 'CI setup'" EXIT # Set 'exit on error' for all CI scripts to let the caller know that # something went wrong. From d2ca12020ffb7ee7f0ee1154f394a994f045b5a9 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Thu, 12 Dec 2024 07:47:16 +0100 Subject: [PATCH 3/4] ci/lib: do not interpret escape sequences in `group ()` arguments We use printf to set up sections with GitLab CI, which requires us to print a bunch of escape sequences via printf. The group name is controlled by the user and is expanded directly into the formatting string, which may cause problems in case the argument contains escape sequences or formatting directives. Fix this potential issue by using formatting directives to pass variable data. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- ci/lib.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ci/lib.sh b/ci/lib.sh index de3a95cea1..803f56bc82 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -18,7 +18,8 @@ elif test true = "$GITLAB_CI" then begin_group () { need_to_end_group=t - printf "\e[0Ksection_start:$(date +%s):$(echo "$1" | tr ' ' _)[collapsed=true]\r\e[0K$1\n" + printf '\e[0Ksection_start:%s:%s[collapsed=true]\r\e[0K%s\n' \ + "$(date +%s)" "$(echo "$1" | tr ' ' _)" "$1" trap "end_group '$1'" EXIT set -x } @@ -27,7 +28,8 @@ then test -n "$need_to_end_group" || return 0 set +x need_to_end_group= - printf "\e[0Ksection_end:$(date +%s):$(echo "$1" | tr ' ' _)\r\e[0K\n" + printf '\e[0Ksection_end:%s:%s\r\e[0K\n' \ + "$(date +%s)" "$(echo "$1" | tr ' ' _)" trap - EXIT } else From c6b43f663eb252deb28cfff79e1ccdefed87c971 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Thu, 12 Dec 2024 07:47:17 +0100 Subject: [PATCH 4/4] ci/lib: fix "CI setup" sections with GitLab CI Whenever we source "ci/lib.sh" we wrap the directives in a separate group so that they can easily be collapsed in the web UI. And as we source the script multiple times during a single CI run we thus end up with the same section name reused multiple times, as well. This is broken on GitLab CI though, where reusing the same group name is not supported. The consequence is that only the last of these sections can be collapsed. Fix this issue by including the name of the sourcing script in the group's name. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- ci/lib.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/lib.sh b/ci/lib.sh index 803f56bc82..63c42fe93a 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -57,7 +57,7 @@ group () { return $res } -begin_group "CI setup" +begin_group "CI setup via $(basename $0)" # Set 'exit on error' for all CI scripts to let the caller know that # something went wrong. @@ -388,5 +388,5 @@ esac MAKEFLAGS="$MAKEFLAGS CC=${CC:-cc}" -end_group "CI setup" +end_group "CI setup via $(basename $0)" set -x