Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Upgrading Lean versions #7

Open
Kha opened this issue Apr 20, 2018 · 3 comments
Open

RFC: Upgrading Lean versions #7

Kha opened this issue Apr 20, 2018 · 3 comments

Comments

@Kha
Copy link
Member

Kha commented Apr 20, 2018

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
...
@cipher1024
Copy link
Contributor

What would you do when you add a second package that specifies a different version of Lean?

@Kha
Copy link
Member Author

Kha commented Apr 20, 2018

What would you do when you add a second package that specifies a different version of Lean?

Select "an appropriate version", as I said 😁 . ...probably the lexically largest version string or something

@cipher1024
Copy link
Contributor

Sorry! I must have missed that!

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

No branches or pull requests

2 participants