Closed panglesd closed 1 year ago
Fixes #148
Do you think removing the whole cache is better than doing it selectively for impacted packages?
I followed your suggestion for remove_if
, and fixed a bug when wiping the cache then trying to write the version.
The save_version argument makes sense. Have you found a bug related to that ?
Yes, when there was an error (see https://github.com/tarides/ocaml-platform-installer/pull/151#discussion_r1063258996), the repo was wiped, and the file creation failed, stopping the process:
[...]
ocaml-platform: [WARNING] Deleting the cache due to a migration error (delete file /home/user/.opam/plugins/ocaml-platform/cache/repo/packages/dune: Is a directory)
ocaml-platform: [ERROR] create temporary file /home/user/.opam/plugins/ocaml-platform/bos-4a4d51.tmp: No such file or directory
user@bb481e8aec89:~$
I don't know if we should introduce a new version for the cache: the packages ocamlformat and merlin are incomplete as not all files are installed... But the only migration I see would be to remove those packages from the cache.