-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix(metadata): Stabilize id format as PackageIDSpec #12914
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,8 +34,8 @@ considersed as incompatible: | |
* **Adding new values for enum-like fields** — Same as adding new fields. It | ||
keeps metadata evolving without stagnation. | ||
* **Changing opaque representations** — The inner representations of some | ||
fields are implementation details. For example, fields related to "Package ID" | ||
or "Source ID" are treated as opaque identifiers to differentiate packages or | ||
fields are implementation details. For example, fields related to | ||
"Source ID" are treated as opaque identifiers to differentiate packages or | ||
sources. Consumers shouldn't rely on those representations unless specified. | ||
|
||
### JSON format | ||
|
@@ -53,10 +53,10 @@ The JSON output has the following format: | |
"name": "my-package", | ||
/* The version of the package. */ | ||
"version": "0.1.0", | ||
/* The Package ID, an opaque and unique identifier for referring to the | ||
package. See "Compatibility" above for the stability guarantee. | ||
/* The Package ID for referring to the | ||
package within the document and as the `--package` argument to many commands | ||
*/ | ||
"id": "my-package 0.1.0 (path+file:///path/to/my-package)", | ||
"id": "file:///path/to/my-package#0.1.0", | ||
/* The license value from the manifest, or null. */ | ||
"license": "MIT/Apache-2.0", | ||
/* The license-file value from the manifest, or null. */ | ||
|
@@ -242,13 +242,13 @@ The JSON output has the following format: | |
Each entry is the Package ID for the package. | ||
*/ | ||
"workspace_members": [ | ||
"my-package 0.1.0 (path+file:///path/to/my-package)", | ||
"file:///path/to/my-package#0.1.0", | ||
], | ||
/* Array of default members of the workspace. | ||
Each entry is the Package ID for the package. | ||
*/ | ||
"workspace_default_members": [ | ||
"my-package 0.1.0 (path+file:///path/to/my-package)", | ||
"file:///path/to/my-package#0.1.0", | ||
], | ||
// The resolved dependency graph for the entire workspace. The enabled | ||
// features are based on the enabled features for the "current" package. | ||
|
@@ -266,10 +266,10 @@ The JSON output has the following format: | |
"nodes": [ | ||
{ | ||
/* The Package ID of this node. */ | ||
"id": "my-package 0.1.0 (path+file:///path/to/my-package)", | ||
"id": "file:///path/to/my-package#0.1.0", | ||
/* The dependencies of this package, an array of Package IDs. */ | ||
"dependencies": [ | ||
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" | ||
"https://github.com/rust-lang/crates.io-index#[email protected]" | ||
], | ||
/* The dependencies of this package. This is an alternative to | ||
"dependencies" which contains additional information. In | ||
|
@@ -283,7 +283,7 @@ The JSON output has the following format: | |
*/ | ||
"name": "bitflags", | ||
/* The Package ID of the dependency. */ | ||
"pkg": "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", | ||
"pkg": "https://github.com/rust-lang/crates.io-index#[email protected]" | ||
/* Array of dependency kinds. Added in Cargo 1.40. */ | ||
"dep_kinds": [ | ||
{ | ||
|
@@ -309,7 +309,7 @@ The JSON output has the following format: | |
This is null if this is a virtual workspace. Otherwise it is | ||
the Package ID of the root package. | ||
*/ | ||
"root": "my-package 0.1.0 (path+file:///path/to/my-package)" | ||
"root": "file:///path/to/my-package#0.1.0", | ||
}, | ||
/* The absolute path to the build directory where Cargo places its output. */ | ||
"target_directory": "/path/to/my-package/target", | ||
|
@@ -331,6 +331,11 @@ The JSON output has the following format: | |
} | ||
```` | ||
|
||
Notes: | ||
- For `"id"` field syntax, see [Package ID Specifications] in the reference. | ||
|
||
[Package ID Specifications]: ../reference/pkgid-spec.html | ||
|
||
## OPTIONS | ||
|
||
### Output Options | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,9 +32,9 @@ OUTPUT FORMAT | |
|
||
o Changing opaque representations — The inner representations of some | ||
fields are implementation details. For example, fields related to | ||
“Package ID” or “Source ID” are treated as opaque identifiers | ||
to differentiate packages or sources. Consumers shouldn’t rely on | ||
those representations unless specified. | ||
“Source ID” are treated as opaque identifiers to differentiate | ||
packages or sources. Consumers shouldn’t rely on those | ||
representations unless specified. | ||
|
||
JSON format | ||
The JSON output has the following format: | ||
|
@@ -49,10 +49,10 @@ OUTPUT FORMAT | |
"name": "my-package", | ||
/* The version of the package. */ | ||
"version": "0.1.0", | ||
/* The Package ID, an opaque and unique identifier for referring to the | ||
package. See "Compatibility" above for the stability guarantee. | ||
/* The Package ID for referring to the | ||
package within the document and as the `--package` argument to many commands | ||
*/ | ||
"id": "my-package 0.1.0 (path+file:///path/to/my-package)", | ||
"id": "file:///path/to/my-package#0.1.0", | ||
/* The license value from the manifest, or null. */ | ||
"license": "MIT/Apache-2.0", | ||
/* The license-file value from the manifest, or null. */ | ||
|
@@ -238,13 +238,13 @@ OUTPUT FORMAT | |
Each entry is the Package ID for the package. | ||
*/ | ||
"workspace_members": [ | ||
"my-package 0.1.0 (path+file:///path/to/my-package)", | ||
"file:///path/to/my-package#0.1.0", | ||
], | ||
/* Array of default members of the workspace. | ||
Each entry is the Package ID for the package. | ||
*/ | ||
"workspace_default_members": [ | ||
"my-package 0.1.0 (path+file:///path/to/my-package)", | ||
"file:///path/to/my-package#0.1.0", | ||
], | ||
// The resolved dependency graph for the entire workspace. The enabled | ||
// features are based on the enabled features for the "current" package. | ||
|
@@ -262,10 +262,10 @@ OUTPUT FORMAT | |
"nodes": [ | ||
{ | ||
/* The Package ID of this node. */ | ||
"id": "my-package 0.1.0 (path+file:///path/to/my-package)", | ||
"id": "file:///path/to/my-package#0.1.0", | ||
/* The dependencies of this package, an array of Package IDs. */ | ||
"dependencies": [ | ||
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" | ||
"https://github.com/rust-lang/crates.io-index#[email protected]" | ||
], | ||
/* The dependencies of this package. This is an alternative to | ||
"dependencies" which contains additional information. In | ||
|
@@ -279,7 +279,7 @@ OUTPUT FORMAT | |
*/ | ||
"name": "bitflags", | ||
/* The Package ID of the dependency. */ | ||
"pkg": "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", | ||
"pkg": "https://github.com/rust-lang/crates.io-index#[email protected]" | ||
/* Array of dependency kinds. Added in Cargo 1.40. */ | ||
"dep_kinds": [ | ||
{ | ||
|
@@ -305,7 +305,7 @@ OUTPUT FORMAT | |
This is null if this is a virtual workspace. Otherwise it is | ||
the Package ID of the root package. | ||
*/ | ||
"root": "my-package 0.1.0 (path+file:///path/to/my-package)" | ||
"root": "file:///path/to/my-package#0.1.0", | ||
}, | ||
/* The absolute path to the build directory where Cargo places its output. */ | ||
"target_directory": "/path/to/my-package/target", | ||
|
@@ -326,6 +326,12 @@ OUTPUT FORMAT | |
} | ||
} | ||
|
||
Notes: | ||
|
||
o For "id" field syntax, see Package ID Specifications | ||
<https://doc.rust-lang.org/cargo/reference/pkgid-spec.html> in the | ||
reference. | ||
|
||
OPTIONS | ||
Output Options | ||
--no-deps | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,8 +34,8 @@ considersed as incompatible: | |
* **Adding new values for enum-like fields** — Same as adding new fields. It | ||
keeps metadata evolving without stagnation. | ||
* **Changing opaque representations** — The inner representations of some | ||
fields are implementation details. For example, fields related to "Package ID" | ||
or "Source ID" are treated as opaque identifiers to differentiate packages or | ||
fields are implementation details. For example, fields related to | ||
"Source ID" are treated as opaque identifiers to differentiate packages or | ||
sources. Consumers shouldn't rely on those representations unless specified. | ||
|
||
### JSON format | ||
|
@@ -53,10 +53,10 @@ The JSON output has the following format: | |
"name": "my-package", | ||
/* The version of the package. */ | ||
"version": "0.1.0", | ||
/* The Package ID, an opaque and unique identifier for referring to the | ||
package. See "Compatibility" above for the stability guarantee. | ||
/* The Package ID for referring to the | ||
package within the document and as the `--package` argument to many commands | ||
*/ | ||
"id": "my-package 0.1.0 (path+file:///path/to/my-package)", | ||
"id": "file:///path/to/my-package#0.1.0", | ||
/* The license value from the manifest, or null. */ | ||
"license": "MIT/Apache-2.0", | ||
/* The license-file value from the manifest, or null. */ | ||
|
@@ -242,13 +242,13 @@ The JSON output has the following format: | |
Each entry is the Package ID for the package. | ||
*/ | ||
"workspace_members": [ | ||
"my-package 0.1.0 (path+file:///path/to/my-package)", | ||
"file:///path/to/my-package#0.1.0", | ||
], | ||
/* Array of default members of the workspace. | ||
Each entry is the Package ID for the package. | ||
*/ | ||
"workspace_default_members": [ | ||
"my-package 0.1.0 (path+file:///path/to/my-package)", | ||
"file:///path/to/my-package#0.1.0", | ||
], | ||
// The resolved dependency graph for the entire workspace. The enabled | ||
// features are based on the enabled features for the "current" package. | ||
|
@@ -266,10 +266,10 @@ The JSON output has the following format: | |
"nodes": [ | ||
{ | ||
/* The Package ID of this node. */ | ||
"id": "my-package 0.1.0 (path+file:///path/to/my-package)", | ||
"id": "file:///path/to/my-package#0.1.0", | ||
/* The dependencies of this package, an array of Package IDs. */ | ||
"dependencies": [ | ||
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" | ||
"https://github.com/rust-lang/crates.io-index#[email protected]" | ||
], | ||
/* The dependencies of this package. This is an alternative to | ||
"dependencies" which contains additional information. In | ||
|
@@ -283,7 +283,7 @@ The JSON output has the following format: | |
*/ | ||
"name": "bitflags", | ||
/* The Package ID of the dependency. */ | ||
"pkg": "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", | ||
"pkg": "https://github.com/rust-lang/crates.io-index#[email protected]" | ||
/* Array of dependency kinds. Added in Cargo 1.40. */ | ||
"dep_kinds": [ | ||
{ | ||
|
@@ -309,7 +309,7 @@ The JSON output has the following format: | |
This is null if this is a virtual workspace. Otherwise it is | ||
the Package ID of the root package. | ||
*/ | ||
"root": "my-package 0.1.0 (path+file:///path/to/my-package)" | ||
"root": "file:///path/to/my-package#0.1.0", | ||
}, | ||
/* The absolute path to the build directory where Cargo places its output. */ | ||
"target_directory": "/path/to/my-package/target", | ||
|
@@ -331,6 +331,11 @@ The JSON output has the following format: | |
} | ||
```` | ||
|
||
Notes: | ||
- For `"id"` field syntax, see [Package ID Specifications] in the reference. | ||
|
||
[Package ID Specifications]: ../reference/pkgid-spec.html | ||
|
||
## OPTIONS | ||
|
||
### Output Options | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
should we as well add this to "SEE ALSO" at the end of this file? Like
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.
#13298