File tree Expand file tree Collapse file tree 3 files changed +19
-29
lines changed Expand file tree Collapse file tree 3 files changed +19
-29
lines changed Original file line number Diff line number Diff line change @@ -63,24 +63,16 @@ impl<'gctx> Source for DependencyConfusionThreatOverlaySource<'gctx> {
63
63
} ;
64
64
ready ! ( self . local. query( & local_dep, kind, & mut local_callback) ) ?;
65
65
66
- let mut package_collision = None ;
67
66
let mut remote_callback = |index : IndexSummary | {
68
67
if local_packages. contains ( index. as_summary ( ) ) {
69
- package_collision = Some ( index. as_summary ( ) . clone ( ) ) ;
68
+ tracing:: debug!( ?local_source, ?remote_source, ?index, "package collision" ) ;
69
+ } else {
70
+ f ( index)
70
71
}
71
- f ( index)
72
72
} ;
73
73
ready ! ( self . remote. query( dep, kind, & mut remote_callback) ) ?;
74
74
75
- if let Some ( collision) = package_collision {
76
- std:: task:: Poll :: Ready ( Err ( anyhow:: anyhow!(
77
- "found a package in the remote registry and the local overlay: {}@{}" ,
78
- collision. name( ) ,
79
- collision. version( )
80
- ) ) )
81
- } else {
82
- std:: task:: Poll :: Ready ( Ok ( ( ) ) )
83
- }
75
+ std:: task:: Poll :: Ready ( Ok ( ( ) ) )
84
76
}
85
77
86
78
fn invalidate_cache ( & mut self ) {
Original file line number Diff line number Diff line change @@ -6056,20 +6056,21 @@ fn workspace_with_local_dep_already_published_nightly() {
6056
6056
p. cargo ( "package -Zpackage-workspace" )
6057
6057
. masquerade_as_nightly_cargo ( & [ "package-workspace" ] )
6058
6058
. replace_crates_io ( reg. index_url ( ) )
6059
- . with_status ( 101 )
6060
6059
. with_stderr_data (
6061
6060
str![ [ r#"
6062
6061
[PACKAGING] dep v0.1.0 ([ROOT]/foo/dep)
6063
6062
[PACKAGING] main v0.0.1 ([ROOT]/foo/main)
6064
6063
[UPDATING] crates.io index
6065
- [ERROR] failed to prepare local package for uploading
6066
-
6067
- Caused by:
6068
- failed to get `dep` as a dependency of package `main v0.0.1 ([ROOT]/foo/main)`
6069
-
6070
- Caused by:
6071
- found a package in the remote registry and the local overlay: dep@0.1.0
6072
6064
[PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
6065
+ [PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
6066
+ [VERIFYING] dep v0.1.0 ([ROOT]/foo/dep)
6067
+ [COMPILING] dep v0.1.0 ([ROOT]/foo/target/package/dep-0.1.0)
6068
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
6069
+ [VERIFYING] main v0.0.1 ([ROOT]/foo/main)
6070
+ [UNPACKING] dep v0.1.0 (registry `[ROOT]/foo/target/package/tmp-registry`)
6071
+ [COMPILING] dep v0.1.0
6072
+ [COMPILING] main v0.0.1 ([ROOT]/foo/target/package/main-0.0.1)
6073
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
6073
6074
6074
6075
"# ] ]
6075
6076
. unordered ( ) ,
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ fn overlay_version_wins() {
133
133
}
134
134
135
135
#[ cargo_test]
136
- fn version_collision ( ) {
136
+ fn version_precedence ( ) {
137
137
let ( reg, alt_path) = setup ( ) ;
138
138
let p = project ( )
139
139
. file (
@@ -161,16 +161,13 @@ fn version_collision() {
161
161
162
162
p. cargo ( "check" )
163
163
. overlay_registry ( & reg. index_url ( ) , & alt_path)
164
- . with_status ( 101 )
165
164
. with_stderr_data ( str![ [ r#"
166
165
[UPDATING] `sparse+http://127.0.0.1:[..]/index/` index
167
- [ERROR] failed to get `baz` as a dependency of package `foo v0.0.1 ([ROOT]/foo)`
168
-
169
- Caused by:
170
- failed to query replaced source registry `crates-io`
171
-
172
- Caused by:
173
- found a package in the remote registry and the local overlay: baz@0.1.1
166
+ [LOCKING] 1 package to latest compatible version
167
+ [UNPACKING] baz v0.1.1 (registry `[ROOT]/alternative-registry`)
168
+ [CHECKING] baz v0.1.1
169
+ [CHECKING] foo v0.0.1 ([ROOT]/foo)
170
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
174
171
175
172
"# ] ] )
176
173
. run ( ) ;
You can’t perform that action at this time.
0 commit comments