aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-03-12 10:56:04 -0700
committerJunio C Hamano <gitster@pobox.com>2026-03-12 10:56:04 -0700
commitfdfa7f64d641fe21661087d7bdb0f58d66e3d2de (patch)
tree2f0f83cfc364a31d8d92509e47dbf6c29e58d38a
parentb2102627d7baf993dd128d33e77139ab7929fbef (diff)
parent3afad3d8ae3ca59dea450ba96afa2d7ccaabab99 (diff)
downloadgit-fdfa7f64d641fe21661087d7bdb0f58d66e3d2de.tar.xz
Merge branch 'ps/ci-gitlab-prepare-for-macos-14-deprecation'
Move gitlab CI from macOS 14 images that are being deprecated. * ps/ci-gitlab-prepare-for-macos-14-deprecation: gitlab-ci: update to macOS 15 images meson: detect broken iconv that requires ICONV_RESTART_RESET meson: simplify iconv-emits-BOM check
-rw-r--r--.gitlab-ci.yml6
-rw-r--r--meson.build76
2 files changed, 46 insertions, 36 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 71b8a6e642..83ec786c5a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -101,13 +101,13 @@ test:osx:
parallel:
matrix:
- jobname: osx-clang
- image: macos-14-xcode-15
+ image: macos-15-xcode-16
CC: clang
- jobname: osx-reftable
- image: macos-14-xcode-15
+ image: macos-15-xcode-16
CC: clang
- jobname: osx-meson
- image: macos-14-xcode-15
+ image: macos-15-xcode-16
CC: clang
artifacts:
paths:
diff --git a/meson.build b/meson.build
index 4b536e0124..1b9be3d36c 100644
--- a/meson.build
+++ b/meson.build
@@ -1040,42 +1040,52 @@ if iconv.found()
have_old_iconv = true
endif
- iconv_omits_bom_source = '''#
- #include <iconv.h>
+ if meson.can_run_host_binaries()
+ if compiler.run('''
+ #include <iconv.h>
- int main(int argc, const char **argv)
- {
- '''
- if have_old_iconv
- iconv_omits_bom_source += '''
- typedef const char *iconv_ibp;
- '''
- else
- iconv_omits_bom_source += '''
- typedef char *iconv_ibp;
- '''
- endif
- iconv_omits_bom_source += '''
- int v;
- iconv_t conv;
- char in[] = "a"; iconv_ibp pin = in;
- char out[20] = ""; char *pout = out;
- size_t isz = sizeof in;
- size_t osz = sizeof out;
+ int main(int argc, const char **argv)
+ {
+ char in[] = "a", *inpos = in;
+ char out[20] = "", *outpos = out;
+ size_t insz = sizeof(in), outsz = sizeof(out);
+ iconv_t conv = iconv_open("UTF-16", "UTF-8");
+ iconv(conv, (void *) &inpos, &insz, &outpos, &outsz);
+ iconv_close(conv);
+ return (unsigned char)(out[0]) + (unsigned char)(out[1]) != 0xfe + 0xff;
+ }
+ ''',
+ dependencies: iconv,
+ name: 'iconv omits BOM',
+ ).returncode() != 0
+ libgit_c_args += '-DICONV_OMITS_BOM'
+ endif
- conv = iconv_open("UTF-16", "UTF-8");
- iconv(conv, &pin, &isz, &pout, &osz);
- iconv_close(conv);
- v = (unsigned char)(out[0]) + (unsigned char)(out[1]);
- return v != 0xfe + 0xff;
- }
- '''
+ if compiler.run('''
+ #include <iconv.h>
+ #include <string.h>
- if meson.can_run_host_binaries() and compiler.run(iconv_omits_bom_source,
- dependencies: iconv,
- name: 'iconv omits BOM',
- ).returncode() != 0
- libgit_c_args += '-DICONV_OMITS_BOM'
+ int main(int argc, const char *argv[])
+ {
+ char in[] = "\x1b\x24\x42\x24\x22\x24\x22\x1b\x28\x42", *inpos = in;
+ char out[7] = { 0 }, *outpos = out;
+ size_t insz = sizeof(in) - 1, outsz = 4;
+ iconv_t conv = iconv_open("UTF-8", "ISO-2022-JP");
+ if (!conv)
+ return 1;
+ if (iconv(conv, (void *) &inpos, &insz, &outpos, &outsz) != (size_t) -1)
+ return 2;
+ outsz = sizeof(out) - (outpos - out);
+ if (iconv(conv, (void *) &inpos, &insz, &outpos, &outsz) == (size_t) -1)
+ return 3;
+ return strcmp("\343\201\202\343\201\202", out) ? 4 : 0;
+ }
+ ''',
+ dependencies: iconv,
+ name: 'iconv handles restarts properly',
+ ).returncode() != 0
+ libgit_c_args += '-DICONV_RESTART_RESET'
+ endif
endif
else
libgit_c_args += '-DNO_ICONV'