-
Notifications
You must be signed in to change notification settings - Fork 20
Updating should use manifests from dependencies #70
Comments
Consider the following case:
Which version of |
Ideally version 2 with a warning that there are conflicting versions (including a list of these versions). Then you stand a chance of fixing it manually if that's possible. |
@gebner This feature would mean that |
I would have expected all dependency versions to be stored in the manifest, including the transitive dependencies. There might be conflicts, after all, and it seems like a good idea to record their resolution. Also you might need to fix the conflicts manually. But generally, yes. |
I have been working on this issue and two requests along with the main request of the PR have been difficult to harmonize.
This suggests that the top-level manifest should be a single source of truth for the dependencies of the package and thus no warnings should be issued if the revision their conflict with ones in the dependency's manifest. However, the PR's goal seems to be using the dependency's manifest as the source of truth. Thus, it is not clear when Lake should use what. My current thought on how to solve this is to use an additional field in the package manifest to determine whether a entry is for the top-level or for a dependency (e.g., named
This suggests, when faced with a conflict (on initial resolution), Lake should use latest version from a set of conflicts. This poses some problems. First there is the question of different input revision. For instance, adapting the my example from above, package B could want want Second, assuming we do have matching input revisions, how and when do we get the the latest version. My thought is just to fetch for the latest version matching the descriptor always if two packages conflict on the specific revision. However, this could of course result in a version that neither supports. For example, they both, as in the original, want TL;DR My simplest solution to all of this is to append dependency's manifests to the top-level package's with their entries mark |
"... but instead replace them with the current entry from the dependency's manifest." Otherwise sounds good to me. |
Say you have three packages, then updating
C
(or adding theB
dependency the first time) should take the version ofA
fromB/lean_packages/manifest.json
.A
B
, which depends onA
C
, which depends onB
(The current behavior is that updating C upgrades both A and B to the latest revision, typically breaking B in the process.)
This is crucial for using manifests with anything that depends transitively on mathlib. For example if A=mathlib, B=lean-liquid, and C=yourownproject. Projects like lean-liquid bump the mathlib version every couple of weeks, using any other mathlib version will break.
The text was updated successfully, but these errors were encountered: