Skip to content

Pin the CodeQL Rust toolchain to 1.94 - #297

Merged
bmachek merged 1 commit into
mainfrom
ci/codeql-rust-toolchain-pin
Aug 20, 2026
Merged

Pin the CodeQL Rust toolchain to 1.94#297
bmachek merged 1 commit into
mainfrom
ci/codeql-rust-toolchain-pin

Conversation

@bmachek

@bmachek bmachek commented Aug 20, 2026

Copy link
Copy Markdown
Member

Why

The CodeQL Rust job passes, but every run reports Low Rust analysis quality:

Percentage of calls with call target: 49 % (threshold 50 %). Percentage of expressions with known type: 58 % (threshold 20 %).

The extraction log for the last run on main shows what is behind those numbers:

WARN .../lrg-analysis/src/clustering.rs:65:21: macro expansion failed for 'vec'
WARN .../examples/bench_grouping.rs:52:27: macro expansion failed for 'format'
WARN .../lrg-ml/src/face_quality.rs:211:9:  macro expansion failed for 'assert_eq'
WARN .../examples/cull_eval.rs:74:9:        macro expansion failed for '$crate::format_args_nl'
...
| Total number of Rust files that were extracted with errors   |   110 |
| Total number of Rust files that were extracted without error |    12 |

vec!, format!, assert! and panic_2021 are everywhere in this workspace, and everything inside an unexpanded macro loses its call targets and types. So this is real lost coverage for the security queries, not only noisy logs.

Cause

Not this repository's code, and not the recent dependency changes: the failures track the std version on the runner. Bundle 2.26.3 vendors ra_ap_* 0.0.301, which copes with std up to 1.94 and fails on exactly these macros from 1.96 onwards. dtolnay/rust-toolchain@stable installed 1.97.1. See github/codeql#19982 — the same thread rules out the obvious other suspect, a missing rust-src component ("installing it changed the count by exactly zero").

Change

Pin that one job's toolchain to 1.94. Nothing is compiled under build-mode: none, so the version only decides which std rust-analyzer parses — it does not need to match the release build, and no other workflow is affected.

Removing the pin

rust-analyzer 0.0.328 merged upstream (github/codeql#21714) on 2026-08-14, two days after 2.26.3 shipped. Once the runner picks up 2.26.4 or later, this goes back to stable. The comment in the workflow says so.

Verification

The CodeQL run on this PR is the test — it should show the macro-expansion warnings gone and the two percentages back above their thresholds. If cargo 1.94 turns out not to resolve the workspace, the job fails loudly rather than silently degrading.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DNWGWJivRhKnTmXjsWSRj3

The Rust job scans successfully but reports "Low Rust analysis quality":
49% of calls have a call target (threshold 50%), and 110 of 122 files are
"extracted with errors". The extraction log shows why -- `vec!`, `format!`,
`assert_eq!` and `$crate::format_args_nl` all fail to expand, so everything
inside the workspace's most common macros loses its call targets and types.

The cause is the std version on the runner, not this repository's code:
bundle 2.26.3 vendors ra_ap_* 0.0.301, which handles std up to 1.94 and
fails on these macros from 1.96 on. dtolnay/rust-toolchain@stable installed
1.97.1. See github/codeql#19982 -- the same thread
rules out a missing `rust-src`.

Nothing is compiled under `build-mode: none`, so the toolchain version only
decides which std rust-analyzer reads; it does not have to match the release
build, and no other workflow is touched.

Temporary: rust-analyzer 0.0.328 landed upstream two days after 2.26.3
shipped, so bundle 2.26.4 should let the pin go back to `stable`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DNWGWJivRhKnTmXjsWSRj3
@github-actions

Copy link
Copy Markdown
Contributor

repowise

diff shape at the 39th percentile of recent commits.

Advisory only — this check never fails a build. Health is 1–10, higher is better.

@bmachek
bmachek merged commit 1226041 into main Aug 20, 2026
11 checks passed
@bmachek
bmachek deleted the ci/codeql-rust-toolchain-pin branch August 20, 2026 11:37
@bmachek

bmachek commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

Verified on the run for this PR (32363716525), against the last main run (32343578336):

stable (1.97.1) pinned 1.94
macro expansion failed warnings 115+ 0
Files extracted with errors 110 / 122 0 / 122
"Low Rust analysis quality" diagnostic fired not emitted

cargo 1.94 resolves the workspace without complaint, so the build-mode: none dependency graph is unaffected.

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.

1 participant