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

feat: lake: reservoir require #4495

Merged
merged 3 commits into from
Jun 29, 2024
Merged

Conversation

tydeu
Copy link
Member

@tydeu tydeu commented Jun 19, 2024

Adds a new type of require which fetches package metadata from a registry API endpoint (i.e., Reservoir) and then clones a Git package using the information provided. To require such a dependency, the new syntax is:

require <scope> / <pkg-name> [@ "git#<rev>"] -- e.g., require "leanprover" / "doc-gen4"

Or in TOML:

[[require]]
name = "<pkg-name>"
scope = "<scope>"
rev = "<rev>"

Unlike with Git dependencies, Lake can make use of the richer information provided by the registry to determine the default branch of the package. This means for repositories of packages like doc-gen4 which have a default branch that is not master, Lake will now use said default branch (e.g., in doc-gen4's case, main).

Lake also supports configuring the registry endpoint via an environment variable: RESERVIOR_API_URL. Thus, any server providing a similar interface to Reservoir can be used as the registry. Further configuration options paralleling those of Cargo's Alternative Registries and Source Replacement will come in the future.

Updated and split from #3174.

@tydeu tydeu changed the title Lake/reservoir require feat: lake: reservoir require Jun 19, 2024
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Jun 19, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jun 19, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Jun 19, 2024
@tydeu tydeu force-pushed the lake/reservoir-require branch from 1e39c0f to eee048e Compare June 19, 2024 00:57
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jun 19, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Jun 19, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

leanprover-community-mathlib4-bot commented Jun 19, 2024

Mathlib CI status (docs):

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Jun 19, 2024
github-merge-queue bot pushed a commit that referenced this pull request Jun 19, 2024
A set of general tweaks of the `require` syntax and docs that provide a
base for #4495.

The sole significant behavioral change is that the `name` field of a
`require` in TOML now falls back to being interpreted as a simple string
name if the value is not a valid Lean identifier. This means that a
require for a package like `doc-gen4` can be written without French
quotes.
@tydeu tydeu force-pushed the lake/reservoir-require branch from eee048e to fe4df60 Compare June 20, 2024 17:07
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jun 20, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Jun 20, 2024
@tydeu tydeu force-pushed the lake/reservoir-require branch from ed1fc33 to 748af5b Compare June 28, 2024 21:05
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jun 28, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Jun 28, 2024
@tydeu tydeu force-pushed the lake/reservoir-require branch from 748af5b to 23c65b1 Compare June 28, 2024 22:10
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jun 28, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Jun 28, 2024
@tydeu tydeu force-pushed the lake/reservoir-require branch from 23c65b1 to 53db984 Compare June 28, 2024 22:34
@tydeu tydeu marked this pull request as ready for review June 28, 2024 22:34
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jun 28, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Jun 28, 2024
@tydeu tydeu added release-ci Enable all CI checks for a PR, like is done for releases will-merge-soon …unless someone speaks up labels Jun 29, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jun 29, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Jun 29, 2024
@tydeu tydeu added this pull request to the merge queue Jun 29, 2024
Merged via the queue into leanprover:master with commit 93c9ae7 Jun 29, 2024
26 checks passed
@tydeu tydeu deleted the lake/reservoir-require branch June 29, 2024 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builds-mathlib CI has verified that Mathlib builds against this PR release-ci Enable all CI checks for a PR, like is done for releases toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN will-merge-soon …unless someone speaks up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants