cirruslabs / tart

macOS and Linux VMs on Apple Silicon to use in CI and other automations
https://tart.run
Other
3.65k stars 102 forks source link

Support cancellation of installation process #770

Closed torarnv closed 3 months ago

torarnv commented 3 months ago

We wrap the installation with a withTaskCancellationHandler, which ensures that the SIGINT signal handling code in main() will trigger a cancellation of the installer.

As the VZMacOSInstaller must be both created and interacted with on the VM's queue, which in our case is the main queue, we need to move the logic to a separate function tagged with @MainActor. This makes sense either way, as it cleans up the code a bit.