-
Notifications
You must be signed in to change notification settings - Fork 379
Description
Internal caches (repository & switch state) are tied to opam version and possibly commit
Lines 88 to 96 in 3427421
| let full () = | |
| let git_version = match git () with | |
| | None -> "" | |
| | Some v -> Printf.sprintf " (%s)" (to_string v) in | |
| Printf.sprintf "%s%s" (to_string current) git_version | |
| let magic () = | |
| let hash = Hashtbl.hash (full ()) in | |
| String.sub (Printf.sprintf "%08X" hash) 0 8 |
This make the cache invalidated and rebuilded even if the structures didn't change. On an normal use, it is not so disturbing, the install.sh script does a reinit the rebuild repository cache. But projects that use opam-lib, loading repository state could take some time because of the invalidated cache.
We discussed it in dev meeting, and one solution would be to have proper cache versioning, no longer depending on opam version. Cache versions would bump only if the cache structure changes.
It would still depend on OCaml marshalling evolution, we need to investigate this part to avoid unintended segfaults.