From eee14ae148d2a028b5e14b2ad9e182fcf396b9ab Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 21 Jan 2024 15:17:16 +0530 Subject: [PATCH] Workaround for machines on GitHub Actions that incorrectly report CPU vector instruction availability --- kitty/simd-string.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kitty/simd-string.c b/kitty/simd-string.c index 5fd1a455a..9c5135f45 100644 --- a/kitty/simd-string.c +++ b/kitty/simd-string.c @@ -127,6 +127,12 @@ init_simd(void *x) { has_sse4_2 = true; has_avx2 = true; #else do_check(); + // On GitHub actions there are some weird macOS machines which report avx2 not available but sse4.2 is available and then + // SIGILL when using basic sse instructions + if (!has_avx2 && has_sse4_2) { + const char *ci = getenv("CI"); + if (ci && strcmp(ci, "true") == 0) has_sse4_2 = false; + } #endif #else #ifdef __aarch64__