Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle program interruption while sandbox or local repo is enabled #39

Open
panglesd opened this issue May 23, 2022 · 2 comments
Open

Comments

@panglesd
Copy link
Contributor

Various parts of ocaml-platform rely on temporarily modifying the opam state.

We should make sure that these temporary things are cleaned as much as possible.

As it might not be possible to clean them in all situation (eg a sudden shutdown of the computer), we should also clean them at the next run of the binary, and not rely on getting a clean state.

The temporary things are:

  • The sandbox switch
  • Enabling the repo

The program interuption that can happen are

  • The user hit Ctrl-C. (I think this one is already fine if Sys.catch_break is true by default)
  • The program receive a kill signal (we should handle it to turn it into an exception)
  • The computer is shut down: nothing can be done, we should clean next run of the binary! Maybe using a different opam root leaves a better state for the user.
@panglesd
Copy link
Contributor Author

The following was suggested during a dev meeting:

  • Use a local switch in a temporary directory (to ensure eventual deletion)
  • hide it from the user using a fancy opam command

@panglesd
Copy link
Contributor Author

#69 and #67 deal with most of the case. To close this issue, we should also handle kill signals, if the user shut his computer down, and I think that would be a sufficient case coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant