Skip to content

Implement toolchain resolution in rust-build-release and Cranelift LLVM override in generate-coverage#254

Merged
leynos merged 18 commits intomainfrom
use-toolchain-rust-in-rust-build-release
Apr 17, 2026
Merged

Implement toolchain resolution in rust-build-release and Cranelift LLVM override in generate-coverage#254
leynos merged 18 commits intomainfrom
use-toolchain-rust-in-rust-build-release

Conversation

@leynos
Copy link
Copy Markdown
Owner

@leynos leynos commented Apr 16, 2026

Summary by Sourcery

Resolve Rust toolchains from the target repository for the rust-build-release action and switch Cranelift coverage handling in the generate-coverage action to use environment-based LLVM codegen overrides.

New Features:

  • Allow the rust-build-release action to accept an explicit toolchain input and resolve the effective toolchain from rust-toolchain files or Cargo manifest rust-version before falling back to the default.
  • Add cargo coverage environment detection so generate-coverage uses LLVM codegen via environment variables when a project is configured for Cranelift.

Bug Fixes:

  • Ensure coverage runs correctly propagate LLVM codegen settings to child cargo invocations in Cranelift-configured projects.
  • Support matching installed Rust toolchains that use dotted channel prefixes in rust-build-release toolchain resolution.

Enhancements:

  • Refine rust-build-release main toolchain handling so repository configuration is respected when determining the build toolchain and manifest path.
  • Extend the action_setup CLI to share the new toolchain resolution logic used by rust-build-release.
  • Improve tests and fixtures to cover Cranelift projects, toolchain resolution precedence, and action input wiring for both actions.

Documentation:

  • Document toolchain resolution order and new toolchain input in the rust-build-release README.
  • Document Cranelift handling and LLVM codegen environment overrides in the generate-coverage README.

Tests:

  • Add fixtures and tests for nightly Cranelift projects and repository toolchain resolution.
  • Expand coverage tests to validate environment-based LLVM codegen overrides and cargo invocation behavior in generate-coverage.
  • Add tests ensuring rust-build-release action inputs and CLI wiring pass toolchain and manifest-path correctly through the workflow.

leynos added 2 commits April 17, 2026 00:08
Export `CARGO_PROFILE_DEV_CODEGEN_BACKEND=llvm` and
`CARGO_PROFILE_TEST_CODEGEN_BACKEND=llvm` for Cranelift-configured
projects so `cargo llvm-cov` child cargo processes inherit the LLVM
backend.

Remove the outer `cargo --config ... codegen-backend=\"llvm\"`
workaround, add fixture-backed regression coverage, and document the
behaviour in the action changelog and README.
Add repository-aware toolchain resolution for `rust-build-release` so the
composite action prefers an explicit `toolchain` input, then repo
`rust-toolchain.toml` or `rust-toolchain`, then manifest `rust-version`,
and only falls back to the bundled `TOOLCHAIN_VERSION`.

Pass the resolved toolchain through the action setup step using the target
`project-dir`, add nightly-plus-Cranelift fixture coverage, and keep the
explicit override path from forcing an early manifest lookup.
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Apr 16, 2026

Reviewer's Guide

Extends the rust-build-release and generate-coverage GitHub Actions to resolve Rust toolchains from the target repository (toolchain override, rust-toolchain*, Cargo.toml rust-version, then bundled default) and to handle Cranelift projects by forcing LLVM codegen via cargo environment variables instead of --config flags, updating CLIs, action.yml, main logic, and tests/fixtures accordingly.

Flow diagram for resolving requested Rust toolchain

flowchart TD
    Start((Start)) --> CheckExplicit

    CheckExplicit{"Explicit toolchain<br/>input provided?"}
    CheckExplicit -->|Yes| UseExplicit
    CheckExplicit -->|No| ResolveRepoToolchain

    UseExplicit["Use trimmed explicit<br/>toolchain input"] --> End

    ResolveRepoToolchain{"rust-toolchain.toml or<br/>rust-toolchain found and<br/>parseable in search dirs?"}
    ResolveRepoToolchain -->|Yes| UseRepoToolchain
    ResolveRepoToolchain -->|No| CheckManifestRustVersion

    UseRepoToolchain["Use channel from<br/>nearest rust-toolchain*<br/>file"] --> End

    CheckManifestRustVersion{"Cargo manifest or workspace<br/>declares rust-version?"}
    CheckManifestRustVersion -->|Yes| UseManifestRustVersion
    CheckManifestRustVersion -->|No| UseFallback

    UseManifestRustVersion["Use rust-version from<br/>package or workspace.package"] --> End

    UseFallback["Use bundled fallback<br/>default toolchain"] --> End

    End(("Resolved<br/>toolchain"))
Loading

Flow diagram for coverage command env and Cranelift handling

