From 07618496fcd6ec857c11c4fa136a8f40320e6208 Mon Sep 17 00:00:00 2001 From: Slobodan Predolac Date: Fri, 5 Jun 2026 10:51:34 -0700 Subject: [PATCH] Add CI coverage for --enable-cxx-infallible-new --- .github/workflows/linux-ci.yml | 15 ++++++++ .github/workflows/macos-ci.yml | 10 ++++++ .github/workflows/windows-ci.yml | 5 +++ scripts/gen_gh_actions.py | 62 ++++++++++++++++++++++++++++++++ 4 files changed, 92 insertions(+) diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml index aa553c2d..f8a6842e 100644 --- a/.github/workflows/linux-ci.yml +++ b/.github/workflows/linux-ci.yml @@ -508,6 +508,16 @@ jobs: CXX: g++ CONFIGURE_FLAGS: "--enable-debug --enable-experimental-smallocx --enable-stats --enable-prof" EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: --enable-cxx-infallible-new + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: "--enable-cxx-infallible-new --enable-debug" + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" steps: - uses: actions/checkout@v6 @@ -637,6 +647,11 @@ jobs: CXX: g++ CONFIGURE_FLAGS: "--with-malloc-conf=background_thread:true" EXTRA_CFLAGS: "-Werror -Wno-array-bounds" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: --enable-cxx-infallible-new + EXTRA_CFLAGS: "-Werror -Wno-array-bounds" steps: - uses: actions/checkout@v6 diff --git a/.github/workflows/macos-ci.yml b/.github/workflows/macos-ci.yml index 2ee889d2..d17e18ce 100644 --- a/.github/workflows/macos-ci.yml +++ b/.github/workflows/macos-ci.yml @@ -60,6 +60,11 @@ jobs: CXX: g++ CONFIGURE_FLAGS: "--with-malloc-conf=percpu_arena:percpu" EXTRA_CFLAGS: "-Werror -Wno-array-bounds -Wno-unknown-warning-option -Wno-ignored-attributes -Wno-deprecated-declarations" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: --enable-cxx-infallible-new + EXTRA_CFLAGS: "-Werror -Wno-array-bounds -Wno-unknown-warning-option -Wno-ignored-attributes -Wno-deprecated-declarations" steps: - uses: actions/checkout@v6 @@ -162,6 +167,11 @@ jobs: CXX: g++ CONFIGURE_FLAGS: "--with-malloc-conf=percpu_arena:percpu" EXTRA_CFLAGS: "-Werror -Wno-array-bounds -Wno-unknown-warning-option -Wno-ignored-attributes -Wno-deprecated-declarations" + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: --enable-cxx-infallible-new + EXTRA_CFLAGS: "-Werror -Wno-array-bounds -Wno-unknown-warning-option -Wno-ignored-attributes -Wno-deprecated-declarations" steps: - uses: actions/checkout@v6 diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 4fbd4a7d..084e0cde 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -52,6 +52,11 @@ jobs: CXX: cl.exe CROSS_COMPILE_32BIT: yes CONFIGURE_FLAGS: --enable-debug + - env: + CC: gcc + CXX: g++ + CONFIGURE_FLAGS: --enable-cxx-infallible-new + EXTRA_CFLAGS: -fcommon steps: - uses: actions/checkout@v6 diff --git a/scripts/gen_gh_actions.py b/scripts/gen_gh_actions.py index 92ed0ae0..5827424f 100755 --- a/scripts/gen_gh_actions.py +++ b/scripts/gen_gh_actions.py @@ -276,6 +276,24 @@ def generate_linux_job(arch): } ] + # --enable-cxx-infallible-new coverage. Plain variant runs on all arches; + # debug-combined variant runs only on AMD64 to bound matrix size. + infallible_new_entries = [ + { + 'CC': 'gcc', + 'CXX': 'g++', + 'CONFIGURE_FLAGS': '--enable-cxx-infallible-new', + 'EXTRA_CFLAGS': '-Werror -Wno-array-bounds' + }, + ] + if arch == AMD64: + infallible_new_entries.append({ + 'CC': 'gcc', + 'CXX': 'g++', + 'CONFIGURE_FLAGS': '--enable-cxx-infallible-new --enable-debug', + 'EXTRA_CFLAGS': '-Werror -Wno-array-bounds' + }) + if arch == AMD64: for entry in manual_entries: job += " - env:\n" @@ -285,6 +303,14 @@ def generate_linux_job(arch): else: job += f" {key}: {value}\n" + for entry in infallible_new_entries: + job += " - env:\n" + for key, value in entry.items(): + if ' ' in str(value): + job += f' {key}: "{value}"\n' + else: + job += f" {key}: {value}\n" + job += f""" steps: - uses: actions/checkout@v6 @@ -385,6 +411,24 @@ def generate_macos_job(arch): else: job += f" {key}: {value}\n" + # --enable-cxx-infallible-new coverage on macOS (both arches). + macos_extra_cflags = ' '.join(get_extra_cflags(OSX, GCC.value)) + infallible_new_entries = [ + { + 'CC': 'gcc', + 'CXX': 'g++', + 'CONFIGURE_FLAGS': '--enable-cxx-infallible-new', + 'EXTRA_CFLAGS': macos_extra_cflags + }, + ] + for entry in infallible_new_entries: + job += " - env:\n" + for key, value in entry.items(): + if ' ' in str(value) or any(c in str(value) for c in [':', ',', '#']): + job += f' {key}: "{value}"\n' + else: + job += f" {key}: {value}\n" + job += f""" steps: - uses: actions/checkout@v6 @@ -467,6 +511,24 @@ def generate_windows_job(arch): else: job += f" {key}: {value}\n" + # --enable-cxx-infallible-new coverage on Windows (MinGW-GCC only). + windows_mingw_cflags = ' '.join(get_extra_cflags(WINDOWS, GCC.value)) + infallible_new_entries = [ + { + 'CC': 'gcc', + 'CXX': 'g++', + 'CONFIGURE_FLAGS': '--enable-cxx-infallible-new', + 'EXTRA_CFLAGS': windows_mingw_cflags + }, + ] + for entry in infallible_new_entries: + job += " - env:\n" + for key, value in entry.items(): + if ' ' in str(value) or any(c in str(value) for c in [':', ',', '#']): + job += f' {key}: "{value}"\n' + else: + job += f" {key}: {value}\n" + job += f""" steps: - uses: actions/checkout@v6