fix: install a C linker in Qodana's image so build scripts run
CI / ci-ok (push) Skipped
Security / workflow-lint (push) Skipped
CI / Linux · fmt, clippy, rules, tests, coverage (pull_request) Successful in 51s
CI / Windows · clippy, tests (pull_request) Successful in 33s
Security / workflow-lint (pull_request) Successful in 35s
Reusable / Security / .NET (NuGetAudit) (pull_request) Skipped
Reusable / Security / Secrets (gitleaks) (pull_request) Successful in 27s
Reusable / Security / SAST (Opengrep) (pull_request) Successful in 25s
Reusable / Security / Dependencies (osv-scanner) (pull_request) Successful in 27s
Reusable / Security / Rust (cargo-deny) (pull_request) Successful in 45s
Security / scan (pull_request) Successful in 2m6s
CI / ci-ok (pull_request) Successful in 3s
CI / ci-ok (push) Skipped
Security / workflow-lint (push) Skipped
CI / Linux · fmt, clippy, rules, tests, coverage (pull_request) Successful in 51s
CI / Windows · clippy, tests (pull_request) Successful in 33s
Security / workflow-lint (pull_request) Successful in 35s
Reusable / Security / .NET (NuGetAudit) (pull_request) Skipped
Reusable / Security / Secrets (gitleaks) (pull_request) Successful in 27s
Reusable / Security / SAST (Opengrep) (pull_request) Successful in 25s
Reusable / Security / Dependencies (osv-scanner) (pull_request) Successful in 27s
Reusable / Security / Rust (cargo-deny) (pull_request) Successful in 45s
Security / scan (pull_request) Successful in 2m6s
CI / ci-ok (pull_request) Successful in 3s
The previous commit blamed the missing rust-src, and it was wrong about
the main cause. A Qodana run dispatched on that commit still found the
same 47 problems. It passed only because Qodana Cloud had taken the
first run as the baseline ("UNCHANGED: 47, NEW: 0").
The real cause, reproduced in the cached qodana-rust:2026.3-eap image:
`cargo check` fails on every build script (anyhow, serde_core, zmij)
with "linker `cc` not found". The image is a Docker Hardened Image with
no C toolchain. The linter runs build scripts while it opens the
project, so the project half-loaded and std/serde code read as errors.
qodana.yaml gets a bootstrap that installs build-essential, with the
dhi.io pin that free-steam-games-list needed for the same image. With
it, `cargo check --locked` succeeds in the image.
rust-src stays in rust-toolchain.toml, since the linter and
rust-analyzer resolve std from it; its comment now says only that.
doc 14 §6 and doc 17's S10 notes describe the real cause, and the
baseline that hid it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cfb46da9dc
commit
d18b35cbfd
4 files changed
+34
-8
No files matched your search
@@ -151,7 +151,10 @@ repositories on the forge do.
|
||||
and S10 records the image actually pulled). `qodana.yml` calls the ops
|
||||
`reusable-qodana.yml` with `runs-on: windows-latest`, `within-docker: true` and
|
||||
`-u root -e CARGO_HOME=/data/cache/cargo`, because the Rust linter has no native mode
|
||||
and the Linux image needs Docker Desktop on the runner PC (spike S10). The Qodana Cloud
|
||||
and the Linux image needs Docker Desktop on the runner PC (spike S10). The image has no
|
||||
C linker, and the linter runs build scripts while it opens the project, so `qodana.yaml`
|
||||
has a `bootstrap` that installs `build-essential`. `rust-toolchain.toml` lists
|
||||
`rust-src` so that the linter can resolve std. The Qodana Cloud
|
||||
project's VCS URL points at the GitLab mirror: Qodana Cloud accepts only github.com,
|
||||
gitlab.com and bitbucket.org URLs. If the UI crates cannot be analysed inside the
|
||||
container, the scan is limited to the non-UI crates; if the Docker route does not work
|
||||
|
||||
@@ -62,9 +62,15 @@ S10, first data:
|
||||
- Coverage thresholds are enforced in `ci.yml`; no gated crate exists yet.
|
||||
- `qodana-rust` 2026.3-eap runs through Docker Desktop on the Windows runner, and opening
|
||||
the project took 3 minutes.
|
||||
- Its first run reported 47 false "Critical" problems: the image's Rust 1.100.0, installed
|
||||
from `rust-toolchain.toml`, had no `rust-src`, so the linter could not resolve the
|
||||
standard library. `rust-toolchain.toml` now lists `rust-src`.
|
||||
- Its first run reported 47 false "Critical" problems. The image (a Docker Hardened
|
||||
Image) has no C linker, so every build script failed with "linker `cc` not found" while
|
||||
the linter opened the project, and std and serde code read as errors. `qodana.yaml` now
|
||||
has a bootstrap that installs `build-essential`, using the same `dhi.io` pin as
|
||||
free-steam-games-list. `rust-toolchain.toml` also asks for `rust-src`, which the
|
||||
image's 1.100.0 lacked.
|
||||
- Qodana Cloud took that first run as the project's baseline. The second run passed only
|
||||
because of it: the same 47 problems, all "unchanged". Once the fix is merged they
|
||||
should disappear. If not, reset the baseline in Qodana Cloud.
|
||||
|
||||
Open:
|
||||
- the rest of H-13: `DISCORD_CI_WEBHOOK`, the GitLab mirror, the Qodana Cloud VCS URL,
|
||||
|
||||
+17
@@ -10,6 +10,23 @@ version: "1.0"
|
||||
linter: qodana-rust
|
||||
profile:
|
||||
name: qodana.recommended
|
||||
# The linter runs `cargo check` to execute build scripts and expand proc macros
|
||||
# while it opens the project, and the image (a Docker Hardened Image, Debian)
|
||||
# has no C linker: every build script failed with "linker `cc` not found", the
|
||||
# project half-loaded, and std/serde code read as 47 false "Critical" problems
|
||||
# (first run, 2026-12-02). The bootstrap installs build-essential; it needs root
|
||||
# (the workflow passes `-u root`).
|
||||
#
|
||||
# Why the pin: the image's libraries are installed as `<version>+dhi0`, which
|
||||
# sorts above the `<version>+deb13u0+dhi0` that its own repository dhi.io ships.
|
||||
# apt then reads the -dev packages as downgrades and stops. Pinning dhi.io at
|
||||
# 1001 lets apt take the repository's builds (the same fix as in
|
||||
# free-steam-games-list's web/src-tauri/qodana.yaml). Checked by hand in the
|
||||
# cached image: after this bootstrap, `cargo check --locked` succeeds.
|
||||
bootstrap: |
|
||||
printf 'Package: *\nPin: origin dhi.io\nPin-Priority: 1001\n' > /etc/apt/preferences.d/dhi
|
||||
apt-get update -qq
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --allow-downgrades --no-install-recommends build-essential
|
||||
# No failureConditions: the EAP linter reports, it does not gate (doc 14 §4).
|
||||
# Opening a Cargo project in Docker Desktop on the runner PC can take longer
|
||||
# than the linter's default 10 minutes on a cold cache (seen on
|
||||
|
||||
+4
-4
@@ -2,10 +2,10 @@
|
||||
# with `rustup toolchain install`, the Linux job by passing `channel` to the
|
||||
# toolchain action. Release builds are rebuildable from this pin (doc 15 §11).
|
||||
#
|
||||
# `rust-src` is the standard library's source. Without it, Qodana's Rust linter
|
||||
# (doc 14 §6) cannot resolve std: the qodana-rust image ships it only for its own
|
||||
# default toolchain, and installs 1.100.0 from this file. rust-analyzer needs it
|
||||
# too.
|
||||
# `rust-src` is the standard library's source. Both rust-analyzer and Qodana's
|
||||
# IDE-based Rust linter (doc 14 §6) resolve std from it. The qodana-rust image
|
||||
# ships it only for its own default toolchain, and it installs 1.100.0 from this
|
||||
# file, so the file has to ask for it.
|
||||
[toolchain]
|
||||
channel = "1.100.0"
|
||||
components = ["rustfmt", "clippy", "llvm-tools", "rust-src"]
|
||||
|
||||
Reference in new issue
Block a user