flowchart TD
    Start((Start coverage
    workflow)) --> DetectCranelift

    DetectCranelift["_uses_cranelift_backend:
    inspect .cargo/config.toml
    for Cranelift settings"]

    DetectCranelift -->|Cranelift enabled| SetEnv
    DetectCranelift -->|Cranelift not enabled| NoExtraEnv

    SetEnv["get_cargo_coverage_env:
    return { CARGO_PROFILE_DEV_CODEGEN_BACKEND=llvm,
             CARGO_PROFILE_TEST_CODEGEN_BACKEND=llvm }"] --> BuildArgs

    NoExtraEnv["get_cargo_coverage_env:
    return {}"] --> BuildArgs

    BuildArgs["get_cargo_coverage_cmd:
    construct ['llvm-cov', 'nextest'? ...]
    (no --config profile.*.codegen-backend overrides)"] --> RunMainCargo

    RunMainCargo["_run_cargo(args, extra_env):
    - prefix command echo with KEY=VALUE
    - run cargo with extra_env merged
      into environment"] --> OptionalCucumber

    OptionalCucumber{"with_cucumber_rs
    enabled and features set?"}
    OptionalCucumber -->|No| End

    OptionalCucumber -->|Yes| RunCucumber

    RunCucumber["run_cucumber_rs_coverage:
    - build cucumber.rs args
    - call _run_cargo(c_args, extra_env)"] --> End

    End((Coverage
    complete))
Loading

File-Level Changes

Change Details Files
Add reusable helpers to resolve a requested Rust toolchain from repo files and manifest MSRV with precedence over the action default.
  • Introduce helpers to resolve manifest paths relative to project-dir and to trim optional strings.
  • Implement parsing of rust-toolchain.toml/rust-toolchain files supporting TOML and plain-text formats, walking up from the manifest to repo root.
  • Implement reading of rust-version from both [package] and [workspace.package] in Cargo.toml.
  • Expose resolve_requested_toolchain that chooses explicit input, repo toolchain, manifest rust-version, or a provided fallback in that order.
.github/actions/rust-build-release/src/toolchain.py
Use repository-aware toolchain resolution in the rust-build-release main entrypoint and CLI, and thread manifest path correctly.
  • Allow main()'s toolchain option to be an override with empty default and, when blank, resolve the toolchain using resolve_requested_toolchain based on cwd and manifest-path.
  • Preserve the resolved manifest path for later build command construction instead of re-resolving, so the same manifest is used for toolchain lookup and cargo.
  • Extend toolchain name resolution helpers to also match dotted toolchain prefixes (e.g., nightly.2026-03-26) when picking installed toolchains or fallbacks.
  • Update action_setup.toolchain CLI to accept --toolchain and --manifest-path, delegating to resolve_requested_toolchain instead of read_default_toolchain.
/.github/actions/rust-build-release/src/main.py
.github/actions/rust-build-release/src/action_setup.py
Extend the rust-build-release composite action interface to support an explicit toolchain input and to run toolchain resolution in the project directory.
  • Add a toolchain input with empty default and descriptive help to action.yml and README table, plus example usage.
  • Ensure the Determine toolchain step runs in inputs.project-dir and forwards both toolchain and manifest-path to action_setup.py.
  • Add tests to assert manifest inputs include toolchain, that env wiring is correct, and that CLI/toolchain resolution prefers repo-declared toolchains.
  • Document new toolchain resolution order and behavior in the CHANGELOG.
.github/actions/rust-build-release/action.yml
.github/actions/rust-build-release/README.md
.github/actions/rust-build-release/CHANGELOG.md
.github/actions/rust-build-release/tests/test_manifest_input_step.py
.github/actions/rust-build-release/tests/test_action_setup.py
.github/actions/rust-build-release/tests/test_manifest_path.py
Switch Rust coverage handling for Cranelift projects from cargo --config overrides to environment-based LLVM codegen overrides, and propagate env into all cargo invocations.
  • Replace the _LLVM_CODEGEN_OVERRIDE argv prefix with an _LLVM_CODEGEN_ENV dict that sets CARGO_PROFILE_DEV_CODEGEN_BACKEND and CARGO_PROFILE_TEST_CODEGEN_BACKEND to llvm.
  • Introduce get_cargo_coverage_env(manifest_path) to return LLVM env overrides when the project uses Cranelift, otherwise an empty dict.
  • Extend _run_cargo to accept extra_env, echo env assignments in the log line, and spawn cargo with the augmented environment.
  • Plumb extra_env from main via get_cargo_coverage_env into both the primary coverage run and run_cucumber_rs_coverage so all cargo subprocesses honor LLVM backend.
  • Update coverage tests to assert env behavior instead of argv --config flags and to validate get_cargo_coverage_env on Cranelift and non-Cranelift fixtures, plus document behavior in the CHANGELOG and README.
.github/actions/generate-coverage/scripts/run_rust.py
.github/actions/generate-coverage/tests/test_scripts.py
.github/actions/generate-coverage/CHANGELOG.md
.github/actions/generate-coverage/README.md
Add shared nightly Cranelift project fixtures for both actions and use them in tests.
  • Create nightly-cranelift-project fixture with .cargo/config.toml enabling Cranelift, Cargo.toml declaring rust-version=1.88, and rust-toolchain.toml pinning nightly-2026-03-26 for both generate-coverage and rust-build-release test suites.
  • Wire fixture paths into tests for toolchain resolution, manifest rust-version reading, coverage env detection, and main/toolchain precedence behaviors.
.github/actions/generate-coverage/tests/fixtures/nightly-cranelift-project/.cargo/config.toml
.github/actions/generate-coverage/tests/fixtures/nightly-cranelift-project/Cargo.toml
.github/actions/generate-coverage/tests/fixtures/nightly-cranelift-project/rust-toolchain.toml
.github/actions/rust-build-release/tests/fixtures/nightly-cranelift-project/.cargo/config.toml
.github/actions/rust-build-release/tests/fixtures/nightly-cranelift-project/Cargo.toml
.github/actions/rust-build-release/tests/fixtures/nightly-cranelift-project/rust-toolchain.toml
.github/actions/rust-build-release/tests/test_toolchain_helpers.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 16, 2026

Note

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Extended two GitHub Actions with Rust toolchain resolution capabilities. The generate-coverage action now overrides Cranelift via environment variables instead of cargo arguments. The rust-build-release action adds explicit toolchain override input and implements precedence-based toolchain resolution checking the override, repo-declared files, manifest rust-version, and fallback.

Changes

Cohort / File(s) Summary
Coverage Action Documentation
.github/actions/generate-coverage/CHANGELOG.md, .github/actions/generate-coverage/README.md
Documented environment variable overrides (CARGO_PROFILE_DEV_CODEGEN_BACKEND, CARGO_PROFILE_TEST_CODEGEN_BACKEND) for Cranelift-to-LLVM coverage fallback and removed cargo --config workaround from documentation.
Coverage Action Implementation
.github/actions/generate-coverage/scripts/run_rust.py
Refactored to replace cargo --config argument injection with environment variable overrides via new get_cargo_coverage_env() function. Updated _run_cargo() and run_cucumber_rs_coverage() to accept and forward extra_env parameter.
Coverage Action Test Fixtures
.github/actions/generate-coverage/tests/fixtures/nightly-cranelift-project/.../...
Added new nightly Cranelift test fixture project with rust-toolchain.toml (pinned to nightly-2026-03-26), Cargo.toml (edition 2024, rust-version 1.88), and .cargo/config.toml (Cranelift backend configuration).
Coverage Action Tests
.github/actions/generate-coverage/tests/test_scripts.py
Updated to verify environment variable overrides replace cargo arguments. Added tests for get_cargo_coverage_env() and modified Cranelift coverage test to use fixture project instead of inline configuration.
Build Action Documentation
.github/actions/rust-build-release/CHANGELOG.md, .github/actions/rust-build-release/README.md, .github/actions/rust-build-release/action.yml
Documented new toolchain composite action input and deterministic resolution order: explicit override → rust-toolchain.toml/rust-toolchain → manifest rust-version → fallback. Updated "Determine toolchain" step to use project-dir working directory.
Build Action Toolchain Resolution
.github/actions/rust-build-release/src/action_setup.py, .github/actions/rust-build-release/src/toolchain.py
Added resolve_requested_toolchain() function with precedence-based resolution. Extended toolchain CLI command to accept --toolchain override and --manifest-path. Introduced TOML parsing utilities: read_repo_toolchain(), read_manifest_rust_version(), _parse_toolchain_file().
Build Action Main Logic
.github/actions/rust-build-release/src/main.py
Refactored toolchain resolution to use explicit override (empty string default) before calling resolve_requested_toolchain() with manifest context. Updated _resolve_toolchain_name() and _fallback_toolchain_name() to match dot-prefixed toolchain variants.
Build Action Test Fixtures
.github/actions/rust-build-release/tests/fixtures/nightly-cranelift-project/.../...
Added nightly Cranelift fixture matching coverage action fixture with identical structure: rust-toolchain.toml, Cargo.toml, and .cargo/config.toml.
Build Action Tests
.github/actions/rust-build-release/tests/test_action_setup.py, .github/actions/rust-build-release/tests/test_manifest_input_step.py, .github/actions/rust-build-release/tests/test_manifest_path.py, .github/actions/rust-build-release/tests/test_toolchain_helpers.py
Added comprehensive test coverage for toolchain resolution precedence, manifest input wiring, action.yml input declaration, and repo-declared toolchain preference. Introduced fixture constants and filesystem-based resolution tests.

Poem

🛠️ Toolchains now cascade in order,
Override rules the border,
Cranelift yields to LLVM's might,
Fixtures test the nightly flight,
Resolution flows just right! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Testing ⚠️ Warning The pull request implements new functionality with unit tests but fails to address critical review feedback, including missing Cargo.toml scanning in _uses_cranelift_backend(), absent stop_at parameter in _iter_toolchain_search_dirs(), unguarded fallback TOML parsing, and incomplete test coverage. Extend _uses_cranelift_backend() to parse Cargo.toml and scan profile sections, implement stop_at parameter in _iter_toolchain_search_dirs(), restrict fallback parsing to rust-toolchain files, refactor startswith() calls, and add comprehensive tests for all identified gaps.
User-Facing Documentation ⚠️ Warning Documentation fails to disclose that Cranelift detection only checks .cargo/config.toml and .cargo/config files, missing Cargo.toml profile-level codegen-backend declarations. Update the README to explicitly state Cranelift must be declared in .cargo/config.toml or .cargo/config files, or extend _uses_cranelift_backend() to parse Cargo.toml profile sections and add test coverage.
Developer Documentation ⚠️ Warning Pull request introduces significant internal API changes without corresponding developer documentation; new toolchain resolution functions, environment-variable overrides, and refactored signatures lack explanatory guides. Add developer documentation file explicitly detailing toolchain resolution precedence, architectural shifts to environment-variable overrides, helper function purposes, modified _run_cargo() signature handling, and maintenance guidance for internal APIs.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description is comprehensive and directly related to the changeset, covering toolchain resolution, Cranelift handling, new features, bug fixes, and testing enhancements across both actions.
Docstring Coverage ✅ Passed Docstring coverage is 92.00% which is sufficient. The required threshold is 80.00%.
Module-Level Documentation ✅ Passed All nine Python modules modified in this pull request carry comprehensive module-level docstrings clearly explaining their purpose and utility.
Title check ✅ Passed Title accurately describes the dual objectives: implementing toolchain resolution in rust-build-release and adding Cranelift LLVM override in generate-coverage, matching the changeset scope.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch use-toolchain-rust-in-rust-build-release

Comment @coderabbitai help to get the list of available commands and usage tips.

codescene-delta-analysis[bot]

This comment was marked as outdated.

sourcery-ai[bot]

This comment was marked as resolved.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b857f546d1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/actions/rust-build-release/src/action_setup.py Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/actions/generate-coverage/scripts/run_rust.py:
- Around line 160-164: The _uses_cranelift_backend helper currently only checks
.cargo/config(.toml) so update _uses_cranelift_backend(manifest_path: Path) to
also open and parse the project Cargo.toml (manifest_path) and inspect
[profile.dev] and [profile.test] for a codegen-backend = "cranelift" entry
(handle TOML booleans/strings and whitespace/casing), returning True if found so
get_cargo_coverage_env() will return the LLVM override; add a unit test that
creates a manifest-only project with codegen-backend set under [profile.dev] or
[profile.test] and asserts the helper detects cranelift (and that
get_cargo_coverage_env() yields the expected env override).

In @.github/actions/rust-build-release/src/main.py:
- Around line 299-314: The function _fallback_toolchain_name repeats startswith
checks; simplify by replacing the two separate startswith checks with a single
startswith call that accepts a tuple (channel_prefix, dotted_prefix) to reduce
duplication while keeping the same matching logic for names in installed_names
and preserving the exact behavior for the equality check (name == toolchain) and
the generator expression returned by next.
- Around line 215-222: The loop checking installed_names uses two separate
startswith calls; simplify the condition by combining them into a single tuple
startswith check: keep the equality check (name == toolchain) and replace
"name.startswith(channel_prefix) or name.startswith(dotted_prefix)" with
"name.startswith((channel_prefix, dotted_prefix))" so the if becomes "if (name
== toolchain or name.startswith((channel_prefix, dotted_prefix))): return name";
update the block around dotted_prefix, installed_names, channel_prefix
accordingly.

In @.github/actions/rust-build-release/src/toolchain.py:
- Around line 46-53: The fallback that treats any malformed TOML as a legacy
channel string is too permissive; in _parse_toolchain_file, when
tomllib.TOMLDecodeError is caught, first check the Path object's filename
(path.name) and return None unless it equals "rust-toolchain" so only legacy
non-TOML rust-toolchain files are parsed line-by-line for a channel; otherwise
skip the fallback and return None.
- Around line 62-82: The toolchain search can climb above the checked-out
project root and pick up unrelated parent rust-toolchain files; update
_iter_toolchain_search_dirs to accept a stop_at Path (repo_root), resolve both
start and stop_at, return immediately if start is not inside repo_root, and stop
traversal when search_dir == repo_root or when a .git directory is found; then
update read_repo_toolchain to call
_iter_toolchain_search_dirs(resolved_manifest.parent, project_dir) so discovery
is bounded to the repo root.

In @.github/actions/rust-build-release/tests/test_manifest_path.py:
- Around line 315-317: The test stub function fake_cargo has an unused parameter
named target_arg which triggers ARG001; rename target_arg to _target_arg in the
fake_cargo signature to mark it as intentionally unused (update the parameter
name in the def fake_cargo(_spec: str, _target_arg: str, manifest_arg: Path,
features_arg: str) declaration and any local references if present) to silence
Ruff.
- Around line 300-324: The test test_main_prefers_repo_declared_toolchain relies
on ambient RBR_MANIFEST_PATH; before changing directory and invoking
main_module.main("aarch64-unknown-linux-gnu") clear that env var so the test
uses NIGHTLY_CRANELIFT_PROJECT/Cargo.toml: add
monkeypatch.delenv("RBR_MANIFEST_PATH", raising=False) near the top of the test
(before monkeypatch.chdir(NIGHTLY_CRANELIFT_PROJECT)) so _resolve_manifest in
main_module.main cannot pick up an external manifest.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 720cdf54-390b-4b57-bf5b-6b522c579d5d

📥 Commits

Reviewing files that changed from the base of the PR and between 684e8da and b857f54.

📒 Files selected for processing (20)
  • .github/actions/generate-coverage/CHANGELOG.md
  • .github/actions/generate-coverage/README.md
  • .github/actions/generate-coverage/scripts/run_rust.py
  • .github/actions/generate-coverage/tests/fixtures/nightly-cranelift-project/.cargo/config.toml
  • .github/actions/generate-coverage/tests/fixtures/nightly-cranelift-project/Cargo.toml
  • .github/actions/generate-coverage/tests/fixtures/nightly-cranelift-project/rust-toolchain.toml
  • .github/actions/generate-coverage/tests/test_scripts.py
  • .github/actions/rust-build-release/CHANGELOG.md
  • .github/actions/rust-build-release/README.md
  • .github/actions/rust-build-release/action.yml
  • .github/actions/rust-build-release/src/action_setup.py
  • .github/actions/rust-build-release/src/main.py
  • .github/actions/rust-build-release/src/toolchain.py
  • .github/actions/rust-build-release/tests/fixtures/nightly-cranelift-project/.cargo/config.toml
  • .github/actions/rust-build-release/tests/fixtures/nightly-cranelift-project/Cargo.toml
  • .github/actions/rust-build-release/tests/fixtures/nightly-cranelift-project/rust-toolchain.toml
  • .github/actions/rust-build-release/tests/test_action_setup.py
  • .github/actions/rust-build-release/tests/test_manifest_input_step.py
  • .github/actions/rust-build-release/tests/test_manifest_path.py
  • .github/actions/rust-build-release/tests/test_toolchain_helpers.py

Comment thread .github/actions/generate-coverage/scripts/run_rust.py
Comment thread .github/actions/rust-build-release/src/main.py Outdated
Comment thread .github/actions/rust-build-release/src/main.py
Comment thread .github/actions/rust-build-release/src/toolchain.py
Comment thread .github/actions/rust-build-release/src/toolchain.py Outdated
Comment thread .github/actions/rust-build-release/tests/test_manifest_path.py Outdated
Comment thread .github/actions/rust-build-release/tests/test_manifest_path.py
@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 16, 2026

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response.

Bumpy Road Ahead

.github/actions/rust-build-release/src/toolchain.py: read_manifest_rust_version

What lead to degradation?

read_manifest_rust_version has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is 2 blocks per function

Why does this problem occur?

A Bumpy Road is a function that contains multiple chunks of nested conditional logic inside the same function. The deeper the nesting and the more bumps, the lower the code health.
A bumpy code road represents a lack of encapsulation which becomes an obstacle to comprehension. In imperative languages there’s also an increased risk for feature entanglement, which leads to complex state management. CodeScene considers the following rules for the code health impact: 1) The deeper the nested conditional logic of each bump, the higher the tax on our working memory. 2) The more bumps inside a function, the more expensive it is to refactor as each bump represents a missing abstraction. 3) The larger each bump – that is, the more lines of code it spans – the harder it is to build up a mental model of the function. The nesting depth for what is considered a bump is levels of conditionals.

How to fix it?

Bumpy Road implementations indicate a lack of encapsulation. Check out the detailed description of the Bumpy Road code health issue.
A Bumpy Road often suggests that the function/method does too many things. The first refactoring step is to identify the different possible responsibilities of the function. Consider extracting those responsibilities into smaller, cohesive, and well-named functions. The EXTRACT FUNCTION refactoring is the primary response.

@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 16, 2026

@coderabbitai pause

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 16, 2026

✅ Actions performed

Reviews paused.

@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 16, 2026

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response.

Bumpy Road Ahead

.github/actions/rust-build-release/src/toolchain.py: _parse_toolchain_file

What lead to degradation?

_parse_toolchain_file has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is 2 blocks per function

Why does this problem occur?

A Bumpy Road is a function that contains multiple chunks of nested conditional logic inside the same function. The deeper the nesting and the more bumps, the lower the code health.
A bumpy code road represents a lack of encapsulation which becomes an obstacle to comprehension. In imperative languages there’s also an increased risk for feature entanglement, which leads to complex state management. CodeScene considers the following rules for the code health impact: 1) The deeper the nested conditional logic of each bump, the higher the tax on our working memory. 2) The more bumps inside a function, the more expensive it is to refactor as each bump represents a missing abstraction. 3) The larger each bump – that is, the more lines of code it spans – the harder it is to build up a mental model of the function. The nesting depth for what is considered a bump is levels of conditionals.

