From cfb46da9dcefc90f64ba0fcb61dcaa1819af8f9f Mon Sep 17 00:00:00 2001 From: poli0981 Date: Wed, 2 Dec 2026 21:07:38 +0700 Subject: [PATCH 1/3] fix: give the pinned toolchain rust-src so Qodana can resolve std Qodana's first run on main reported 47 "Critical" problems, all false: - unresolved methods; - types that "do not implement" Debug or Clone; - format macro errors; - a Cargo project loading error in Cargo.toml. The cause: the qodana-rust 2026.3-eap image ships rust-src only for its own default toolchain (1.94.0). It installs 1.100.0 from rust-toolchain.toml, whose minimal profile has no rust-src, so the linter had no standard-library source. Checked inside the cached image with `rustup component list --installed`. rust-toolchain.toml now lists rust-src, which rust-analyzer needs too, and the Linux CI job installs the same components. The Windows job picks it up through `rustup toolchain install`, which adds missing components. doc 02 records the image the run pulled (2026.3-eap, QDRST-263.7944). doc 17 records the first S10 data. Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/ci.yml | 2 +- docs/02_TECH_STACK.md | 2 +- docs/17_SPIKES_ROADMAP.md | 30 ++++++++++++++++++++++-------- rust-toolchain.toml | 7 ++++++- 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 131ba22..70e6e14 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -74,7 +74,7 @@ jobs: uses: dtolnay/rust-toolchain@df2a88e9fe4098bad09cb42c3dec7187f15861fc # master with: toolchain: ${{ steps.toolchain.outputs.channel }} - components: rustfmt, clippy, llvm-tools + components: rustfmt, clippy, llvm-tools, rust-src # Build scripts need a C linker. The job container runs as root; sudo only # where there is one. diff --git a/docs/02_TECH_STACK.md b/docs/02_TECH_STACK.md index bd92921..da26a9e 100644 --- a/docs/02_TECH_STACK.md +++ b/docs/02_TECH_STACK.md @@ -156,7 +156,7 @@ no UI framework, no schema library. Every package above is a dev dependency. | GitLab | Free | Read-only push mirror of the source | | Cloudflare R2 (`releases.poli0981.dev`) | Existing bucket | Installers and the update feed | | Renovate, self-hosted | — | Dependency-update pull requests and OSV vulnerability alerts, from the central preset `poli0981/renovate-config` | -| Qodana | Ultimate (existing) | `qodana-rust` linter (EAP). `qodana.yaml` names the linter, and the image release follows the Qodana CLI that the ops `reusable-qodana.yml` pins (2026.3.1 at ops v2026.11.5); S10 records the image actually pulled | +| Qodana | Ultimate (existing) | `qodana-rust` linter (EAP). `qodana.yaml` names the linter, and the image release follows the Qodana CLI that the ops `reusable-qodana.yml` pins. With CLI 2026.3.1 (ops v2026.11.5) the image is `jetbrains/qodana-rust:2026.3-eap`, build QDRST-263.7944, first run 2026-12-02 (S10) | | gitleaks, Opengrep, osv-scanner, cargo-deny | Open source | Secrets, static analysis and dependency checks, run by the ops `security.yml` | ## 6. Deviations from the maintainer's usual conventions diff --git a/docs/17_SPIKES_ROADMAP.md b/docs/17_SPIKES_ROADMAP.md index 3b94e77..9954c40 100644 --- a/docs/17_SPIKES_ROADMAP.md +++ b/docs/17_SPIKES_ROADMAP.md @@ -47,16 +47,30 @@ the maintainer's own desktop (doc 15 §4.4). Order within v1.x is by user demand; the native passkey provider and the Hello slot are expected first. -**M0 progress (2026-12-02).** Done locally: -- the documentation suite moved to the repository root (`main`, first commit); -- on `chore/ci-bootstrap`: a Cargo workspace with `xtask` as its only member, and - `ci.yml`, `security.yml`, `qodana.yml`, `notify-ci-failure.yml` and `renovate.json` - (D-29). +**M0 progress (2026-12-02).** + +Done: +- The bootstrap is merged on Gitea (#1): the docs suite at the root, a Cargo workspace + with `xtask` as its only member, the four M0 workflows and Renovate (D-29). Every + required check passed on the pull request. +- Bootstrap steps the maintainer has done: branch protection with the required checks of + doc 15 §4.2, Actions enabled, `QODANA_TOKEN`. + +S10, first data: +- The ops `security.yml` (gitleaks, Opengrep, osv-scanner, cargo-deny) is green on the + workspace. +- 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`. Open: -- the maintainer's bootstrap steps (H-13); -- CI's first green run on Gitea, which is the M0 exit criterion and the start of S10; -- spikes S1–S5, in the order of D-29. +- the rest of H-13: `DISCORD_CI_WEBHOOK`, the GitLab mirror, the Qodana Cloud VCS URL, + and `renovate-bot` as a collaborator; +- Qodana's result after the `rust-src` fix (S10); +- spikes S1–S5, in the order of D-29; S1 has started. ## 4. Feature gates that depend on spikes diff --git a/rust-toolchain.toml b/rust-toolchain.toml index df3054c..6bb51a8 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,7 +1,12 @@ # The one place the Rust version lives (doc 02 §1). CI reads it: the Windows job # 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. [toolchain] channel = "1.100.0" -components = ["rustfmt", "clippy", "llvm-tools"] +components = ["rustfmt", "clippy", "llvm-tools", "rust-src"] profile = "minimal" -- 2.54.1 From d18b35cbfda816de8e8831f1f9f0c9e45bc28985 Mon Sep 17 00:00:00 2001 From: poli0981 Date: Wed, 2 Dec 2026 21:22:01 +0700 Subject: [PATCH 2/3] fix: install a C linker in Qodana's image so build scripts run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- docs/14_TESTING_QUALITY.md | 5 ++++- docs/17_SPIKES_ROADMAP.md | 12 +++++++++--- qodana.yaml | 17 +++++++++++++++++ rust-toolchain.toml | 8 ++++---- 4 files changed, 34 insertions(+), 8 deletions(-) diff --git a/docs/14_TESTING_QUALITY.md b/docs/14_TESTING_QUALITY.md index 8733743..08b7330 100644 --- a/docs/14_TESTING_QUALITY.md +++ b/docs/14_TESTING_QUALITY.md @@ -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 diff --git a/docs/17_SPIKES_ROADMAP.md b/docs/17_SPIKES_ROADMAP.md index 9954c40..ed2fa5f 100644 --- a/docs/17_SPIKES_ROADMAP.md +++ b/docs/17_SPIKES_ROADMAP.md @@ -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, diff --git a/qodana.yaml b/qodana.yaml index 6a37bd5..cbbf507 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -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 `+dhi0`, which +# sorts above the `+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 diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 6bb51a8..cb0dee0 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -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"] -- 2.54.1 From 4e46328fa2cd79e73720cabea6b96f3070952c19 Mon Sep 17 00:00:00 2001 From: poli0981 Date: Wed, 2 Dec 2026 21:35:18 +0700 Subject: [PATCH 3/3] docs: say what the Qodana runs proved and what is still open MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A Qodana run with the C-linker bootstrap (d18b35c) showed two things. The bootstrap fixes one cause: the sanity check's "Cargo project loading" error is gone. It leaves the 47 false type errors in xtask unchanged. The report preview explains those 47. projectStructure/SDKs.json is {"roots": []}: the IDE attached no Rust standard library, so u64 and usize have no traits. Adding rust-src did not change that. The comments in qodana.yaml and rust-toolchain.toml, and doc 14 §6 and doc 17's S10 notes, no longer claim more than the runs showed: - fixed: the linker; - open: attaching std (next idea: `rustup toolchain install` in the bootstrap); - the Qodana Cloud baseline: it is why the later runs pass, and it gets reset once std is attached. Co-Authored-By: Claude Opus 5.5 --- docs/14_TESTING_QUALITY.md | 5 +++-- docs/17_SPIKES_ROADMAP.md | 26 ++++++++++++++++---------- qodana.yaml | 10 ++++++---- rust-toolchain.toml | 8 ++++---- 4 files changed, 29 insertions(+), 20 deletions(-) diff --git a/docs/14_TESTING_QUALITY.md b/docs/14_TESTING_QUALITY.md index 08b7330..50896e2 100644 --- a/docs/14_TESTING_QUALITY.md +++ b/docs/14_TESTING_QUALITY.md @@ -153,8 +153,9 @@ and S10 records the image actually pulled). `qodana.yml` calls the ops `-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 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 +has a `bootstrap` that installs `build-essential`. As of 2026-12-02 the linter still +attaches no Rust standard library inside the container, and reports false type errors +until S10 solves that. 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 diff --git a/docs/17_SPIKES_ROADMAP.md b/docs/17_SPIKES_ROADMAP.md index ed2fa5f..df4ce8a 100644 --- a/docs/17_SPIKES_ROADMAP.md +++ b/docs/17_SPIKES_ROADMAP.md @@ -62,20 +62,26 @@ 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 (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. +- Its first run reported 47 false "Critical" problems in `xtask`: `u64` "does not + implement" `PartialEq`, `usize` has no `Display`, and so on. Two causes were found: + 1. The image (a Docker Hardened Image) has no C linker. Every build script failed with + "linker `cc` not found", and the sanity check reported "Cargo project loading". + **Fixed:** `qodana.yaml` now has a bootstrap that installs `build-essential`, using + the same `dhi.io` pin as free-steam-games-list. The loading error is gone. + 2. The IDE attaches no Rust standard library: the report's + `projectStructure/SDKs.json` is `{"roots": []}`. Adding `rust-src` to + `rust-toolchain.toml` (which the image's 1.100.0 lacked) did not change that. + **Open.** A likely next step is to install the pinned toolchain in the bootstrap + (`rustup toolchain install`) before the IDE opens the project. +- Qodana Cloud took the first run as the project's baseline. Later runs pass because the + same 47 problems are "unchanged", not because they are gone. Once cause 2 is fixed, + reset the baseline in Qodana Cloud. Open: - the rest of H-13: `DISCORD_CI_WEBHOOK`, the GitLab mirror, the Qodana Cloud VCS URL, and `renovate-bot` as a collaborator; -- Qodana's result after the `rust-src` fix (S10); +- getting the standard library attached in Qodana's container, then resetting its + baseline (S10); - spikes S1–S5, in the order of D-29; S1 has started. ## 4. Feature gates that depend on spikes diff --git a/qodana.yaml b/qodana.yaml index cbbf507..8e495a3 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -12,10 +12,12 @@ 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`). +# has no C linker. Without this bootstrap, every build script failed with +# "linker `cc` not found" and the sanity check reported "Cargo project loading" +# (2026-12-02). The bootstrap installs build-essential; it needs root (the +# workflow passes `-u root`). It does not fix the 47 false type errors in +# xtask: those come from the IDE attaching no Rust standard library (its +# projectStructure/SDKs.json has `"roots": []`), still open in spike S10. # # Why the pin: the image's libraries are installed as `+dhi0`, which # sorts above the `+deb13u0+dhi0` that its own repository dhi.io ships. diff --git a/rust-toolchain.toml b/rust-toolchain.toml index cb0dee0..4b9ad60 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -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. 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. +# `rust-src` is the standard library's source. rust-analyzer needs it to resolve +# std. The JetBrains engine behind Qodana's Rust linter reads it too. The +# qodana-rust image ships it only for its own default toolchain, and it installs +# 1.100.0 from this file. [toolchain] channel = "1.100.0" components = ["rustfmt", "clippy", "llvm-tools", "rust-src"] -- 2.54.1