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

refactor: remove custom cleanup routine on proton install error #186

Merged
merged 13 commits into from
Sep 16, 2024

Conversation

R1kaB3rN
Copy link
Member

@R1kaB3rN R1kaB3rN commented Sep 16, 2024

Currently, we were extracting the Proton archive directly to $HOME/.local/share/Steam/compatibilitytools.d then would clean that directory if the extraction was interrupted. While this process was direct, it required writing a custom cleanup routine to remove the partially extracted files in case an exception occurred. Instead, the launcher will extract to its secure temporary directory created at runtime then move the files to $HOME like we do with the SLR. Like the previous behavior, when an exception occurs in either the download or installation, the (temporary) directory will be cleaned but by the context manager's cleanup routine. While this would be less direct as it would involve an extra step, it would result in the launcher having to remove less files from the user's home directory and make the Proton installation partially atomic.

Additionally, some minor refactoring (e..g, collapsing code blocks) are done for readability.

- Delegate cleanup routine to tempfile.TemporaryDirectory when the
  context manager exits
- There will be cases where the launcher will crash when setting environment variables because PROTONPATH couldn't be resolved as the move of the Proton build didn't complete.
This reverts commit a4c3f3795b50131328a0918b97b10abcaef2464a.
- Remove some assertions for the state of the compatibilitytools.d directory. Once an exception occurs, all files will automatically be cleaned up as the temporary directory is created as a context manager.
@R1kaB3rN R1kaB3rN marked this pull request as ready for review September 16, 2024 21:00
@R1kaB3rN R1kaB3rN merged commit 0f79d6c into Open-Wine-Components:main Sep 16, 2024
5 of 6 checks passed
@R1kaB3rN R1kaB3rN deleted the refactor-umu-proton branch September 16, 2024 21:02
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

Successfully merging this pull request may close these issues.

1 participant