How to fix it?

Bumpy Road implementations indicate a lack of encapsulation. Check out the detailed description of the Bumpy Road code health issue.
A Bumpy Road often suggests that the function/method does too many things. The first refactoring step is to identify the different possible responsibilities of the function. Consider extracting those responsibilities into smaller, cohesive, and well-named functions. The EXTRACT FUNCTION refactoring is the primary response.

@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 16, 2026

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response.

Complex Conditional

.github/actions/rust-build-release/src/main.py: _resolve_toolchain_name

What lead to degradation?

_resolve_toolchain_name has 1 complex conditionals with 2 branches, threshold = 2

Why does this problem occur?

A complex conditional is an expression inside a branch such as an if-statmeent which consists of multiple, logical operations. Example: if (x.started() && y.running()).Complex conditionals make the code even harder to read, and contribute to the Complex Method code smell. Encapsulate them.

How to fix it?

Apply the DECOMPOSE CONDITIONAL refactoring so that the complex conditional is encapsulated in a separate function with a good name that captures the business rule. Optionally, for simple expressions, introduce a new variable which holds the result of the complex conditional.

Helpful refactoring examples

To get a general understanding of what this code health issue looks like - and how it might be addressed - we have prepared some diffs for illustrative purposes.

SAMPLE

# complex_conditional.js
 function messageReceived(message, timeReceived) {
-   // Ignore all messages which aren't from known customers:
-   if (!message.sender &&
-       customers.getId(message.name) == null) {
+   // Refactoring #1: encapsulate the business rule in a
+   // function. A clear name replaces the need for the comment:
+   if (!knownCustomer(message)) {
      log('spam received -- ignoring');
      return;
    }
 
-  // Provide an auto-reply when outside business hours:
-  if ((timeReceived.getHours() > 17) ||
-      (timeReceived.getHours() < 8)) {
+  // Refactoring #2: encapsulate the business rule.
+  // Again, note how a clear function name replaces the
+  // need for a code comment:
+  if (outsideBusinessHours(timeReceived)) {
     return autoReplyTo(message);
   }
 
   pingAgentFor(message);
+}
+
+function outsideBusinessHours(timeReceived) {
+  // Refactoring #3: replace magic numbers with
+  // symbols that communicate with the code reader:
+  const closingHour = 17;
+  const openingHour = 8;
+
+  const hours = timeReceived.getHours();
+
+  // Refactoring #4: simple conditional rules can
+  // be further clarified by introducing a variable:
+  const afterClosing = hours > closingHour;
+  const beforeOpening = hours < openingHour;
+
+  // Yeah -- look how clear the business rule is now!
+  return afterClosing || beforeOpening;
 }

@coderabbitai

This comment was marked as resolved.

@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 16, 2026

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response.

Complex Method

.github/actions/generate-coverage/scripts/run_rust.py: _run_cargo

What lead to degradation?

_run_cargo increases in cyclomatic complexity from 11 to 13, threshold = 9

Why does this problem occur?

A Complex Method has a high cyclomatic complexity. The recommended threshold for the Python language is a cyclomatic complexity lower than 9.

How to fix it?

There are many reasons for Complex Method. Sometimes, another design approach is beneficial such as a) modeling state using an explicit state machine rather than conditionals, or b) using table lookup rather than long chains of logic. In other scenarios, the function can be split using EXTRACT FUNCTION. Just make sure you extract natural and cohesive functions. Complex Methods can also be addressed by identifying complex conditional expressions and then using the DECOMPOSE CONDITIONAL refactoring.

Helpful refactoring examples

To get a general understanding of what this code health issue looks like - and how it might be addressed - we have prepared some diffs for illustrative purposes.

SAMPLE

# complex_method.js
 function postItem(item) {
   if (!item.id) {
-    if (item.x != null && item.y != null) {
-      post(item);
-    } else {
-      throw Error("Item must have x and y");
-    }
+    // extract a separate function for creating new item
+    postNew(item);
   } else {
-    if (item.x < 10 && item.y > 25) {
-      put(item);
-    } else {
-      throw Error("Item must have an x and y value between 10 and 25");
-    }
+    // and one for updating existing items
+    updateItem(item);
   }
 }
+
+function postNew(item) {
+  validateNew(item);
+  post(item);
+}
+
+function updateItem(item) {
+  validateUpdate(item);
+  put(item);
+}
+

@coderabbitai

This comment was marked as resolved.

@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 16, 2026

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response.

Excess Number of Function Arguments

.github/actions/rust-build-release/tests/test_manifest_path.py: test_main_prefers_repo_declared_toolchain

What lead to degradation?

test_main_prefers_repo_declared_toolchain has 5 arguments, max arguments = 4

Why does this problem occur?

Functions with many arguments indicate either a) low cohesion where the function has too many responsibilities, or b) a missing abstraction that encapsulates those arguments.
The threshold for the Python language is 4 function arguments.

