-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Nested Cargo packages #3452
base: master
Are you sure you want to change the base?
Changes from 1 commit
80b9ddf
126b2b4
ef9a157
a1d4425
35184e0
c4dd372
e71a953
3da9eeb
7f9c09f
130ceb0
42bdb61
25d86b1
743d531
34a19dc
b75a519
d7e8dea
6670428
da547de
b4923ac
68ad634
33d1c6e
680709c
2af4921
0deba10
b999976
3edb308
dd90f20
07b058d
2c220ee
4bc77cb
e470314
2a5474e
db9e7fa
4817861
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,9 +177,12 @@ When a valid parent package is packaged, each of its transitive nested dependenc | |
|
||
The package index, and the `crates.io` user interface, does not explicitly represent nested packages; the package is presented as if it were a single package: | ||
|
||
* Nested packages' dependencies are flattened into the dependencies of the parent package. | ||
* The packages selected by nested packages' features must be rewritten in terms of the parent package's features. | ||
* Note that optional dependencies might become required if the parent package always enables the relevant feature, and required dependencies might become optional if the dependency on the nested package is optional. | ||
* Nested packages’ dependencies are flattened into the listed dependencies of the parent package. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a little concerned that this seems like it could be a fairly complex operation to flatten dependencies. For example, how does it handle name collisions? How does it handle fields that aren't normally unified, like the If the intent is to have the resolver not know about nested packages, it seems like that would make it difficult for other parts of cargo to know about those nested packages since they are all driven by the resolver. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another field that can't be readily merged is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we don't hide this from the resolver, that opens up other areas of complexity iiuc
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By merging dependencies we probably have to mean that the index will list all of the dependencies from the merged list. I.E. the list of dependencies will have more than one entry for If we actually want to merge into one dependency entry, semver constraints are going to make life difficult. |
||
* Each optional dependency of a nested package so flattened must accurately represent the conditions for its activation in terms of the parent package's features (or lack thereof). To illustrate, note that the following cases might occur: | ||
* Optional dependencies of a nested package can become required, if the parent package always enables the relevant feature of the nested package. | ||
* Required dependencies of a nested package can become optional, if the dependency on the nested package which has that dependency is optional. | ||
* Optional dependencies that stay optional must be listed as activated by the relevant feature(s) of the parent package; the feature names of nested packages never appear in the index. | ||
|
||
|
||
All together, this will reflect what can be expected when using the parent package, without revealing, or needing to represent, the nested package implementation details of the parent package. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A minor question: If a Git repository contains a package with nested packages, can the other package depends on any of those nested packages as a Git dependency? Currently Git dependency searches packages whose name matches recursively inside the repository.