Skip to content

Add Rust version check during adnt run [app] with upgrade prompt#10

Draft
Copilot wants to merge 3 commits into
developfrom
copilot/add-rust-version-check
Draft

Add Rust version check during adnt run [app] with upgrade prompt#10
Copilot wants to merge 3 commits into
developfrom
copilot/add-rust-version-check

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 5, 2025

When running adnt run [app], automatically check if the installed Rust toolchain meets the tool's minimum version requirement (from rust-version in Cargo.toml). Prompt user to upgrade via rustup update if outdated.

Changes

  • New rust_version.rs module

    • Version struct with semver parsing and Ord implementation
    • get_installed_rust_version() - parses rustc --version output
    • get_required_rust_version() - reads package.rust-version from Cargo.toml using toml crate
    • check_rust_version() - compares versions, prompts for upgrade if needed
  • Integration in tool_manager.rs

    • Version check runs after clone/update, before build
    • Added create_spinner() helper to reduce progress bar duplication
  • Dependencies

    • Added toml = "0.9" for proper TOML parsing

Example behavior

When a tool requires Rust 1.80+ but user has 1.70:

⚠ Rust version 1.80.0 is required by 'adnt-example', but you have 1.70.0
Would you like to update Rust using 'rustup update'? [Y/n]

Tests

12 unit tests covering version parsing (including nightly/two-part variants), comparison, and Cargo.toml extraction.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add Rust version check during adnt run [app] and propose upgrade if outdated</issue_title>
<issue_description>When running adnt run [app], the tool should automatically check the locally installed Rust toolchain version.
If the version is below the minimum required by the application, the user should be notified and prompted to upgrade.

Acceptance criteria:

  • Detect current Rust toolchain version (rustc --version).
  • Compare it against the minimum version defined by the application (e.g., in config or metadata).
  • If outdated, display a clear message and propose an automatic upgrade (e.g., via rustup update).
  • Continue execution only if the toolchain meets requirements.
  • Add tests in CI to ensure version checking works.

Deliverables:

  • Implementation
  • Documentation update
  • CI validation</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 5, 2025 12:53
Co-authored-by: fmahon <109478+fmahon@users.noreply.github.com>
…or spinner

Co-authored-by: fmahon <109478+fmahon@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Rust version check during adnt run for upgrades Add Rust version check during adnt run [app] with upgrade prompt Dec 5, 2025
Copilot AI requested a review from fmahon December 5, 2025 13:05
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.

Add Rust version check during adnt run [app] and propose upgrade if outdated

2 participants