How to fix it?

Start by investigating the responsibilities of the function. Make sure it doesn't do too many things, in which case it should be split into smaller and more cohesive functions. Consider the refactoring INTRODUCE PARAMETER OBJECT to encapsulate arguments that refer to the same logical concept.

@coderabbitai

This comment was marked as resolved.

@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 16, 2026

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response.

Excess Number of Function Arguments

.github/actions/rust-build-release/src/action_setup.py: toolchain

What lead to degradation?

toolchain has 5 arguments, max arguments = 4

Why does this problem occur?

Functions with many arguments indicate either a) low cohesion where the function has too many responsibilities, or b) a missing abstraction that encapsulates those arguments.
The threshold for the Python language is 4 function arguments.

How to fix it?

Start by investigating the responsibilities of the function. Make sure it doesn't do too many things, in which case it should be split into smaller and more cohesive functions. Consider the refactoring INTRODUCE PARAMETER OBJECT to encapsulate arguments that refer to the same logical concept.

@coderabbitai

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 16, 2026

@coderabbitai Have the following failed checks now been resolved?

If further work is required, please provide an AI agent prompt for the remaining work to be done to address these failures.

❌ Failed checks (3 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Testing ⚠️ Warning The pull request implements new functionality with unit tests but fails to address critical review feedback, including missing Cargo.toml scanning in _uses_cranelift_backend(), absent stop_at parameter in _iter_toolchain_search_dirs(), unguarded fallback TOML parsing, and incomplete test coverage. Extend _uses_cranelift_backend() to parse Cargo.toml and scan profile sections, implement stop_at parameter in _iter_toolchain_search_dirs(), restrict fallback parsing to rust-toolchain files, refactor startswith() calls, and add comprehensive tests for all identified gaps.
User-Facing Documentation ⚠️ Warning Documentation fails to disclose that Cranelift detection only checks .cargo/config.toml and .cargo/config files, missing Cargo.toml profile-level codegen-backend declarations. Update the README to explicitly state Cranelift must be declared in .cargo/config.toml or .cargo/config files, or extend _uses_cranelift_backend() to parse Cargo.toml profile sections and add test coverage.
Developer Documentation ⚠️ Warning Pull request introduces significant internal API changes without corresponding developer documentation; new toolchain resolution functions, environment-variable overrides, and refactored signatures lack explanatory guides. Add developer documentation file explicitly detailing toolchain resolution precedence, architectural shifts to environment-variable overrides, helper function purposes, modified _run_cargo() signature handling, and maintenance guidance for internal APIs.
Title check ❓ Inconclusive The title is vague and generic, using non-descriptive phrasing that fails to convey the specific changes made across both the rust-build-release and generate-coverage actions. Revise the title to clearly summarise the main changes: toolchain resolution implementation and Cranelift coverage handling. For example: 'Implement toolchain resolution in rust-build-release and Cranelift coverage support'.

@coderabbitai

This comment was marked as resolved.

leynos added 2 commits April 17, 2026 00:43
Extract the default-toolchain lookup and the runner-specific resolution
into dedicated helpers above the `toolchain` CLI entry point.

Keep the CLI surface unchanged while reducing the command's argument
count and separating the override/manifest lookup from the
runner-mapping step.
Split `_run_cargo` into focused private helpers for cargo command
construction, missing-stream abort handling, and process wait/error
handling.

Preserve the observable behaviour while lowering the function's
cyclomatic complexity and keeping the existing output and exit paths.
codescene-delta-analysis[bot]

This comment was marked as outdated.

Replace the individual `main()` wiring fixtures in
`test_main_prefers_repo_declared_toolchain` with the existing
`build_main_context` bundle.

Keep the assertions and behaviour unchanged while reducing the test
function's argument count to the required threshold.
codescene-delta-analysis[bot]

This comment was marked as outdated.

Factor the repeated channel-prefix predicate out of
`_resolve_toolchain_name` and `_fallback_toolchain_name` into a single
private helper in `main.py`.

Keep the existing resolution behaviour unchanged while reducing the
complexity of the duplicated conditional logic.
@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 17, 2026

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response.

.github/actions/rust-build-release/tests/test_action_setup.py

Comment on lines +281 to +305

def test_cli_toolchain_prefers_repo_declared_nightly(
    action_setup_module: ModuleType,
    monkeypatch: pytest.MonkeyPatch,
) -> None:
    """Repo toolchain files override the action fallback when no input is set."""
    monkeypatch.chdir(NIGHTLY_CRANELIFT_PROJECT)

    result = runner.invoke(
        action_setup_module.app,
        [
            "toolchain",
            "--target",
            "aarch64-unknown-linux-gnu",
            "--manifest-path",
            "Cargo.toml",
            "--runner-os",
            "Linux",
            "--runner-arch",
            "X64",
        ],
        prog_name="action-setup",
    )

    assert result.exit_code == 0
    assert result.stdout.strip() == "nightly-2026-03-26"

❌ New issue: Code Duplication
The module contains 2 functions with similar structure: test_cli_toolchain_override_wins_over_repo_declared_nightly,test_cli_toolchain_prefers_repo_declared_nightly

@coderabbitai

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

leynos added 2 commits April 17, 2026 01:52
Bound repository toolchain discovery with an optional `stop_at` limit and
cover the inclusive boundary behaviour in the helper tests.

Extract manifest-side Cranelift detection into a private helper, keep the
existing tolerant matching for profile values, and add fixture-backed
coverage for manifest-only `Cargo.toml` profile declarations.
Document that the `generate-coverage` action scans `.cargo/config.toml`,
`.cargo/config`, and `Cargo.toml` profile settings when deciding whether
to export the LLVM codegen backend overrides for coverage runs.
codescene-delta-analysis[bot]

This comment was marked as outdated.

Document the internal toolchain-resolution flow in `rust-build-release`
and the Cranelift coverage override path in `generate-coverage`.

Also add brief contributor guidance for fixtures, changelog updates,
and README expectations when introducing new actions.
codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

Remove duplicated `_run_cargo` stubbing from the two cucumber coverage
environment-propagation tests in `test_scripts.py`.

Keep the assertions and execution path unchanged while moving the shared
setup into a private helper.
codescene-delta-analysis[bot]

This comment was marked as outdated.

Replace the two structurally identical nightly-project CLI toolchain
tests in `test_action_setup.py` with a single parameterized test.

Keep both behaviors covered and preserve explicit pytest case IDs for the
repo-declared nightly path and the CLI override path.
codescene-delta-analysis[bot]

This comment was marked as outdated.

@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 17, 2026

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response.

Excess Number of Function Arguments

.github/actions/generate-coverage/tests/test_scripts.py: _run_cucumber_coverage_and_capture_env

What lead to degradation?

_run_cucumber_coverage_and_capture_env has 5 arguments, max arguments = 4

Why does this problem occur?

Functions with many arguments indicate either a) low cohesion where the function has too many responsibilities, or b) a missing abstraction that encapsulates those arguments.
The threshold for the Python language is 4 function arguments.

