Zulip Chat Archive
Stream: general
Topic: leanpkg artifact storage location
Keeley Hoek (Aug 01 2018 at 16:02):
Hi there! Does anyone know of a particular reason why leanpkg copies dependencies into a "_target" directory in the project folder, as opposed to keeping a directory of artifacts in your home directory (e.g. like maven does)? It'd certainly avoid unnecessarily compiling mathlib multiple times when playing around with little projects.
Reid Barton (Aug 01 2018 at 16:10):
@Sebastian Ullrich ^ ?
Mario Carneiro (Aug 01 2018 at 16:11):
one of leanpkg add
and leanpkg install
is a global install
Sebastian Ullrich (Aug 01 2018 at 16:13):
leanpkg install
, but that's intended for use in non-project files
Kevin Buzzard (Aug 01 2018 at 16:19):
I currently have two projects which are using different versions of mathlib, but I'm not usually in this situation. I'm running something with UGs where we're all using mathlib 3.4.1 because trying to get 25 people to upgrade their mathlibs is a pain when some of them can't even open a terminal. I'm also doing a project which uses bleeding edge mathlib. But if I could have two flavours of mathlib installed globally I'd be happier than I am now, because I often find myself recompiling. I sometimes cheat and copy and paste instead of recompiling.
Sebastian Ullrich (Aug 01 2018 at 16:23):
@Keeley Hoek I don't think there is a particular reason other than the current leanpkg
being the minimum viable product
Scott Morrison (Aug 01 2018 at 23:46):
Potentially there's a problem for people who work like me, with two repositories repoA
and repoB
, with repoB
depending on a particular commit from repoA
, and both repositories change rapidly. In this case in the central ~/.leanpkg
directory I suspect we will end up with lots of copies of repoA
checked out at different commits.
Scott Morrison (Aug 01 2018 at 23:47):
This is probably a small price to pay (people in this situation can just clean out that directory every so often?) in exchange for having multiple projects be able to use the same compile version of mathlib, which would be really really lovely.
Scott Morrison (Aug 01 2018 at 23:47):
I'd be very happy to see central storage in any case.
Sebastian Ullrich (Aug 01 2018 at 23:55):
What Rust's cargo
(which is the direct inspiration for leanpkg
) does is it caches downloaded git repositories in a central cache (because these can be shared even if you're using different versions of them in different projects) and then stores build artifacts per project, probably to avoid flooding the central cache, as @Scott Morrison alluded to
Scott Morrison (Aug 02 2018 at 01:18):
I see, but that wouldn't save on rebuilding mathlib between different projects, which is the real payoff.
Last updated: Dec 20 2023 at 11:08 UTC