fix: let Qodana build the workspace (C linker bootstrap, rust-src) #2

Merged
poli0981 merged 3 commits from fix/qodana-rust-src into main 2026-12-02 14:38:40 +00:00
6 changed files with 66 additions and 12 deletions

No files matched your search

+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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
+5 -1
View File
@@ -151,7 +151,11 @@ 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`. 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
+34 -8
View File
@@ -47,16 +47,42 @@ 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 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 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;
- 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
+19
View File
@@ -10,6 +10,25 @@ 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. 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 `<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
+6 -1
View File
@@ -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. 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"]
components = ["rustfmt", "clippy", "llvm-tools", "rust-src"]
profile = "minimal"