leanprover / leanprover/elan

RFC: Upgrading Lean versions

Open
#7 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
637
Forks
58
Avg merge
25m
Merged PRs (30d)
3

Description

Suggested plan:

  • Inject a leanpkg lean-upgrade <version> command into leanpkg (i.e. it will only be available when calling ~/.elan/bin/leanpkg). This is not just a convenience command for editing the leanpkg.toml file: It first has to resolve channel names like stable/nightly to specific Lean versions that are valid values for the lean_version field.
  • Override leanpkg add and leanpkg upgrade to add a warning on lean_version mismatches between the package and its dependencies. When connected to a TTY, offer to call lean-upgrade with an appropriate version to fix the conflicts (well, at least one of them).

With these changes, installing Lean and adding a mathlib dependency could be as simple as:

$ curl https://raw.githubusercontent.com/Kha/elan/master/elan-init.sh -sSf | sh
...
$ leanpkg new mypackage  # uses stable leanpkg, doesn't matter
$ cd mypackage
$ leanpkg add leanprover/mathlib
...
WARNING: Lean version "nightly-2018-04-06" of dependency "mathlib" does not match configured Lean version "3.4.0"
Do you want to set your package's Lean version to "nightly-2018-04-06"? [yN] y
...

Contributor guide

No contributing guide indexed for this repository

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 with the ~/.elan/bin/leanpkg entry point and the existing leanpkg add and upgrade commands. Determine how channel names are resolved to valid lean_version values and how interactive TTY prompts should handle mismatches; done means lean-upgrade and dependency warnings work together as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.