From ff118784fa544057e3752e6c0e9291e68f8c800e Mon Sep 17 00:00:00 2001 From: Yves Delley Date: Tue, 12 Nov 2024 21:48:59 +0100 Subject: [PATCH] exclude clang18+debug from freestanding again --- .github/generate-job-matrix.py | 11 ++++++++++- .github/job_matrix.py | 10 ++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/generate-job-matrix.py b/.github/generate-job-matrix.py index b30ea573c..e2033b997 100644 --- a/.github/generate-job-matrix.py +++ b/.github/generate-job-matrix.py @@ -119,7 +119,12 @@ def main(): rgen = random.Random(args.seed) - collector = CombinationCollector(full_matrix) + collector = CombinationCollector( + full_matrix, + hard_excludes=lambda e: ( + e.formatting == "std::format" and not e.config.std_format_support + ), + ) match args.preset: case None: pass @@ -143,7 +148,11 @@ def main(): case "clang-tidy": collector.all_combinations(config=configs["Clang-18 (x86-64)"]) case "freestanding": + # TODO For some reason Clang-18 Debug with -ffreestanding does not pass CMakeTestCXXCompiler collector.all_combinations( + filter=lambda e: not ( + e.config.name.startswith("Clang-18") and e.build_type == "Debug" + ), config=[configs[c] for c in ["GCC-14", "Clang-18 (x86-64)"]], contracts="none", std=23, diff --git a/.github/job_matrix.py b/.github/job_matrix.py index 204be6799..0458a1e9e 100644 --- a/.github/job_matrix.py +++ b/.github/job_matrix.py @@ -55,8 +55,14 @@ def dataclass_to_json(obj): class CombinationCollector: """Incremental builder of MatrixElements, allowing successive selection of entries.""" - def __init__(self, full_matrix: dict[str, list[typing.Any]]): + def __init__( + self, + full_matrix: dict[str, list[typing.Any]], + *, + hard_excludes: typing.Callable[[MatrixElement], bool] | None = None, + ): self.full_matrix = full_matrix + self.hard_excludes = hard_excludes self.combinations: set[MatrixElement] = set() self.per_value_counts: dict[tuple[str, typing.Any], int] = { (k, v): 0 for k, options in full_matrix.items() for v in options @@ -72,7 +78,7 @@ def _make_submatrix(self, **overrides): def _add_combination(self, e: MatrixElement): if e in self.combinations or ( - e.formatting == "std::format" and not e.config.std_format_support + self.hard_excludes is not None and self.hard_excludes(e) ): return self.combinations.add(e)