File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -261,10 +261,9 @@ pub fn resolve_workspace_with_opts(
261261 . block_on ( TryFutureExt :: into_future ( async {
262262 let mut patch_map = PatchMap :: new ( ) ;
263263
264- for ( source, patches) in ws. patch ( ) {
265- patch_map. insert ( source. clone ( ) , patches. clone ( ) ) ;
266- }
267-
264+ // Insert the implicit patches that redirect `core`/`starknet`/etc. to the bundled
265+ // `std` source first, so that user-defined `[patch]` entries (inserted below) can
266+ // override them, e.g. to redirect `core` itself to a custom source.
268267 let cairo_version = crate :: version:: get ( ) . cairo . version . parse ( ) . unwrap ( ) ;
269268 let version_req = DependencyVersionReq :: exact ( & cairo_version) ;
270269 let builtin_patches = [
Original file line number Diff line number Diff line change @@ -518,21 +518,20 @@ impl DependencyProvider for PubGrubDependencyProvider {
518518
519519 let deps = deps
520520 . iter ( )
521- . map ( |dependency| {
522- let package_id = PackageId :: new (
523- dependency . name . clone ( ) ,
524- dependency . version . clone ( ) ,
525- dependency . source . expect (
526- " source set to `None` is filtered out when searching the lockfile" ,
527- ) ,
528- ) ;
529- Ok ( (
521+ // Path source dependencies (for example a `core` package redirected to a local
522+ // path via `[patch]`) are not recorded with a source in the lockfile. Locking
523+ // never occurs on path sources, so they are resolved through their own (main
524+ // package) resolution rather than this locked shortcut - skip them here.
525+ . filter_map ( |dependency| {
526+ let source = dependency . source ? ;
527+ let package_id =
528+ PackageId :: new ( dependency . name . clone ( ) , dependency . version . clone ( ) , source ) ;
529+ Some ( (
530530 package_id,
531531 DependencyVersionReq :: exact ( & dependency. version . clone ( ) ) ,
532532 ) )
533533 } )
534- . collect :: < Result < Vec < ( PackageId , DependencyVersionReq ) > , DependencyProviderError > > (
535- ) ?;
534+ . collect_vec ( ) ;
536535 let constraints = deps
537536 . into_iter ( )
538537 . map ( |( package_id, req) | ( package_id. into ( ) , req. into ( ) ) )
You can’t perform that action at this time.
0 commit comments