RFC: lake build: add `--system-packages` flag to use system package manager
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
Proposal
In order for lean libraries to be packaged for Linux distributions, they must be installable using the system package manager. The system package manager will use lake build for building individual projects, but will manage the dependencies without lake. There should be a way for lake build to either:
- build the project without considering dependencies (and assume they will be made available at runtime using
$LEAN_PATHor some other method) - specify one or more package directories on the command-line for
laketo use at build-time
Notes:
- The exact implementation (flag vs. environment variable, how to specify multiple paths, etc.) is not important, system package managers are flexible there.
- Patching lakefile.lean/toml manually for each library is not feasible.
- Fetching any information at build time from a remote endpoint (like the reservoir registry) or via git fetch is also not OK for reproducible package managers like Nix or Guix.
- Ideally lake would be able to link directly against compiled
.olean/.leanfiles, and not require the original code orlakefile.leanfor dependencies. Not a big deal if this isn't possible.
Community Feedback
The system package manager problem was mentioned here, although the issue itself was for a different idea:
https://github.com/leanprover/lean4/issues/3193#issuecomment-1898009228
Impact
The impact would be availability of Lean libraries on various Linux distributions.
I have Lean 4.10, batteries, and some other libraries packaged for Guix via a new lean-build-system. But I cannot package mathlib because lake keeps trying to git fetch the dependencies.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the lake build entry point and the dependency behavior described for system package managers, including the existing lakefile.lean/toml configuration and git fetch path. Done means projects can build with externally supplied package directories or without dependency fetching, without manually patching lakefiles or contacting remote endpoints.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 40/100