leanprover / leanprover/lean4

Lake toolchain update wrongly claims multiple available toolchains

Open
#9,840 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P-medium
Dominant language
Lean
Stars
9.2k
Forks
990
Avg merge
1d 17h
Merged PRs (30d)
175

Description

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

If we have a project which has a lean-toolchain with e.g.:

leanprover/lean4:4.22.0-rc4

and a dependency with (note the v):

leanprover/lean4:v4.22.0-rc4

and we update to the latest versions of these dependencies lake will suggest:

warning: toolchain not updated; multiple toolchain candidates:
  leanprover/lean4:v4.22.0-rc4
    from «doc-gen4»
  leanprover/lean4:4.22.0-rc4
    from MD4Lean

Which is confusing given that the two versions are semantically equivalent.

Context

Updating doc-gen's dependencies

Steps to Reproduce
  1. Create a project with some Lean version and add a dependency that has a semantically equivalent but not precisely string equal version.
  2. lake update
  3. :(

Expected behavior: lake should not complain about multiple candidates

Actual behavior: lake does complain about multiple candidates

Versions

[Output of #version or #eval Lean.versionString]
[OS version, if not using live.lean-lang.org.]

Additional Information

leanprover/lean4:v4.22.0-rc4

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the warning with a project whose lean-toolchain and dependency use semantically equivalent versions with and without the v prefix, then run lake update. Trace the toolchain candidate comparison in Lake and verify that equivalent versions are treated as one candidate, with no multiple-candidates warning.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.