{"thread":{"id":"62628","subject":"[PATCH v3 1/4] gitlab-ci: update macOS images to Sonoma","startedAt":"2024-12-12T06:47:37Z","lastAt":"2024-12-12T11:57:55Z","messageCount":6,"participants":["Patrick Steinhardt","Toon Claes"],"isPatch":true,"patchVersion":3,"patchTotal":4},"messages":[{"id":"509011","messageId":"20241212-pks-ci-section-fixes-v3-1-d9fe6baee21e@pks.im","threadId":"62628","inReplyTo":"20241212-pks-ci-section-fixes-v3-0-d9fe6baee21e@pks.im","subject":"[PATCH v3 1/4] gitlab-ci: update macOS images to Sonoma","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-12-12T06:47:14Z","receivedAt":"2024-12-12T06:47:37Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"The macOS Ventura images we use for GitLab CI runners have been\ndeprecated. Update them to macOS 14, aka Sonoma.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n .gitlab-ci.yml | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/.gitlab-ci.yml b/.gitlab-ci.yml\nindex 526ecfe030a43e0a5a83ddd35cb7c96d46ab2485..61c56ccac8fdc940075d91dd4cb0b54ee33d5199 100644\n--- a/.gitlab-ci.yml\n+++ b/.gitlab-ci.yml\n@@ -99,10 +99,10 @@ test:osx:\n   parallel:\n     matrix:\n       - jobname: osx-clang\n-        image: macos-13-xcode-14\n+        image: macos-14-xcode-15\n         CC: clang\n       - jobname: osx-reftable\n-        image: macos-13-xcode-14\n+        image: macos-14-xcode-15\n         CC: clang\n   artifacts:\n     paths:\n\n-- \n2.47.1.447.ga7e8429e30.dirty\n\n"},{"id":"509013","messageId":"20241212-pks-ci-section-fixes-v3-0-d9fe6baee21e@pks.im","threadId":"62628","inReplyTo":"20241206-pks-ci-section-fixes-v1-0-7ab1b69e3648@pks.im","subject":"[PATCH v3 0/4] Random improvements to GitLab CI","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-12-12T06:47:13Z","receivedAt":"2024-12-12T06:47:37Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Hi,\n\nthis small patch series includes a couple of more-or-less random\nimprovements to GitLab CI.\n\nChanges in v2:\n- Use \"%s\" to inject variable data into section headers instead of\n  converting to echo.\n- Link to v1: https://lore.kernel.org/r/20241206-pks-ci-section-fixes-v1-0-7ab1b69e3648@pks.im\n\nChanges in v3:\n- Wrap overly long lines.\n- Fix a word swap in a commit message.\n- Link to v2: https://lore.kernel.org/r/20241210-pks-ci-section-fixes-v2-0-e087cfd174f4@pks.im\n\nThanks!\n\nPatrick\n\n---\nPatrick Steinhardt (4):\n      gitlab-ci: update macOS images to Sonoma\n      ci/lib: remove duplicate trap to end \"CI setup\" group\n      ci/lib: do not interpret escape sequences in `group ()` arguments\n      ci/lib: fix \"CI setup\" sections with GitLab CI\n\n .gitlab-ci.yml |  4 ++--\n ci/lib.sh      | 11 ++++++-----\n 2 files changed, 8 insertions(+), 7 deletions(-)\n\nRange-diff versus v2:\n\n1:  e504aa4a1f = 1:  633af36640 gitlab-ci: update macOS images to Sonoma\n2:  021ac694ef = 2:  6b6c6b2937 ci/lib: remove duplicate trap to end \"CI setup\" group\n3:  6e355e22d7 ! 3:  bd54f8e1b6 ci/lib: do not interpret escape sequences in `group ()` arguments\n    @@ Commit message\n         We use printf to set up sections with GitLab CI, which requires us to\n         print a bunch of escape sequences via printf. The group name is\n         controlled by the user and is expanded directly into the formatting\n    -    string, which may cause problems in case the argument controls escape\n    +    string, which may cause problems in case the argument contains escape\n         sequences or formatting directives.\n     \n         Fix this potential issue by using formatting directives to pass variable\n    @@ ci/lib.sh: elif test true = \"$GITLAB_CI\"\n      \tbegin_group () {\n      \t\tneed_to_end_group=t\n     -\t\tprintf \"\\e[0Ksection_start:$(date +%s):$(echo \"$1\" | tr ' ' _)[collapsed=true]\\r\\e[0K$1\\n\"\n    -+\t\tprintf '\\e[0Ksection_start:%s:%s[collapsed=true]\\r\\e[0K%s\\n' \"$(date +%s)\" \"$(echo \"$1\" | tr ' ' _)\" \"$1\"\n    ++\t\tprintf '\\e[0Ksection_start:%s:%s[collapsed=true]\\r\\e[0K%s\\n' \\\n    ++\t\t\t\"$(date +%s)\" \"$(echo \"$1\" | tr ' ' _)\" \"$1\"\n      \t\ttrap \"end_group '$1'\" EXIT\n      \t\tset -x\n      \t}\n    @@ ci/lib.sh: then\n      \t\tset +x\n      \t\tneed_to_end_group=\n     -\t\tprintf \"\\e[0Ksection_end:$(date +%s):$(echo \"$1\" | tr ' ' _)\\r\\e[0K\\n\"\n    -+\t\tprintf '\\e[0Ksection_end:%s:%s\\r\\e[0K\\n' \"$(date +%s)\" \"$(echo \"$1\" | tr ' ' _)\"\n    ++\t\tprintf '\\e[0Ksection_end:%s:%s\\r\\e[0K\\n' \\\n    ++\t\t\t\"$(date +%s)\" \"$(echo \"$1\" | tr ' ' _)\"\n      \t\ttrap - EXIT\n      \t}\n      else\n4:  bae2071e47 = 4:  41ad98d633 ci/lib: fix \"CI setup\" sections with GitLab CI\n\n---\nbase-commit: e66fd72e972df760a53c3d6da023c17adfc426d6\nchange-id: 20241206-pks-ci-section-fixes-1bb91ceb50b8\n\n"},{"id":"509012","messageId":"20241212-pks-ci-section-fixes-v3-2-d9fe6baee21e@pks.im","threadId":"62628","inReplyTo":"20241212-pks-ci-section-fixes-v3-0-d9fe6baee21e@pks.im","subject":"[PATCH v3 2/4] ci/lib: remove duplicate trap to end \"CI setup\" group","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-12-12T06:47:15Z","receivedAt":"2024-12-12T06:47:38Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"We exlicitly trap on EXIT in order to end the \"CI setup\" group. This\nisn't necessary though given that `begin_group ()` already sets up the\ntrap for us.\n\nRemove the duplicate trap.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n ci/lib.sh | 1 -\n 1 file changed, 1 deletion(-)\n\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex 930f98d7228166c37c236beb062b14675fb68ef3..a54601be923bf475ba1a9cafd98bb1cb71a10255 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -56,7 +56,6 @@ group () {\n }\n \n begin_group \"CI setup\"\n-trap \"end_group 'CI setup'\" EXIT\n \n # Set 'exit on error' for all CI scripts to let the caller know that\n # something went wrong.\n\n-- \n2.47.1.447.ga7e8429e30.dirty\n\n"},{"id":"509015","messageId":"20241212-pks-ci-section-fixes-v3-4-d9fe6baee21e@pks.im","threadId":"62628","inReplyTo":"20241212-pks-ci-section-fixes-v3-0-d9fe6baee21e@pks.im","subject":"[PATCH v3 4/4] ci/lib: fix \"CI setup\" sections with GitLab CI","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-12-12T06:47:17Z","receivedAt":"2024-12-12T06:47:38Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Whenever we source \"ci/lib.sh\" we wrap the directives in a separate\ngroup so that they can easily be collapsed in the web UI. And as we\nsource the script multiple times during a single CI run we thus end up\nwith the same section name reused multiple times, as well.\n\nThis is broken on GitLab CI though, where reusing the same group name is\nnot supported. The consequence is that only the last of these sections\ncan be collapsed.\n\nFix this issue by including the name of the sourcing script in the\ngroup's name.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n ci/lib.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex d403ada911722af554df6255e5cd3fa01b56fd22..5440eb6dc02784c03a5e4919f97dd7f07881f5c7 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -57,7 +57,7 @@ group () {\n \treturn $res\n }\n \n-begin_group \"CI setup\"\n+begin_group \"CI setup via $(basename $0)\"\n \n # Set 'exit on error' for all CI scripts to let the caller know that\n # something went wrong.\n@@ -395,5 +395,5 @@ esac\n \n MAKEFLAGS=\"$MAKEFLAGS CC=${CC:-cc}\"\n \n-end_group \"CI setup\"\n+end_group \"CI setup via $(basename $0)\"\n set -x\n\n-- \n2.47.1.447.ga7e8429e30.dirty\n\n"},{"id":"509014","messageId":"20241212-pks-ci-section-fixes-v3-3-d9fe6baee21e@pks.im","threadId":"62628","inReplyTo":"20241212-pks-ci-section-fixes-v3-0-d9fe6baee21e@pks.im","subject":"[PATCH v3 3/4] ci/lib: do not interpret escape sequences in `group ()` arguments","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-12-12T06:47:16Z","receivedAt":"2024-12-12T06:47:39Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"We use printf to set up sections with GitLab CI, which requires us to\nprint a bunch of escape sequences via printf. The group name is\ncontrolled by the user and is expanded directly into the formatting\nstring, which may cause problems in case the argument contains escape\nsequences or formatting directives.\n\nFix this potential issue by using formatting directives to pass variable\ndata.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n ci/lib.sh | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex a54601be923bf475ba1a9cafd98bb1cb71a10255..d403ada911722af554df6255e5cd3fa01b56fd22 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -18,7 +18,8 @@ elif test true = \"$GITLAB_CI\"\n then\n \tbegin_group () {\n \t\tneed_to_end_group=t\n-\t\tprintf \"\\e[0Ksection_start:$(date +%s):$(echo \"$1\" | tr ' ' _)[collapsed=true]\\r\\e[0K$1\\n\"\n+\t\tprintf '\\e[0Ksection_start:%s:%s[collapsed=true]\\r\\e[0K%s\\n' \\\n+\t\t\t\"$(date +%s)\" \"$(echo \"$1\" | tr ' ' _)\" \"$1\"\n \t\ttrap \"end_group '$1'\" EXIT\n \t\tset -x\n \t}\n@@ -27,7 +28,8 @@ then\n \t\ttest -n \"$need_to_end_group\" || return 0\n \t\tset +x\n \t\tneed_to_end_group=\n-\t\tprintf \"\\e[0Ksection_end:$(date +%s):$(echo \"$1\" | tr ' ' _)\\r\\e[0K\\n\"\n+\t\tprintf '\\e[0Ksection_end:%s:%s\\r\\e[0K\\n' \\\n+\t\t\t\"$(date +%s)\" \"$(echo \"$1\" | tr ' ' _)\"\n \t\ttrap - EXIT\n \t}\n else\n\n-- \n2.47.1.447.ga7e8429e30.dirty\n\n"},{"id":"509029","messageId":"87v7vpi05s.fsf@iotcl.com","threadId":"62628","inReplyTo":"20241212-pks-ci-section-fixes-v3-0-d9fe6baee21e@pks.im","subject":"Re: [PATCH v3 0/4] Random improvements to GitLab CI","fromName":"Toon Claes","fromEmail":"toon@iotcl.com","sentAt":"2024-12-12T11:57:35Z","receivedAt":"2024-12-12T11:57:55Z","isPatch":true,"sender":{"key":"toon@iotcl.com","avatar":"https://avatars.githubusercontent.com/u/121621?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> Hi,\n>\n> this small patch series includes a couple of more-or-less random\n> improvements to GitLab CI.\n>\n> Changes in v2:\n> - Use \"%s\" to inject variable data into section headers instead of\n>   converting to echo.\n> - Link to v1: https://lore.kernel.org/r/20241206-pks-ci-section-fixes-v1-0-7ab1b69e3648@pks.im\n>\n> Changes in v3:\n> - Wrap overly long lines.\n> - Fix a word swap in a commit message.\n> - Link to v2: https://lore.kernel.org/r/20241210-pks-ci-section-fixes-v2-0-e087cfd174f4@pks.im\n\nThanks, all looks good to me.\n\n--\nToon\n"}]}