How to fix it?

Start by investigating the responsibilities of the function. Make sure it doesn't do too many things, in which case it should be split into smaller and more cohesive functions. Consider the refactoring INTRODUCE PARAMETER OBJECT to encapsulate arguments that refer to the same logical concept.

@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 17, 2026

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response.

Excess Number of Function Arguments

.github/actions/rust-build-release/src/action_setup.py: toolchain

What lead to degradation?

toolchain has 5 arguments, max arguments = 4

Why does this problem occur?

Functions with many arguments indicate either a) low cohesion where the function has too many responsibilities, or b) a missing abstraction that encapsulates those arguments.
The threshold for the Python language is 4 function arguments.

How to fix it?

Start by investigating the responsibilities of the function. Make sure it doesn't do too many things, in which case it should be split into smaller and more cohesive functions. Consider the refactoring INTRODUCE PARAMETER OBJECT to encapsulate arguments that refer to the same logical concept.

@coderabbitai

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

codescene-delta-analysis[bot]

This comment was marked as outdated.

@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 17, 2026

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Ensure that this is validated against the current version of the codegraph.

If further refinement to address this finding would be deleterious, please supply a clear explanatory one to two paragraph markdown message I can paste into the CodeScene web ui's diagnostic suppression function so this diagnostic can be silenced.

