as recommended by the mathport readme, but all I get is a unknown package 'Mathlib' on the import and it doesn't seem to use the oleans but instead wants to load the synported files (?). What am I doing wrong?
Why do you think it's using the synported files? Maybe because when you click on the import you land in the synported files? I think that's intended and you are just being redirected there although internally the binport is used. That's what's happening for me at least.
The binported oleans (e.g., Mathbin.AlgebraicGeometry.Scheme) import Mathlib and will thus break if Mathlib is not built and on the LEAN_PATH. The binported mathlib package (e.g., mathlib3port) does require mathlib, so Lake knows to add mathlib's olean directory to LEAN_PATH. However, Lake only builds modules on-demand. That is, when they are imported. Lake determines this by processing a module's header (i.e., the imports at the top of the file) to know what imports a given module (e.g., your test code) makes. Since you only import Mathbin.AlgebraicGeometry.Scheme, that is all Lake ensures is built. And since that file only has an olean and no source file, Lake is unable to determine its imports to build them. Thus, Mathlib does not get built, which causes the error here. To fix this, you need to import Mathlib in your test file or import a file that syntatically imports Mathlib (e.g., Mathbin).
Still the same errors... it also gives me warning: extraDepTarget has been deprecated. Try to use a custom target or raise an issue about your use case., is that related?
Ah no, the error message has changed, it's now object file './lean_packages/mathlib/build/lib/Mathlib.olean' of module Mathlib does not exist. :thinking:
I'm confused. I can clone and build mathlib4 with nightly 7-12 without errors, but if I import it via lake with a toolchain bound to the same Lean version, it throws errors concerning Syntax vs TSyntax which suggests it uses the wrong Lean version
You don't need to figure out what mathlib it requires, mathbin already specifies that. Simply require'ing mathlib3port and importing Mathlib should be enough.
Yes, the Lean version needs to match exactly. The mathport releases contain the oleans after all. It's already a wonder if the source code compiles with two different Lean versions, binary compatibility is pretty much a lost cause.
I have the same goal (use just binported mathlib files in a lean 4 project) and I'm also running into a bit of a wall with this. I've tried lake update and lake build, but upon having import Mathlib in my project, I get a very long error:
stderr:
info: Building Mathlib.Tactic.Alias
info: Building Mathlib.Tactic.Substs
info: Building Mathlib.Tactic.RestateAxiom
info: Building Std.Tactic.Lint.Simp
error: > LEAN_PATH=./lean_packages/mathlib3port/build/lib:./lean_packages/mathlib/build/lib:./lean_packages/lean3port/build/lib:./build/lib:./lean_packages/std/build/lib DYLD_LIBRARY_PATH=/Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-25/lib:./lean_packages/mathlib3port/build/lib:./lean_packages/mathlib/build/lib:./lean_packages/lean3port/build/lib:./build/lib:./lean_packages/std/build/lib:./lean_packages/std/build/lib /Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-25/bin/lean -DwarningAsError=true -Dlinter.missingDocs=true ./lean_packages/std/././Std/Tactic/Lint/Simp.lean -R ./lean_packages/std/./. -o ./lean_packages/std/build/lib/Std/Tactic/Lint/Simp.olean -i ./lean_packages/std/build/lib/Std/Tactic/Lint/Simp.ilean -c ./lean_packages/std/build/ir/Std/Tactic/Lint/Simp.c
error: stdout:
./lean_packages/std/././Std/Tactic/Lint/Simp.lean:75:50: error: invalid dotted identifier notation, unknown identifier Lean.Name.decl from expected type
Name
./lean_packages/std/././Std/Tactic/Lint/Simp.lean:95:30: error: unknown identifier 'Simp.UsedSimps'
./lean_packages/std/././Std/Tactic/Lint/Simp.lean:98:2: error: failed to construct 'ForIn' instance for collection
?m.27516 usedSimps env
and monad
ReaderT Context (StateRefT' IO.RealWorld State CoreM)
./lean_packages/std/././Std/Tactic/Lint/Simp.lean:115:8: error: type mismatch
(?m.28258, prf1_lems)
has type
?m.28256 × ?m.28252 : Type (max ?u.28255 ?u.28254)
but is expected to have type
Simp.Result : Type
error: external command /Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-25/bin/lean exited with code 1
error: > LEAN_PATH=./lean_packages/mathlib3port/build/lib:./lean_packages/mathlib/build/lib:./lean_packages/lean3port/build/lib:./build/lib:./lean_packages/std/build/lib DYLD_LIBRARY_PATH=/Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-25/lib:./lean_packages/mathlib3port/build/lib:./lean_packages/mathlib/build/lib:./lean_packages/lean3port/build/lib:./build/lib:./lean_packages/std/build/lib:./lean_packages/mathlib/build/lib /Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-25/bin/lean ./lean_packages/mathlib/././Mathlib/Tactic/Substs.lean -R ./lean_packages/mathlib/./. -o ./lean_packages/mathlib/build/lib/Mathlib/Tactic/Substs.olean -i ./lean_packages/mathlib/build/lib/Mathlib/Tactic/Substs.ilean -c ./lean_packages/mathlib/build/ir/Mathlib/Tactic/Substs.c
error: stdout:
./lean_packages/mathlib/././Mathlib/Tactic/Substs.lean:18:45: error: expected '(', ']', '_', 'decide', 'intro', 'match', 'native_decide', 'open', 'set_option', '{' or identifier
error: external command /Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-25/bin/lean exited with code 1
error: > LEAN_PATH=./lean_packages/mathlib3port/build/lib:./lean_packages/mathlib/build/lib:./lean_packages/lean3port/build/lib:./build/lib:./lean_packages/std/build/lib DYLD_LIBRARY_PATH=/Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-25/lib:./lean_packages/mathlib3port/build/lib:./lean_packages/mathlib/build/lib:./lean_packages/lean3port/build/lib:./build/lib:./lean_packages/std/build/lib:./lean_packages/mathlib/build/lib /Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-25/bin/lean ./lean_packages/mathlib/././Mathlib/Tactic/RestateAxiom.lean -R ./lean_packages/mathlib/./. -o ./lean_packages/mathlib/build/lib/Mathlib/Tactic/RestateAxiom.olean -i ./lean_packages/mathlib/build/lib/Mathlib/Tactic/RestateAxiom.ilean -c ./lean_packages/mathlib/build/ir/Mathlib/Tactic/RestateAxiom.c
error: stdout:
./lean_packages/mathlib/././Mathlib/Tactic/RestateAxiom.lean:58:4: error: type mismatch
addAndCompile
(Declaration.defnDecl
{ toConstantVal :=
{ name := newName, levelParams := info.toConstantVal.levelParams, type := info.toConstantVal.type },
value := info.value, hints := info.hints, safety := info.safety, all := info.all })
has type
CoreM Unit : Type
but is expected to have type
CommandElabM Unit : Type
error: external command /Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-25/bin/lean exited with code 1
error: > LEAN_PATH=./lean_packages/mathlib3port/build/lib:./lean_packages/mathlib/build/lib:./lean_packages/lean3port/build/lib:./build/lib:./lean_packages/std/build/lib DYLD_LIBRARY_PATH=/Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-25/lib:./lean_packages/mathlib3port/build/lib:./lean_packages/mathlib/build/lib:./lean_packages/lean3port/build/lib:./build/lib:./lean_packages/std/build/lib:./lean_packages/mathlib/build/lib /Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-25/bin/lean ./lean_packages/mathlib/././Mathlib/Tactic/Alias.lean -R ./lean_packages/mathlib/./. -o ./lean_packages/mathlib/build/lib/Mathlib/Tactic/Alias.olean -i ./lean_packages/mathlib/build/lib/Mathlib/Tactic/Alias.ilean -c ./lean_packages/mathlib/build/ir/Mathlib/Tactic/Alias.c
error: stdout:
./lean_packages/mathlib/././Mathlib/Tactic/Alias.lean:96:4: error: application type mismatch
bind (addDecl decl)
argument
addDecl decl
has type
CoreM Unit : Type
but is expected to have type
Elab.Command.CommandElabM PUnit : Type
./lean_packages/mathlib/././Mathlib/Tactic/Alias.lean:77:27: error: (kernel) declaration has metavariables 'Tactic.Alias.elabAlias'
error: external command /Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-25/bin/lean exited with code 1
Any idea what could be going on? I have require mathlib3port from git
"https://github.com/leanprover-community/mathlib3port" in my lakefile, and import Mathlib at the top of my top-level project-named lean file. (I'm not sure if I'm structuring that correctly; just starting out with lean!)
And @Gabriel Ebner , when you say the lean version needs to match, do you mean that the lean version specified in the leanpkg.toml file needs to match the version used by mathlib3port?
Ok, thanks! I'm actually having a bit of trouble fixing it, though. This suggests I use leanpkg configure, but I get the following error:
error: toolchain 'leanprover/lean4:nightly-2022-09-25' does not have the binary /Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-25/bin/leanpkg
Perhaps I've chosen the wrong lean_version string (which I've naively set to "leanprover/lean4:nightly-2022-09-13")...?
Hmm, thanks, that definitely did something! Now, with "leanprover/lean4:nightly-2022-09-13" as my lean_version, I get an error starting with "/Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-11/bin/lake print-paths Init Mathlib failed" instead, which I'll count as progress. Do you know how I might find the correct version to use here?
Oh, maybe that's my problem. The lean_version field is in leanpkg.toml. Is that whole file obselete/unneeded now? (I may have been following an out-of-date guide...)
Ok, it looks like my leantoolchain matches mathlib3port's toolchain (leanprover/lean4:nightly-2022-09-11) but I'm still getting what seems to me to be basically the same message. Here it is again in case it's slightly different:
oo ok great! (Aside: I also would have naively thought specifying a toolchain date would have prevented using features from the future, though. my lean-toolchain is leanprover/lean4:nightly-2022-09-11, so I'd expect it to only use things from then or earlier in the "lean4 ->" stage.)
Asking for the versions to match exactly is also problematic though, because there's a new version every day and maintainers can't keep up with that pace
ok, I've tried deleting everything but the manifest and rebuilding, but now it doesn't like any of the imports in lean_packages/std/Std.lean either...hmmm
does lake actually use the manifest or is it meant to be more of a record? if it does use it, I'm not sure why this isn't working...hmmm. perhaps this can be fixed by fixing lake somehow...I'm going to investigate tomorrow :) (I also wonder if people would agree that this needs to be fixed in lake. my argument would be that the point of having versioned toolchains is to prevent breaking changes like this! :) )
but one way to be sure is to copy the manifest file, delete the lean_packages folder entirely, restore the manifest and call lake build
Hmm...I moved the modified manifest.json to the top level of the project and rm -rf'd lean_packages and build, then called lake build. This generated a new manifest inside the created lean_packages, and still used a std that had a 9-26 toolchain, unfortunately :/
That is, you want to delete everything in lean_packagesexcept the manifest that is the only record that you are interested in something other than the latest version
if you run lake build with a lean_packages folder that only has the modified manifest in it and nothing else, in my experience lake will respect it and download the right versions
I did find something weird playing around (well, weird since I don't know what it means, lol): changing inputRev in the manifest seems to successfully change the std that gets cloned to one with a 9-11 toolchain
it doesn't work; clones a version of std with lean-toolchainleanprover/lean4:nightly-2022-09-26, which isn't consistent with rev 6488a2afeb62fb4c781d26d629796480c8270b2f of std on github.
hmm, do I need a verbose option for lake build or something? currently it just says info: cloning https://github.com/leanprover/std4 to ./lean_packages/std
cd'd back up to the project level, changed the rev in the manifest and made sure to save it; lake build then changed the manifest back as I watched :sweat_smile:
and then indeed the revision is reported by git rev-parse HEAD as 6488a2afeb62fb4c781d26d629796480c8270b2f. however, nothing works this time either, because of the mismatch between the configuration files
because if I sort of..."disconnect" std's manifest entry from its inputRev, I don't get the weird behavior. so somehow I'm guessing...if lake build sees main, it decides to update the manifest entry and std, presumably in accordance with something determined by what it saw there, i.e. main?
and for whatever it's worth, if i just straight up delete the inputRev key from the std entry in the manifest, I still get an error on import Mathlib, but it's this:
stderr:
info: Building Mathlib.Init.Data.Nat.Basic
info: Building Mathlib.Tactic.Alias
info: Building Mathlib.Init.Zero
info: Building Mathlib.Tactic.Spread
info: Building Mathlib.Init.Data.Int.Notation
info: Building Mathlib.Init.Function
info: Building Mathlib.Init.Data.Option.Basic
info: Building Mathlib.Init.Data.Option.Instances
info: Building Mathlib.Lean.Expr.Basic
info: Building Mathlib.Util.MemoFix
info: Building Mathlib.Tactic.Coe
info: Building Mathlib.Data.Char
info: Building Mathlib.Lean.Exception
info: Building Mathlib.Lean.LocalContext
info: Building Mathlib.Logic.Equiv.MfldSimpsAttr
info: Building Mathlib.Mathport.Attributes
info: Building Mathlib.Mathport.Rename
info: Building Mathlib.Tactic.Clear!
info: Building Mathlib.Tactic.ClearExcept
info: Building Mathlib.Tactic.Clear_
info: Building Mathlib.Tactic.Inhabit
info: Building Mathlib.Tactic.LeftRight
info: Building Mathlib.Tactic.TryThis
info: Building Mathlib.Tactic.SudoSetOption
info: Building Mathlib.Tactic.Set
info: Building Mathlib.Tactic.Simps
info: Building Mathlib.Tactic.Substs
info: Building Mathlib.Util.WithWeakNamespace
info: Building Mathlib.Util.Syntax
info: Building Mathlib.Tactic.Constructor
info: Building Mathlib.Tactic.Expect
info: Building Mathlib.Tactic.GuardGoalNums
info: Building Mathlib.Tactic.GuardHypNums
info: Building Mathlib.Tactic.IrreducibleDef
info: Building Mathlib.Tactic.PrintPrefix
info: Building Mathlib.Tactic.Rename
info: Building Mathlib.Tactic.RestateAxiom
info: Building Mathlib.Tactic.SeqFocus
info: Building Mathlib.Tactic.SimpRw
info: Building Mathlib.Tactic.TypeCheck
info: Building Mathlib.Util.Export
info: Building Mathlib.Tactic.Use
info: Building Mathlib.Util.IncludeStr
info: Building Mathlib.Util.Time
info: Building Mathlib.Tactic.RunCmd
info: Building Mathlib.Tactic.Trace
info: Building Mathlib.Tactic.ApplyWith
info: Building Mathlib.Util.Simp
info: Building Mathlib.Mathport.SpecialNames
info: Building Mathlib.Util.Tactic
info: Building Mathlib.Tactic.HelpCmd
info: Building Mathlib.Tactic.InferParam
info: Building Mathlib.Lean.Expr.Traverse
info: Building Mathlib.Tactic.ShowTerm
info: Building Mathlib.Util.WhatsNew
info: Building Mathlib.Logic.Nonempty
info: Building Mathlib.Init.Set
info: Building Mathlib.Data.Option.Defs
info: Building Mathlib.Tactic.Conv
info: Building Mathlib.Tactic.CommandQuote
info: Building Mathlib.Tactic.SwapVar
info: Building Mathlib.Tactic.RenameBVar
info: Building Mathlib.Lean.Expr.ReplaceRec
info: Building Mathlib.Tactic.Cache
info: Building Mathlib.Tactic.Cases
info: Building Mathlib.Tactic.PermuteGoals
info: Building Std
info: Building Mathlib.Lean.Expr
info: Building Mathlib.Tactic.Basic
info: Building Mathlib.Data.Array.Defs
info: Building Mathlib.Tactic.Find
info: Building Mathlib.Tactic.Recover
info: Building Mathlib.Tactic.Core
info: Building Mathlib.Tactic.Have
info: Building Mathlib.Tactic.Simpa
info: Building Mathlib.Tactic.SolveByElim
info: Building Mathlib.Tactic.LibrarySearch
info: Building Mathlib.Tactic.Existsi
info: Building Mathlib.Init.Logic
info: Building Mathlib.Tactic.Replace
info: Building Mathlib.Init.Algebra.Order
info: Building Mathlib.Logic.Equiv.LocalEquiv
info: Building Mathlib.Logic.Basic
info: Building Mathlib.Data.Option.Basic
info: Building Mathlib.Init.Algebra.Functions
info: Building Mathlib.Tactic.PushNeg
info: Building Mathlib.Init.Data.Nat.Lemmas
info: Building Mathlib.Data.Nat.Basic
info: Building Mathlib.Logic.Function.Basic
info: Building Mathlib.Tactic.ByContra
info: Building Mathlib.Data.Equiv.Basic
info: Building Mathlib.Data.Prod
info: Building Mathlib.Data.Subtype
info: Building Mathlib.Data.List.Basic
info: Building Mathlib.Data.Equiv.Functor
info: Building Mathlib.Order.Basic
error: > LEAN_PATH=./lean_packages/mathlib3port/build/lib:./lean_packages/mathlib/build/lib:./lean_packages/lean3port/build/lib:./build/lib:./lean_packages/std/build/lib DYLD_LIBRARY_PATH=/Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-11/lib:./lean_packages/mathlib3port/build/lib:./lean_packages/mathlib/build/lib:./lean_packages/lean3port/build/lib:./build/lib:./lean_packages/std/build/lib:./lean_packages/mathlib/build/lib /Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-11/bin/lean ./lean_packages/mathlib/././Mathlib/Data/List/Basic.lean -R ./lean_packages/mathlib/./. -o ./lean_packages/mathlib/build/lib/Mathlib/Data/List/Basic.olean -i ./lean_packages/mathlib/build/lib/Mathlib/Data/List/Basic.ilean -c ./lean_packages/mathlib/build/ir/Mathlib/Data/List/Basic.c
error: stdout:
./lean_packages/mathlib/././Mathlib/Data/List/Basic.lean:62:6: error: unknown constant 'length_pos'
./lean_packages/mathlib/././Mathlib/Data/List/Basic.lean:103:1: error: invalid field notation, type is not of the form (C ...) where C is a constant
forall_mem_cons
has type
∀ (p : ?m.2849 → Prop) (a : ?m.2849) (l : List ?m.2849),
(∀ (x : ?m.2849), x ∈ a :: l → p x) ↔ p a ∧ ∀ (x : ?m.2849), x ∈ l → p x
./lean_packages/mathlib/././Mathlib/Data/List/Basic.lean:111:0: error: invalid field notation, type is not of the form (C ...) where C is a constant
exists_mem_cons
has type
∀ (p : ?m.2982 → Prop) (a : ?m.2982) (l : List ?m.2982), (∃ x, x ∈ a :: l ∧ p x) ↔ p a ∨ ∃ x, x ∈ l ∧ p x
./lean_packages/mathlib/././Mathlib/Data/List/Basic.lean:115:0: error: invalid field notation, type is not of the form (C ...) where C is a constant
exists_mem_cons
has type
∀ (p : ?m.3060 → Prop) (a : ?m.3060) (l : List ?m.3060), (∃ x, x ∈ a :: l ∧ p x) ↔ p a ∨ ∃ x, x ∈ l ∧ p x
./lean_packages/mathlib/././Mathlib/Data/List/Basic.lean:159:2: error: invalid projection, structure expected
append_right_inj ?m.3424
has type
?m.3422 = ?m.3423
./lean_packages/mathlib/././Mathlib/Data/List/Basic.lean:162:2: error: invalid projection, structure expected
append_left_inj ?m.3532
has type
?m.3529 = ?m.3530
./lean_packages/mathlib/././Mathlib/Data/List/Basic.lean:247:55: error: function expected at
length_pos_of_ne_nil
term has type
?m.14283
./lean_packages/mathlib/././Mathlib/Data/List/Basic.lean:250:20: error: unsolved goals
α : Type u_1
x:cross: : Sort u_2
length_pos_of_ne_nil : x:cross:
a b : α
l : List α
h : a :: b :: l ≠ []
⊢ Sort u_2
α : Type u_1
x:cross: : Sort u_2
length_pos_of_ne_nil : x:cross:
a b : α
l : List α
h : a :: b :: l ≠ []
⊢ ?m.14656
./lean_packages/mathlib/././Mathlib/Data/List/Basic.lean:257:75: error: unsolved goals
α : Type u_1
x : α
xs : List α
n : ℕ
h : n = length xs
⊢ Sort ?u.21182
α : Type u_1
x : α
xs : List α
n : ℕ
h : n = length xs
⊢ ?m.21184
./lean_packages/mathlib/././Mathlib/Data/List/Basic.lean:285:17: error: type mismatch
congr_arg (cons ?m.23440) (removeNth_eq_nth_tail ?m.23453 ?m.23454)
has type
?m.23440 :: removeNth ?m.23454 ?m.23453 = ?m.23440 :: modifyNthTail tail ?m.23453 ?m.23454 : Prop
but is expected to have type
removeNth (a :: l) (n + 1) = modifyNthTail tail (n + 1) (a :: l) : Prop
./lean_packages/mathlib/././Mathlib/Data/List/Basic.lean:411:61: error: type mismatch
rfl
has type
erasep p (a :: l) = erasep p (a :: l) : Prop
but is expected to have type
erasep p (a :: l) = bif p a then l else a :: erasep p l : Prop
error: external command /Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-11/bin/lean exited with code 1
just in case it helps debug things, here's verbose output (lake -v build) for one of the "weird" instances, where inputRev is main, and where the rev is mysteriously changed from 6488a2... to 52c232.... This started with only a modified lean_packages/manifest.json and no other files.
verbose build
info: cloning https://github.com/leanprover-community/mathlib3port to ./lean_packages/mathlib3port
info: > git clone https://github.com/leanprover-community/mathlib3port ./lean_packages/mathlib3port
info: stderr:
Cloning into './lean_packages/mathlib3port'...
info: > git checkout --detach 9d2aa54216553f283e6efe011d4aa71cae0abd50 # in directory ./lean_packages/mathlib3port
info: stderr:
HEAD is now at 9d2aa542 bump to nightly-2022-09-13
info: cloning https://github.com/leanprover-community/lean3port.git to ./lean_packages/lean3port
info: > git clone https://github.com/leanprover-community/lean3port.git ./lean_packages/lean3port
info: stderr:
Cloning into './lean_packages/lean3port'...
info: > git checkout --detach b73dfeb9e288603ef280d4ccf8dd8d3af7b244fc # in directory ./lean_packages/lean3port
info: stderr:
HEAD is now at b73dfeb bump to nightly-2022-09-13
info: cloning https://github.com/leanprover-community/mathlib4.git to ./lean_packages/mathlib
info: > git clone https://github.com/leanprover-community/mathlib4.git ./lean_packages/mathlib
info: stderr:
Cloning into './lean_packages/mathlib'...
info: > git checkout --detach dd1ecc5d3aefab6a83767079c7d020f4aa254a24 # in directory ./lean_packages/mathlib
info: stderr:
HEAD is now at dd1ecc5 chore: bump to 2022-09-11 (#406)
info: cloning https://github.com/leanprover/std4 to ./lean_packages/std
info: > git clone https://github.com/leanprover/std4 ./lean_packages/std
info: stderr:
Cloning into './lean_packages/std'...
info: > git checkout --detach 52c2324923b7f83e4e9b82ca9c8284f7a86bd3e8 # in directory ./lean_packages/std
info: stderr:
HEAD is now at 52c2324 feat: use simp trace support in simpNF linter
info: Found dependency Cli mathlib3port locked master at 112b35fc348a4a18d2111ac2c6586163330b4941 mathlib locked master at 112b35fc348a4a18d2111ac2c6586163330b4941 lean3port locked master at 112b35fc348a4a18d2111ac2c6586163330b4941
Using master at 112b35fc348a4a18d2111ac2c6586163330b4941
info: Found dependency leanInk mathlib3port locked master at 439303af06465824588a486f5f9c023ca69979f3 mathlib locked master at 439303af06465824588a486f5f9c023ca69979f3 lean3port locked master at 439303af06465824588a486f5f9c023ca69979f3
Using master at 439303af06465824588a486f5f9c023ca69979f3
info: Found dependency mathlib3port
Using master at 9d2aa54216553f283e6efe011d4aa71cae0abd50
info: Found dependency doc-gen4 mathlib3port locked main at a2345380e861332fabecc61591cb274e61163a97 mathlib locked main at a2345380e861332fabecc61591cb274e61163a97 lean3port locked main at a2345380e861332fabecc61591cb274e61163a97
Using main at a2345380e861332fabecc61591cb274e61163a97
info: Found dependency Unicode mathlib3port locked master at 25b32ef69fd6d8ae34300d51dc0b9403ffb1fd29 mathlib locked master at 25b32ef69fd6d8ae34300d51dc0b9403ffb1fd29 lean3port locked master at 25b32ef69fd6d8ae34300d51dc0b9403ffb1fd29
Using master at 25b32ef69fd6d8ae34300d51dc0b9403ffb1fd29
info: Found dependency mathlib mathlib3port locked dd1ecc5d3aefab6a83767079c7d020f4aa254a24 at dd1ecc5d3aefab6a83767079c7d020f4aa254a24 mathlib locked master at ecd37441047e490ff2ad339e16f45bb8b58591bd lean3port locked dd1ecc5d3aefab6a83767079c7d020f4aa254a24 at dd1ecc5d3aefab6a83767079c7d020f4aa254a24
Using dd1ecc5d3aefab6a83767079c7d020f4aa254a24 at dd1ecc5d3aefab6a83767079c7d020f4aa254a24
info: Found dependency lean3port mathlib3port locked b73dfeb9e288603ef280d4ccf8dd8d3af7b244fc at b73dfeb9e288603ef280d4ccf8dd8d3af7b244fc
Using b73dfeb9e288603ef280d4ccf8dd8d3af7b244fc at b73dfeb9e288603ef280d4ccf8dd8d3af7b244fc
info: Found dependency std mathlib3port locked main at 1f3f0630659a96756377610db656253b18a6a7ee mathlib locked main at 1fa9d80bc2991dec80cfa47d2053b45749d28497 lean3port locked main at 1f3f0630659a96756377610db656253b18a6a7ee
Using main at 52c2324923b7f83e4e9b82ca9c8284f7a86bd3e8
info: Found dependency lake mathlib3port locked master at 6cfb4e3fd7ff700ace8c2cfdb85056d59f321920 mathlib locked master at 6cfb4e3fd7ff700ace8c2cfdb85056d59f321920 lean3port locked master at 6cfb4e3fd7ff700ace8c2cfdb85056d59f321920
Using master at 6cfb4e3fd7ff700ace8c2cfdb85056d59f321920
info: Found dependency CMark mathlib3port locked master at 8c0f9c1b16ee8047813f43b1f92de471782114ff mathlib locked master at 8c0f9c1b16ee8047813f43b1f92de471782114ff lean3port locked master at 8c0f9c1b16ee8047813f43b1f92de471782114ff
Using master at 8c0f9c1b16ee8047813f43b1f92de471782114ff
Fetching oleans for Leanbin
curl -L -O https://github.com/leanprover-community/mathport/releases/download/nightly-2022-09-13/lean3-binport.tar.gz # in directory ./lean_packages/lean3port/build/lib
stderr:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 5246k 100 5246k 0 0 9690k 0 --:--:-- --:--:-- --:--:-- 9690k
tar -xzf lean3-binport.tar.gz # in directory ./lean_packages/lean3port/build/lib
Fetching oleans for Mathbin
curl -L -O https://github.com/leanprover-community/mathport/releases/download/nightly-2022-09-13/mathlib3-binport.tar.gz # in directory ./lean_packages/mathlib3port/build/lib
stderr:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 576M 100 576M 0 0 24.1M 0 0:00:23 0:00:23 --:--:-- 28.0M
tar -xzf mathlib3-binport.tar.gz # in directory ./lean_packages/mathlib3port/build/lib
Building Moonshine
LEAN_PATH=./lean_packages/mathlib3port/build/lib:./lean_packages/mathlib/build/lib:./lean_packages/lean3port/build/lib:./build/lib:./lean_packages/std/build/lib DYLD_LIBRARY_PATH=/Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-11/lib:./build/lib /Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-11/bin/lean ./././Moonshine.lean -R ././. -o ./build/lib/Moonshine.olean -i ./build/lib/Moonshine.ilean -c ./build/ir/Moonshine.c
Compiling Moonshine
Building Main
LEAN_PATH=./lean_packages/mathlib3port/build/lib:./lean_packages/mathlib/build/lib:./lean_packages/lean3port/build/lib:./build/lib:./lean_packages/std/build/lib DYLD_LIBRARY_PATH=/Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-11/lib:./build/lib /Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-11/bin/lean ./././Main.lean -R ././. -o ./build/lib/Main.olean -i ./build/lib/Main.ilean -c ./build/ir/Main.c
Compiling Main
/Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-11/bin/leanc -c -o ./build/ir/Moonshine.o ./build/ir/Moonshine.c -O3 -DNDEBUG
/Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-11/bin/leanc -c -o ./build/ir/Main.o ./build/ir/Main.c -O3 -DNDEBUG
Linking moonshine
/Users/thomas/.elan/toolchains/leanprover--lean4---nightly-2022-09-11/bin/leanc -o ./build/bin/moonshine ./build/ir/Main.o ./build/ir/Moonshine.o
stderr:
ld64.lld: warning: /usr/lib/system/libsystem_kernel.dylib has version 12.6.0, which is newer than target minimum of 12.0.0
ld64.lld: warning: /usr/lib/system/libsystem_platform.dylib has version 12.6.0, which is newer than target minimum of 12.0.0
ld64.lld: warning: /usr/lib/system/libsystem_pthread.dylib has version 12.6.0, which is newer than target minimum of 12.0.0
One thing I'm noticing: each of the generated lean3port, mathlib, mathlib3port directories within lean_packages have their ownlean_packages directories within them, containing nothing but a manifest.json file. Should the revs in this manifest be reflected at the top level as well? They seem to use rev 1f3f0630659a96756377610db656253b18a6a7ee of std, instead of either of the two that have been tried so far.
From the looks of that match, it seems that it decides to update in response to a mismatch of rev fields in a dependency
Yes, that is the goal. See this comment on lake#120 for more information. I think the underlying problem is actually the one mentioned in lake#119here.
@Mac I don't suppose the lake dependency resolution algorithm could be documented somewhere in plain text in the documentation? It seems worth an RFC in case it's not actually doing what we want. Currently I have difficulty reading the code because I know neither what it is supposed to do nor what the invariants of the internal data structures are when processing all the dependencies.
@Mario Carneiro Yeah, this is a good idea. I definitely think that I now need to fix these bugs ASAP (hopefully by this weekend). While doing so, I can also write-up some doc on how I see it working. Feel free to also create issue requesting the docs on GitHub with anything you want to make sure I include. I can tell you the current approach is a bit haphazard as it has been mostly developed from me addressing @Gabriel Ebner 's feature requests.