-
Notifications
You must be signed in to change notification settings - Fork 20
Add progress information during builds #169
Conversation
While I appreciate the progress information, I sadly have a number of issues with how it was accomplished. For one, you altered how Lean modules are compiled, weaken C file hashing, and broke the lean-only flag. The As progress information was on my TODO list, I have given some thought about how best to do this. My ideal solution was to collect jobs in the the scheduler monad (and logs in the jobs). Then, after scheduling the jobs, Lake would iterate through them, awaiting and printing the results and logs for each in turn. Since that is a reasonably large refactor, I sadly did not have time to do it last summer, but was planning on doing it this one (and the way things are looking, that is still the plan). For the reasons above, I am thus not inclined to accept this PR as is. There is still a question of whether it is worth accepting this tech debt now to get this feature and then do a more principled refactor (like my plan) later. But, I would imagine this feature is not that worth it. Sorry for the downer. :( |
I agree that a bigger refactor of the build scheduler is probably a better and more principled solution for this feature here, but I don't think it's a significant technical debt. It's trivial to back out again but extremely helpful in the meantime.
Yes, for very good reasons.
Can you explain that comment? The trace still contains the hash of the C file, so it's dependencies would still be recompiled when the C file changes. There is very little information on what precise effects the traces have, so I'd be curious to know more.
The Lean-only flag was unused. Its only use would be for pure formalization projects like mathlib, and we don't set it. More generally, we want to make building C files / code generation a separate step at some point. And then the Lean-only flag won't make any sense at all. |
mkFacetJobConfigSmall fun mod => do | ||
(← mod.leanBin.fetch).bindSync fun _ _ => | ||
-- do content-aware hashing so that we avoid recompiling unchanged C files | ||
return (mod.cFile, ← computeTrace mod.cFile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like there was a reason I included getLeanTrace
in the C file's trace, but sadly I do not remember what it was.
@gebner Okay, I think you have convinced me. I do have some minor code comments. Otherwise, LGTM. |
Also, in addition to the code tweaks, we should probably warn on the |
Oh, I forgot about the option. Should we just delete it entirely? |
@gebner I have made some changes to the original PR (deprecating the |
Sounds good to me! |
@gebner If you want the changes soon, feel free to merge |
It was deprecated in leanprover/lake#169
It was deprecated in leanprover/lake#169
This is an extremely simple implementation, the two counters (finished / total) are passed around as
IO.Ref
. When starting a facet job, we increment the total count, when it's finished we increment the total count.Unfortunately it's a bit hard in Lake to figure out if a Lean module needs to rebuilt before its dependencies are built, so it might begin with
[1500/1978]
if you have already built 1500 files before calling Lake. (To be clear, I'd prefer[0/478]
in that case.)