Skip to content

ProcessID enhacement #8618

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

johnbute
Copy link
Contributor

@johnbute johnbute commented May 5, 2025

Displays the PID of the SwiftPM instance currently holding the lock

Motivation:

Fixes https://github.com/swiftlang/swift-package-manager/issues/8528

Modifications:

Added a new abstraction for handling a .pid file which contains the pID of the currently running SwiftPM instance.

introduced the pidfileManipulator protocol and its implementation in pidFile struct to handle reading, writing, and deleting the PID file

Updated SwiftCommandState to use the pidFileManipulator to handle the pid file when attempting to acquire or release the lock.

Result:

Enhancement of knowing which processes are currently holding the lock + automatic cleanup

@johnbute johnbute marked this pull request as ready for review May 5, 2025 15:04
@johnbute johnbute marked this pull request as draft May 5, 2025 15:04
@johnbute
Copy link
Contributor Author

johnbute commented May 5, 2025

Still need to add tests + rename to something clearer. if you have any suggestions on naming, please let me know :)

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