Repository navigation
Download only the Mathlib files the project uses - #2
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Setup now downloads only the prebuilt Mathlib files the project's imports reach, instead of all of Mathlib.
Measured (macOS, Lean already installed, empty Mathlib download cache)
--full(all of Mathlib)~/.elan)"Before" is the README's figure from when linglib's release unpacked to 3.5 GB. The
--fullcolumn is whatmaindoes today, now that linglib's v4.34.1 release ships per-module archives (linglib-community/linglib#5034).What changes
scripts/get_mathlib.py(Python 3.8+, standard library only): followsimportlines from the project's files through linglib and the other packages, and asks Mathlib's download tool for exactly the files reached.--checkdownloads nothing and exits 1 if any are missing.scripts/build.sh <target>: runs that script, thenlake build. It stops before building if a needed Mathlib file is missing, so a new import cannot start an hours-long Mathlib compile.scripts/setup.sh: setsMATHLIB_NO_CACHE_ON_UPDATE=1, fetches the packages with a command that builds nothing (tried twice, since the Mathlib clone sometimes drops), then runs the script.--fulldownloads all of Mathlib as before..devcontainer: the same variable for terminals, and Python from the distribution.AGENTS.mdandREADME.md: build throughscripts/build.sh, what to do if Mathlib starts compiling, Windows commands, new sizes and times.Tests
script-tests).setup-scriptanddevcontainerfail if the logs show a Mathlib or linglib file being compiled, and print the disk use.new-importadds a file importingLinglib.Semantics.Exhaustification.Finite, checks that--checkfails first, builds it throughscripts/build.sh, and checks that more Mathlib files arrived (44 locally) and nothing was compiled.Not tested: Windows, and the dev container locally (no Docker here; the CI job covers it).