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

lake does not validate lakefile.toml #6482

Open
2 of 3 tasks
PatrickMassot opened this issue Dec 31, 2024 · 1 comment
Open
2 of 3 tasks

lake does not validate lakefile.toml #6482

PatrickMassot opened this issue Dec 31, 2024 · 1 comment
Labels
feature missing feature Lake Lake related issue P-high We will work on this issue

Comments

@PatrickMassot
Copy link
Contributor

Prerequisites

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

Description

lake silently ignores bad option combinations in lakefile.toml, for instance a version field for a require from git.

Context

https://leanprover.zulipchat.com/#narrow/channel/270676-lean4/topic/invalid.20atom/near/491387823

Steps to Reproduce

Create a new project with lakefile.toml containing:

[[require]]
name = "mathlib"
git = "https://github.com/leanprover-community/mathlib4.git"
version = "v4.14.0"

and run lake update.

Expected behavior:

Expected behavior: lake should at least emit a warning saying git and version are incompatible, maybe even suggesting to replace version by rev and explain that rev is intended for reservoir require.

Actual behavior:

lake silently ignores the version field and updates mathlib to git master.

Versions

Lean 4.14.0 on Linux.

Impact

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

@PatrickMassot PatrickMassot added the bug Something isn't working label Dec 31, 2024
@kim-em kim-em added Lake Lake related issue feature missing feature and removed bug Something isn't working labels Jan 4, 2025
@leanprover-bot leanprover-bot added the P-high We will work on this issue label Jan 10, 2025
@tydeu
Copy link
Member

tydeu commented Jan 13, 2025

While Lake is missing TOML validation, the example in question is not simply a TOML validation issue. It is equivalent to the following configuration in Lean (which is valid):

require "mathlib" @ "v4.14.0"
  from git "https://github.com/leanprover-community/mathlib4.git"

I see two ways to offer a user some correction (perhaps both are desirable):

  • Since Lake does not yet support non-git versions, always warn if the version in a non-git version.
  • Since we now have Reservoir requires for determining default sources, always require a git source to specify a revision (instead of just defaulting to master as we currently do).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature missing feature Lake Lake related issue P-high We will work on this issue
Projects
None yet
Development

No branches or pull requests

4 participants