Skip to content

Display the process ID in the when running a Swift PM command that has a hold of the .build directory #8528

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

Closed
bkhouri opened this issue Apr 17, 2025 · 1 comment · Fixed by #8575 · May be fixed by #8618
Closed

Display the process ID in the when running a Swift PM command that has a hold of the .build directory #8528

bkhouri opened this issue Apr 17, 2025 · 1 comment · Fixed by #8575 · May be fixed by #8618
Labels
enhancement good first issue Good for newcomers Edit

Comments

@bkhouri
Copy link
Contributor

bkhouri commented Apr 17, 2025

Description

As a software developer using Swift Package Manager, I would like the "lock message" to contain the Process ID that is locking a Swift PM action so that I can inspect the process and make an informed decision if I want to terminate it or let it run to completion.

Expected behavior

Swift PM has knowledge that another instance is currently using the .build directory. It would be ideal to include the process ID of that instance in the message

❯ swift build --disable-prefetching
Another instance of SwiftPM is already running using '/Users/bkhouri/Documents/git/public/swiftlang/swift-package-manager/.build', waiting until that process has finished execution...

Actual behavior

maybe something line

❯ swift build --disable-prefetching
Another instance of SwiftPM (pID ######) is already running using '/Users/bkhouri/Documents/git/public/swiftlang/swift-package-manager/.build', waiting until that process has finished execution...

Steps to reproduce

  1. Open a terminal, and run swift test --no-parallel (ensuring the build takes "time")
  2. While the first command is running, in another terminal, execute swift test --no-parallel

Swift Package Manager version/commit hash

Swift Package Manager - Swift 6.1.0

Swift & OS version (output of swift --version && uname -a)

❯ uname -a
Darwin BKs-Work-M1Pro-MacBook-Pro-3.local 24.5.0 Darwin Kernel Version 24.5.0: Sun Apr 13 22:01:22 PDT 2025; root:xnu_development-11417.120.105.0.2~26/DEVELOPMENT_ARM64_T6000 arm64

❯ swift --version
Apple Swift version 6.1 (swift-6.1-RELEASE)
Target: arm64-apple-macosx15.0
@louisunlimited
Copy link
Contributor

Hi @bkhouri ! I took a stab at this, lmk if you need anything else!

@heckj heckj changed the title Display the process ID in the when running a Sift PM command that has Display the process ID in the when running a Swift PM command that has a hold of the .build directory Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue Good for newcomers Edit
Projects
None yet
2 participants