Zulip Chat Archive

Stream: general

Topic: lake exe cache get problems?


Alex Kontorovich (Apr 03 2024 at 17:03):

Has anyone had the following experience? I merged master with a branch, waited a while, opened VSCode, and refreshed dependencies. Lean says it's compiling starting with file [1800/2400]. I think, wait, that's going to take forever. So I close VSCode, and lake exe cache get. Then I open VSCode and refresh dependencies again. Now Lean says it's compiling starting with file [300/2400]. :( Did I do something wrong??

Damiano Testa (Apr 03 2024 at 17:06):

Assuming that the cache is remotely available, these issue typically get resolved after lake exe cache clean or, sometimes rm -rf .lake (think hard about issuing this last command!).

Damiano Testa (Apr 03 2024 at 17:07):

Of course, running lake exe cache get afterwards!

Alex Kontorovich (Apr 03 2024 at 17:15):

Got it, thanks!

Kevin Buzzard (Apr 03 2024 at 19:40):

with this sort of situation, if my branch is just a few files changed from master and nothing too low-level, I checkout master, do lake exe cache get there, and then checkout the branch and then hopefully it just has to compile the files I changed.

Yaël Dillies (Apr 03 2024 at 19:42):

Kevin, this technique helped in Lean 3 where we didn't have a granular cache, but in Lean 4 this is exactly the same as running lake exe cache get on the branch

Kevin Buzzard (Apr 03 2024 at 19:48):

Even if the branch has just been merged with master locally and not pushed, using any one of the three ways that git can merge branches?

Yaël Dillies (Apr 03 2024 at 19:52):

Yes, because all that matters is the state of the files, not how you got there

Yaël Dillies (Apr 03 2024 at 19:52):

cache is git-agnostic

Eric Wieser (Apr 04 2024 at 08:48):

Yaël Dillies said:

Kevin, this technique helped in Lean 3 where we didn't have a granular cache, but in Lean 4 this is exactly the same as running lake exe cache get on the branch

While the end result is the same, Kevin's approach can be much faster; lake exe cache get is far slower on a missing cache than a present one.

Mario Carneiro (Apr 04 2024 at 08:51):

I wish I knew why :(

Mario Carneiro (Apr 04 2024 at 08:52):

It is literally the network request (i.e. azure) which takes longer to return 404 than 200

Sebastian Ullrich (Apr 04 2024 at 09:07):

Is it caching? The variation of failing requests is likely much higher than succeeding ones as any change results in completely different hashes downstream

Mario Carneiro (Apr 04 2024 at 09:22):

in that case, wouldn't you expect running it a second time to be fast?

Mario Carneiro (Apr 04 2024 at 09:22):

I mean, it shouldn't be a difficult test to run it in a loop and see if the server eventually decides it's worth caching

Sebastian Ullrich (Apr 04 2024 at 09:23):

I haven't tried. Maybe they just don't do negative caching

Mario Carneiro (Apr 04 2024 at 09:24):

I suppose that makes sense, you don't want to be on the hook as a caching service if you are serving cached 404s when the file is hot off the press

Eric Wieser (Apr 08 2024 at 23:49):

Can we teach cache to create empty files or something for "this file was unbuildable", so that that information is cached positively?

Mario Carneiro (Apr 09 2024 at 08:49):

wouldn't it be lake creating those files?

Eric Wieser (Apr 09 2024 at 09:23):

I think either would work, though maybe only lake has the info needed to create them

Mario Carneiro (Apr 09 2024 at 09:29):

cache can't tell the difference between good files and bad, outdated files


Last updated: May 02 2025 at 03:31 UTC