Skip to content

Detection fixes: heuristic CI OSes from runner lines only; a CMake generator names no compiler a command names - #371

Merged
lefticus merged 2 commits into
cpp-best-practices:mainfrom
leftibot:detection-fixes
Nov 24, 2026
Merged

lefticus merged 2 commits into
cpp-best-practices:mainfrom
leftibot:detection-fixes

Conversation

@leftibot

Copy link
Copy Markdown
Collaborator

Two detection fixes the #370 corpus run showed. Both are independent of #370.

CI files scanned heuristically take their OSes from the lines that configure runners

A configuration that isn't parsed (Azure Pipelines, AppVeyor, CircleCI, Travis, Jenkins, …) gets one job per OS it names, and any mention of an OS used to count: a description, a comment, a command or a file name.

Only the lines that configure where a job runs count now. These are a key such as vmImage, image, os, platform, agent, label, machine, executor, resource_class, pool, runs-on, CircleCI's macos or Cirrus's windows_container, or a Jenkinsfile's agent { label … } and node(…). A key's value may also be:

  • on the lines indented under it;
  • a sequence at the key's own indentation (image: then - Visual Studio 2017);
  • after an anchor (build-image: &image).

A comment after the value isn't read.

A CMake generator shows the compiler only when the command names none

llama.cpp's SYCL build runs cmake -G "MinGW Makefiles" … -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=icx, and the generator's name was read as gcc. A generator does pick the build's compiler (MinGW Makefiles gcc, Visual Studio MSVC), but only when the command names none. Now:

  • A named compiler wins: where a compiler variable or a toolset (-T ClangCL) names the compiler, the generator shows nothing.
  • cl is MSVC: cl named as a compiler (-DCMAKE_C_COMPILER=cl, CC=cl) counts as MSVC.

What a command shows about its compiler is the build system's to say. It is a new BuildSystem.compiler_evidence hook, shaped like build_types. CMake implements it with the -D definitions parser that cmake -P already used, now shared as definitions.

Corpus: 5 of 235 projects differ, each a correction

  • docker-code-server: its Jenkinsfile was also a Windows job, from an image label's description ("… on your Mac, Windows"). It is a Linux job only now.
  • golang-migrate: Travis was also a Windows job, from release artifact names (migrate.windows-amd64.exe.tar.gz). It is a Linux job only now.
  • hledger: its Azure matrix had Linux and macOS jobs taken from commented-out lines (# imageName: 'macos-10.13'). Only its Windows job is left.
  • llama.cpp: the SYCL job is Intel and MSVC (cl), not gcc.
  • nlohmann/json: its -T ClangCL jobs are clang, which is CMake's compiler ID for clang-cl, not MSVC as well.

Verified:

  • All local gates pass.
  • Each new behaviour was test first, with the RED run seen.
  • The two YAML forms (a sequence at the key's indentation, and an anchor) came from envoy's and scalafmt's files in an earlier corpus run, which lost their OS before the fix.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt

leftibot and others added 2 commits November 23, 2026 18:14
…onfigure runners

A configuration that is not parsed gets one job per OS it names, and any mention counted: docker-code-server's
Jenkinsfile, which builds on Linux, became a Windows job too because an image label's description says code-server
runs on "your Mac, Windows". Only the lines that configure where a job runs name its OS now: a key such as `vmImage`,
`image`, `os`, `platform`, `agent`, `label`, `machine`, `executor`, `resource_class`, `pool`, `runs-on`, CircleCI's
`macos` or Cirrus's `windows_container`, or a Jenkinsfile's `agent { label … }` and `node(…)`; a comment after the
value is not read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
llama.cpp's SYCL build runs `cmake -G "MinGW Makefiles" … -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=icx`, and the
generator's name was read as gcc. A generator does pick the compiler a build uses (MinGW Makefiles gcc, Visual
Studio MSVC), but only when the command names none: where a compiler variable or a toolset (`-T ClangCL`) names it,
the generator now shows nothing. `cl` named as a compiler (`-DCMAKE_C_COMPILER=cl`, `CC=cl`) is MSVC.

What a command shows about its compiler is the build system's to say: `BuildSystem.compiler_evidence`, as
`build_types` is, which CMake reads with the definitions parser `cmake -P` already used (now `definitions`).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
@codecov

codecov Bot commented Nov 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.72%. Comparing base (8d90b79) to head (e23d2e7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #371   +/-   ##
=======================================
  Coverage   99.72%   99.72%           
=======================================
  Files         313      313           
  Lines       19984    20021   +37     
  Branches     2337     2346    +9     
=======================================
+ Hits        19929    19966   +37     
  Misses         55       55           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lefticus
lefticus merged commit 67e7972 into cpp-best-practices:main Nov 24, 2026
26 checks passed
@lefticus
lefticus deleted the detection-fixes branch November 24, 2026 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants