tarides / ocaml-platform-installer

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

Failure when simultaneous call when adding repository #118

Open panglesd opened 1 year ago

panglesd commented 1 year ago

Opam.Repository.add and thus also Installed_repo.with_repo_enabled will fail if the repo that we are trying to add is already there. This makes one of the execution of the platform fail if one tries to add the cache while it was already been added by the other instance.

We should be careful, as we also do not want to continue as if nothing was done. Indeed, the instance that added the repo might remove it before we have finished. We should maybe pick a random name for the repository and return it, so that we have our own repository per running instance.