2
2
// Copyright (c) The Move Contributors
3
3
// SPDX-License-Identifier: Apache-2.0
4
4
5
- mod dependency_set;
6
- // TODO: this shouldn't be pub; need to move resolver error into resolver module
7
- pub mod external;
8
- mod git;
9
- mod local;
10
-
11
- pub use dependency_set:: DependencySet ;
12
5
use std:: {
13
6
collections:: BTreeMap ,
14
7
fmt:: { self , Debug } ,
15
8
marker:: PhantomData ,
16
9
path:: PathBuf ,
17
10
process:: { Command , Stdio } ,
18
11
} ;
19
- use tracing:: debug;
20
12
21
13
use derive_where:: derive_where;
22
14
use serde:: {
23
15
Deserialize , Deserializer , Serialize ,
24
16
de:: { self , MapAccess , SeqAccess , Visitor } ,
25
17
} ;
26
18
19
+ use tracing:: debug;
20
+
27
21
use crate :: {
28
22
errors:: { GitError , PackageError , PackageResult , ResolverError } ,
29
23
flavor:: MoveFlavor ,
@@ -34,6 +28,24 @@ use external::ExternalDependency;
34
28
use git:: { GitRepo , PinnedGitDependency , UnpinnedGitDependency } ;
35
29
use local:: LocalDependency ;
36
30
31
+ mod dependency_set;
32
+ // TODO: this shouldn't be pub; need to move resolver error into resolver module
33
+ pub mod external;
34
+ mod git;
35
+ mod local;
36
+
37
+ pub use dependency_set:: DependencySet ;
38
+
39
+ // TODO (potential refactor): consider using objects for manifest dependencies (i.e. `Box<dyn UnpinnedDependency>`).
40
+ // part of the complexity here would be deserialization - probably need a flavor-specific
41
+ // function that converts a toml value to a Box<dyn UnpinnedDependency>
42
+ //
43
+ // resolution would also be interesting because of batch resolution. Would probably need a
44
+ // trait method to return a resolver object, and then a method on the resolver object to
45
+ // resolve a bunch of dependencies (resolvers could implement Eq)
46
+ //
47
+ // TODO: maybe rename ManifestDependencyInfo to UnpinnedDependency
48
+
37
49
/// Phantom type to represent pinned dependencies (see [PinnedDependency])
38
50
#[ derive( Debug , PartialEq , Eq ) ]
39
51
pub struct Pinned ;
@@ -45,6 +57,7 @@ pub struct Unpinned;
45
57
/// [ManifestDependencyInfo]s contain the dependency-type-specific things that users write in their
46
58
/// Move.toml files in the `dependencies` section.
47
59
///
60
+ /// TODO: this paragraph will change with upcoming design changes:
48
61
/// There are additional general fields in the manifest format (like `override` or `rename-from`)
49
62
/// that are not part of the ManifestDependencyInfo. We separate these partly because these things
50
63
/// are not serialized to the Lock file. See [crate::package::manifest] for the full representation
@@ -80,6 +93,8 @@ pub enum PinnedDependencyInfo<F: MoveFlavor + ?Sized> {
80
93
FlavorSpecific ( F :: FlavorDependency < Pinned > ) ,
81
94
}
82
95
96
+ // TODO: these should be moved down.
97
+
83
98
// UNPINNED
84
99
impl < ' de , F > Deserialize < ' de > for ManifestDependencyInfo < F >
85
100
where
@@ -184,6 +199,7 @@ fn split<F: MoveFlavor>(
184
199
( gits, exts, locs, flav)
185
200
}
186
201
202
+ // TODO: this will change with upcoming design changes:
187
203
/// Replace all dependencies with their pinned versions. The returned set may have a different set
188
204
/// of keys than the input, for example if new implicit dependencies are added or if external
189
205
/// resolvers resolve default deps to dep-overrides, or if dep-overrides are identical to the
@@ -231,6 +247,7 @@ pub async fn pin<F: MoveFlavor>(
231
247
] ) )
232
248
}
233
249
250
+ // TODO: this will change with the upcoming design changes:
234
251
/// For each environment, if none of the implicit dependencies are present in [deps] (or the
235
252
/// default environment), then they are all added.
236
253
// TODO: what's the notion of identity used here?
@@ -250,3 +267,7 @@ fn fetch<F: MoveFlavor>(
250
267
251
268
todo ! ( )
252
269
}
270
+
271
+ // TODO: unit tests
272
+ #[ cfg( test) ]
273
+ mod tests { }
0 commit comments