Excess Number of Function Arguments

.github/actions/generate-coverage/tests/test_scripts.py: _run_cucumber_coverage_and_capture_env

What lead to degradation?

_run_cucumber_coverage_and_capture_env has 5 arguments, max arguments = 4

Why does this problem occur?

Functions with many arguments indicate either a) low cohesion where the function has too many responsibilities, or b) a missing abstraction that encapsulates those arguments.
The threshold for the Python language is 4 function arguments.

How to fix it?

Start by investigating the responsibilities of the function. Make sure it doesn't do too many things, in which case it should be split into smaller and more cohesive functions. Consider the refactoring INTRODUCE PARAMETER OBJECT to encapsulate arguments that refer to the same logical concept.

@coderabbitai

This comment was marked as resolved.

Reduce the helper argument count in generate-coverage test scaffolding by bundling the manifest path and extra environment into a private dataclass.
codescene-delta-analysis[bot]

This comment was marked as outdated.

@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 17, 2026

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Ensure that this is validated against the current version of the codegraph.

If further refinement to address this finding would be deleterious, please supply a clear explanatory one to two paragraph markdown message I can paste into the CodeScene web ui's diagnostic suppression function so this diagnostic can be silenced.

Number of Functions in a Single Module

.github/actions/generate-coverage/tests/test_scripts.py:

What lead to degradation?

This module has 76 functions, threshold = 75

@coderabbitai

This comment was marked as resolved.

Collapse the four structurally identical zero-coverage LCOV tests into one parametrized test while preserving the per-case pytest ids.
@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Apr 17, 2026

@coderabbitai Have the following failed checks now been resolved?

If further work is required, please provide an AI agent prompt for the remaining work to be done to address these failures.

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Testing ⚠️ Warning The pull request implements new functionality with unit tests but fails to address critical review feedback, including missing Cargo.toml scanning in _uses_cranelift_backend(), absent stop_at parameter in _iter_toolchain_search_dirs(), unguarded fallback TOML parsing, and incomplete test coverage. Extend _uses_cranelift_backend() to parse Cargo.toml and scan profile sections, implement stop_at parameter in _iter_toolchain_search_dirs(), restrict fallback parsing to rust-toolchain files, refactor startswith() calls, and add comprehensive tests for all identified gaps.
User-Facing Documentation ⚠️ Warning Documentation fails to disclose that Cranelift detection only checks .cargo/config.toml and .cargo/config files, missing Cargo.toml profile-level codegen-backend declarations. Update the README to explicitly state Cranelift must be declared in .cargo/config.toml or .cargo/config files, or extend _uses_cranelift_backend() to parse Cargo.toml profile sections and add test coverage.
Developer Documentation ⚠️ Warning Pull request introduces significant internal API changes without corresponding developer documentation; new toolchain resolution functions, environment-variable overrides, and refactored signatures lack explanatory guides. Add developer documentation file explicitly detailing toolchain resolution precedence, architectural shifts to environment-variable overrides, helper function purposes, modified _run_cargo() signature handling, and maintenance guidance for internal APIs.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 17, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
echo "=== _uses_cranelift_backend current implementation ==="
grep -n "_uses_cranelift_backend\|_manifest_uses_cranelift\|tomllib" \
  .github/actions/generate-coverage/scripts/run_rust.py | head -40

echo ""
echo "=== Full _uses_cranelift_backend definition ==="
grep -n "def _uses_cranelift_backend\|def _manifest_uses_cranelift" \
  .github/actions/generate-coverage/scripts/run_rust.py
START=$(grep -n "def _uses_cranelift_backend" .github/actions/generate-coverage/scripts/run_rust.py | head -1 | cut -d: -f1)
sed -n "${START},$((START+40))p" .github/actions/generate-coverage/scripts/run_rust.py

echo ""
echo "=== _iter_toolchain_search_dirs current implementation ==="
grep -n "def _iter_toolchain_search_dirs\|stop_at" \
  .github/actions/rust-build-release/src/toolchain.py
START2=$(grep -n "def _iter_toolchain_search_dirs" .github/actions/rust-build-release/src/toolchain.py | head -1 | cut -d: -f1)
sed -n "${START2},$((START2+20))p" .github/actions/rust-build-release/src/toolchain.py

echo ""
echo "=== Developer docs search ==="
fd -e md . .github/actions/
fd "DEVELOPMENT*" . -i
fd "ARCHITECTURE*" . -i
fd "CONTRIBUTING*" . -i

echo ""
echo "=== generate-coverage README: Cranelift section ==="
grep -n -A5 "cranelift\|Cranelift\|cargo/config" .github/actions/generate-coverage/README.md | head -40

echo ""
echo "=== test_iter_toolchain_search_dirs_stops_at_boundary ==="
grep -n "stop_at\|stops_at_boundary\|iter_toolchain" \
  .github/actions/rust-build-release/tests/test_toolchain_helpers.py | head -20

echo ""
echo "=== test fixture for cargo-toml-cranelift-project ==="
fd "cargo-toml-cranelift" .github/

Length of output: 5427


🏁 Script executed:

#!/bin/bash
echo "=== DEVELOPMENT.md content ==="
cat .github/actions/DEVELOPMENT.md

echo ""
echo "=== cargo-toml-cranelift-project fixture contents ==="
find .github/actions/generate-coverage/tests/fixtures/cargo-toml-cranelift-project -type f | sort
cat .github/actions/generate-coverage/tests/fixtures/cargo-toml-cranelift-project/Cargo.toml 2>/dev/null || echo "(no Cargo.toml)"

echo ""
echo "=== test coverage for cargo-toml-cranelift fixture ==="
grep -n "cargo.toml.cranelift\|cargo_toml_cranelift\|CARGO_TOML_CRANELIFT\|cargo-toml-cranelift" \
  .github/actions/generate-coverage/tests/test_scripts.py | head -20

echo ""
echo "=== _CucumberEnvScenario / _run_cucumber_coverage_and_capture_env current state ==="
grep -n "_CucumberEnvScenario\|_run_cucumber_coverage_and_capture_env" \
  .github/actions/generate-coverage/tests/test_scripts.py | head -20

Length of output: 6199


@leynos — all three checks are now resolved.

Check Status Evidence
Testing ✅ Resolved _manifest_uses_cranelift scans [profile.*].codegen-backend in Cargo.toml; _uses_cranelift_backend calls it first before walking .cargo/config{.toml}; _iter_toolchain_search_dirs has the `stop_at: Path
User-Facing Documentation ✅ Resolved The generate-coverage README now reads: "If a Rust project enables Cranelift — via .cargo/config.toml, .cargo/config, or a [profile.*].codegen-backend key in Cargo.toml…" — all three detection paths are disclosed
Developer Documentation ✅ Resolved .github/actions/DEVELOPMENT.md exists and covers the four-level toolchain resolution chain (with all six helper functions named), the Cranelift coverage override architecture, and guidance for adding new actions

No further work is required for these three items.

@leynos leynos merged commit 91b69b9 into main Apr 17, 2026
23 checks passed
@leynos leynos deleted the use-toolchain-rust-in-rust-build-release branch April 17, 2026 12:33
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