ocaml / opam

opam is a source-based package manager. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow.
https://opam.ocaml.org
Other
1.21k stars 348 forks source link

opam pin is very slow on windows #6048

Open hhugo opened 1 week ago

hhugo commented 1 week ago

opam pin is very slow on windows, are we cloning the entire repo, with all branches ? It take 1m20 for each package pinned.

Sat, 22 Jun 2024 13:10:59 GMT
Pin local packages
Sat, 22 Jun 2024 13:10:59 GMT
  C:\hostedtoolcache\windows\opam\2.2.0-rc1\x86_64\opam.exe pin --no-action add js_of_ocaml-compiler.dev .
Sat, 22 Jun 2024 13:12:21 GMT
  [js_of_ocaml-compiler.dev] synchronised (file://D:/a/js_of_ocaml/js_of_ocaml)
Sat, 22 Jun 2024 13:12:21 GMT
  js_of_ocaml-compiler is now pinned to git+file://D:/a/js_of_ocaml/js_of_ocaml#HEAD (version dev)
Sat, 22 Jun 2024 13:12:21 GMT
  C:\hostedtoolcache\windows\opam\2.2.0-rc1\x86_64\opam.exe pin --no-action add js_of_ocaml-lwt.dev .
Sat, 22 Jun 2024 13:13:43 GMT
  [js_of_ocaml-lwt.dev] synchronised (file://D:/a/js_of_ocaml/js_of_ocaml)
Sat, 22 Jun 2024 13:13:43 GMT
  js_of_ocaml-lwt is now pinned to git+file://D:/a/js_of_ocaml/js_of_ocaml#HEAD (version dev)
Sat, 22 Jun 2024 13:13:44 GMT
  C:\hostedtoolcache\windows\opam\2.2.0-rc1\x86_64\opam.exe pin --no-action add js_of_ocaml-ppx.dev .
Sat, 22 Jun 2024 13:15:06 GMT
  [js_of_ocaml-ppx.dev] synchronised (file://D:/a/js_of_ocaml/js_of_ocaml)
Sat, 22 Jun 2024 13:15:06 GMT
  js_of_ocaml-ppx is now pinned to git+file://D:/a/js_of_ocaml/js_of_ocaml#HEAD (version dev)
Sat, 22 Jun 2024 13:15:06 GMT
  C:\hostedtoolcache\windows\opam\2.2.0-rc1\x86_64\opam.exe pin --no-action add js_of_ocaml-ppx_deriving_json.dev .
Sat, 22 Jun 2024 13:16:31 GMT
  [js_of_ocaml-ppx_deriving_json.dev] synchronised (file://D:/a/js_of_ocaml/js_of_ocaml)
Sat, 22 Jun 2024 13:16:31 GMT
  js_of_ocaml-ppx_deriving_json is now pinned to git+file://D:/a/js_of_ocaml/js_of_ocaml#HEAD (version dev)
Sat, 22 Jun 2024 13:16:31 GMT
  C:\hostedtoolcache\windows\opam\2.2.0-rc1\x86_64\opam.exe pin --no-action add js_of_ocaml-toplevel.dev .

This is using opam 2.2 rc1

dra27 commented 1 week ago

Just extraction a clearer repro:

opam pin --no-action add js_of_ocaml-compiler.dev .
opam pin --no-action add js_of_ocaml-lwt.dev .
opam pin --no-action add js_of_ocaml-ppx.dev .
opam pin --no-action add js_of_ocaml-ppx_deriving_json.dev .
opam pin --no-action add js_of_ocaml-toplevel.dev .
dra27 commented 1 week ago

The issue here is that local Git repos are first rsync'd and this happens for each pin. You'll see if you pin git+https://github.com/ocsigen/js_of_ocaml.git that it's much faster (especially on the subsequent pins, because the commit cache starts to work).

This is related to #5810.

dra27 commented 1 week ago

(assigning @rjbou, as we can't remember why the rsync has to take place for a Git clone)