@@ -312,9 +312,6 @@ let setup_lock_rules ~dir ~lock_dir : Gen_rules.result =
312312 >> | Dune_lang.Package.Name.Map. map ~f: Local_package. of_package
313313 |> Action_builder. of_memo
314314 and + repos =
315- (* CR-soon Alizter: This repository handling logic is duplicated in
316- bin/pkg/pkg_common.ml:get_repos. The OpamUrl.classify pattern
317- matching and repository resolution could be shared. *)
318315 Action_builder. of_memo
319316 (Memo. of_thunk (fun () ->
320317 let repositories =
@@ -334,30 +331,7 @@ let setup_lock_rules ~dir ~lock_dir : Gen_rules.result =
334331 Pkg_workspace.Repository. name repo, repo)
335332 |> Pkg_workspace.Repository.Name.Map. of_list_exn
336333 in
337- let module Repository = Pkg_workspace. Repository in
338- repositories
339- |> Fiber. parallel_map ~f: (fun (loc , name ) ->
340- match Repository.Name.Map. find available_repos name with
341- | None ->
342- User_error. raise
343- ~loc
344- [ Pp. textf " Repository '%s' is not a known repository"
345- @@ Repository.Name. to_string name
346- ]
347- | Some repo ->
348- let loc, opam_url = Repository. opam_url repo in
349- (match OpamUrl. classify opam_url loc with
350- | `Git -> Opam_repo. of_git_repo loc opam_url
351- | `Path path ->
352- Fiber. return @@ Opam_repo. of_opam_repo_dir_path loc path
353- | `Archive ->
354- User_error. raise
355- ~loc
356- [ Pp. textf
357- " Repositories stored in archives (%s) are currently \
358- unsupported"
359- @@ OpamUrl. to_string opam_url
360- ]))
334+ Opam_repo. resolve_repositories ~available_repos ~repositories
361335 |> Memo. of_non_reproducible_fiber))
362336 and + pins =
363337 (* CR-soon Alizter: This pin logic (extracting workspace pins,
0 commit comments