- Notifications
You must be signed in to change notification settings - Fork 1.4k
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
base: main
Are you sure you want to change the base?
ProcessID enhacement #8618
Conversation
| Still need to add tests + rename to something clearer. if you have any suggestions on naming, please let me know :) |
| @swift-ci please test |
| @swift-ci please test |
0e93697 to 1963d73 Compare | @swift-ci please test |
1 similar comment
| @swift-ci please test |
10b1dd4 to 670f56a Compare | @swift-ci please test |
670f56a to 9972cd3 Compare 9972cd3 to 31cb5e3 Compare | @swift-ci please test |
| @swift-ci test windows |
2 similar comments
| @swift-ci test windows |
| @swift-ci test windows |
| // | ||
| // PIDTests.swift | ||
| // SwiftPM | ||
| // | ||
| // Created by John Bute on 2025-05-14. | ||
| // |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo: marking this for visibility! :) for new files, this is the suggested header -->
| // | |
| // PIDTests.swift | |
| // SwiftPM | |
| // | |
| // Created by John Bute on 2025-05-14. | |
| // | |
| //===----------------------------------------------------------------------===// | |
| // | |
| // This source file is part of the Swift.org open source project | |
| // | |
| // Copyright (c) 2025 Apple Inc. and the Swift project authors | |
| // Licensed under Apache License v2.0 with Runtime Library Exception | |
| // | |
| // See https://swift.org/LICENSE.txt for license information | |
| // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors | |
| // | |
| //===----------------------------------------------------------------------===// |
| @swift-ci please test windows |
Displays the PID of the SwiftPM instance currently holding the lock
Motivation:
Fixes #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