Zulip Chat Archive
Stream: lean4
Topic: how does lake resolve/deduplicate transitive dependencies?
David Renshaw (Mar 02 2024 at 16:40):
Imagine three projects, named A, B, and C.
- Project A requires
std
at revisionabcd1234
. - Project B requires
std
at revisionefef5656
. - Project C requires both project A and project B.
How does lake
decide which version of std
to use for project C? Does it change anything if project A requires std at a tag named something like v4.6.0
, rather than a commit ID?
David Renshaw (Mar 02 2024 at 16:52):
I did some experimentation, and it looks like the answer is: it depends on which order the require
statements appear in projects C's lakefile.
David Renshaw (Mar 02 2024 at 16:57):
It seems that earlier requirements win. (And that maybe git
requires are prioritized over local path requires?)
Ruben Van de Velde (Mar 02 2024 at 17:25):
I think the current suggestion is "try not to get yourself in that situation", which isn't great but might well improve as the ecosystem matures
Mac Malone (Mar 02 2024 at 18:58):
David Renshaw said:
I did some experimentation, and it looks like the answer is: it depends on which order the
require
statements appear in projects C's lakefile.
David Renshaw said:
It seems that earlier requirements win.
This is correct assessment of how Lake works (except for the git
> path
-- they should both be treated the same). As Lake has no semantic version information at present, it cannot do more intelligent resolving at this time.
Eric Wieser (Mar 02 2024 at 21:05):
Can running lake update a
or b
change the version resolved?
Last updated: May 02 2025 at 03:31 UTC