tarides / ocaml-platform-installer

The best way for developers to write software in OCaml
ISC License
60 stars 8 forks source link

Fix `share` folder not being installed completely #151

Closed panglesd closed 1 year ago

panglesd commented 1 year ago

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.

panglesd commented 1 year ago

Fixes #148

panglesd commented 1 year ago

Do you think removing the whole cache is better than doing it selectively for impacted packages?

panglesd commented 1 year ago

I followed your suggestion for remove_if, and fixed a bug when wiping the cache then trying to write the version.

panglesd commented 1 year ago

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:~$