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

make this action mathlib-independent #17

Merged
merged 5 commits into from
Jun 10, 2024

Conversation

Seasawher
Copy link
Collaborator

I tested this action here: https://github.com/Seasawher/mk-exercise

Changed so that Lean version updates are also performed in repositories that are not downstream of mathlib.

@Seasawher Seasawher marked this pull request as ready for review June 6, 2024 16:21
@Seasawher
Copy link
Collaborator Author

@oliver-butterley please review this PR.

@oliver-butterley
Copy link
Owner

Thanks for the PR! Sorry it's taken a while for me to respond.

Yes, great that it also handles more cases. I think at the moment there is part of the logic that isn't correct:

At the moment the action updates the lean-toolchain file by checking which version of lean is used by the latest version of mathlib. If the project doesn't depend on mathlib this isn't the right thing to do.

What is the right thing to do? Update lean-toolchain to the latest release of lean? or the latest stable release?

@Seasawher
Copy link
Collaborator Author

Seasawher commented Jun 7, 2024

latest (pre)release of Lean.
now it should be v4.9.0-rc1

@Seasawher
Copy link
Collaborator Author

Seasawher commented Jun 7, 2024

I think lake update overwrite lean-toolchain if the repository depends on mathlib. so the following workflow may work even if the repo is mathlib-downstream.

  1. update lean-toolchain to latest release of Lean via downloading. don't fetch mathlib's toolchain!
  2. run lake update

@oliver-butterley
Copy link
Owner

🤔 that could work. The mathlib post update hook which updates lean-toolchain doesn't always work but the only situations where I have seen it fail are when the current version of lean is too old. Consequently it is likely that your proposal is fine.

Is there an easy way to update lean-toolchain to the latest released version of lean? We could query the github api for releases of lean and then use that. Unless there is an easy way built into lake?

@Seasawher
Copy link
Collaborator Author

Seasawher commented Jun 10, 2024

I think the command gh release list --repo leanprover/lean4 --limit 1 can get the latest release/prerelease of Lean 4. This will probably work, I tested it with mk-exercise.

@oliver-butterley
Copy link
Owner

oliver-butterley commented Jun 10, 2024

Yes, that's a great solution, nicely done!

@oliver-butterley oliver-butterley merged commit fd66f44 into oliver-butterley:main Jun 10, 2024
1 check passed
@Seasawher Seasawher deleted the patch branch June 11, 2024 00:33
lake exe cache get || true
lake build
shell: bash
uses: leanprover/lean-action@main
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note: when new release of lean-action come, this line should be updated.

@Seasawher Seasawher mentioned this pull request Jun 15, 2024
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.

2 participants