Skip to content

Commit 9787229

Browse files
committed
Auto merge of #12933 - epage:pkgid-spec, r=weihanglo
feat(spec): Extend PackageIdSpec with source kind + git ref for unambiguous specs ### What does this PR try to resolve? This tries to add just enough information to Package ID Specs that we can be sure they are unambiguous. On its own thats important but this will unblock #12914 so we can have a user-facing ID that can be used with cargo's CLI. More specifically, this adds - `git+`, etc prefixes to the scheme - These were previously stabilized for `cargo metadata`s source id urls - Like with `SourceID`, this will allow `PackageIDSpec` to generate `directory+` and `local-registry+` prefixes but not parse them. I'm assuming that the layers where those are dealt with they won't appear here but I don't have enough experience with them - git ref query strings for URLs Things from `SourceID` that this does not include - precise: this seems less related to matching (e.g. ignored for `impl Ord for SourceId`) - canonical URL for git kinds: this could be nice for users but users aren't the target audience and we can switch to these later Fixes #10256 ### How should we test and review this PR? Per-commit ### Additional information
2 parents 0124d28 + 64f5b0c commit 9787229

File tree

5 files changed

+308
-28
lines changed

5 files changed

+308
-28
lines changed

src/cargo/core/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub use self::package_id_spec::PackageIdSpec;
88
pub use self::registry::Registry;
99
pub use self::resolver::{Resolve, ResolveVersion};
1010
pub use self::shell::{Shell, Verbosity};
11-
pub use self::source_id::{GitReference, SourceId};
11+
pub use self::source_id::{GitReference, SourceId, SourceKind};
1212
pub use self::summary::{FeatureMap, FeatureValue, Summary};
1313
pub use self::workspace::{
1414
find_workspace_root, resolve_relative_path, MaybePackage, Workspace, WorkspaceConfig,

0 commit comments

Comments
 (0)