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

Building a package creates a lock file in AppData\Local\Temp but never removes the lock file #8080

Open
ahoppen opened this issue Oct 28, 2024 · 2 comments
Labels

Comments

@ahoppen
Copy link
Member

ahoppen commented Oct 28, 2024

If you build a SwiftPM package on Windows, it creates a lock files for workspace-state.json and Package.resolved in a temporary directory but never deletes the lock file. On Unix systems, the lock files will eventually be cleaned up by the system removing files from the temporary directories but on Windows, AppData\Local\Temp does not get cleaned by the system (as far as I can tell) and the lock files stay around until the user manually removes them.

@jakepetroules
Copy link
Contributor

%TEMP% is cleaned by Storage Sense in Windows 10/11, which runs automatically when disk space is low by default (a lot less often than the Unix counterpart), but can be adjusted to Daily, Weekly, or Monthly by the user.

Shall we close this?

@ahoppen
Copy link
Member Author

ahoppen commented Oct 28, 2024

I didn’t know about Storage Sense but I definitely ran my machine out of disk-space with files in Temp, gathering >200,000 temporary directories (might have been significantly more, that’s when it stopped counting) and rebooting didn’t fix it. Also, there was an issue about this in SourceKit-LSP (swiftlang/sourcekit-lsp#1698). So, I think we can’t rely on Windows cleaning up Temp, like we do on Unix.

Related, swift-driver is leaking files as well: swiftlang/swift-driver#1720

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

No branches or pull requests

3 participants