Skip to content

[5.9] Compute path to swift-plugin-server on demand #6907

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

Merged
merged 1 commit into from
Sep 16, 2023

Conversation

neonichu
Copy link
Contributor

This takes a significant amount of time when the selected Xcode doesn't have a swift-plugin-server executable:

/tmp/exec
❯ time /usr/bin/xcrun --find swift-plugin-server
xcrun: error: sh -c '/Users/neonacho/Downloads/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Users/neonacho/Downloads/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -find swift-plugin-server 2> /dev/null' failed with exit code 17664: (null) (errno=No such file or directory)
xcrun: error: unable to find utility "swift-plugin-server", not a developer tool or in PATH
/usr/bin/xcrun --find swift-plugin-server  0.34s user 0.17s system 32% cpu 1.579 total

Doing this on demand is at least gated on self.buildParameters.toolchain.isSwiftDevelopmentToolchain so it shouldn't happen for the primary usage scenario on macOS.

(cherry picked from commit de8e6e8)

This takes a significant amount of time when the selected Xcode doesn't have a `swift-plugin-server` executable:

```
/tmp/exec
❯ time /usr/bin/xcrun --find swift-plugin-server
xcrun: error: sh -c '/Users/neonacho/Downloads/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Users/neonacho/Downloads/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -find swift-plugin-server 2> /dev/null' failed with exit code 17664: (null) (errno=No such file or directory)
xcrun: error: unable to find utility "swift-plugin-server", not a developer tool or in PATH
/usr/bin/xcrun --find swift-plugin-server  0.34s user 0.17s system 32% cpu 1.579 total
```

Doing this on demand is at least gated on `self.buildParameters.toolchain.isSwiftDevelopmentToolchain` so it shouldn't happen for the primary usage scenario on macOS.

(cherry picked from commit de8e6e8)
@neonichu neonichu self-assigned this Sep 15, 2023
@neonichu neonichu requested a review from tomerd as a code owner September 15, 2023 21:23
@neonichu
Copy link
Contributor Author

@swift-ci please test

@neonichu neonichu added the swift 5.9 This PR targets the 5.9 branch label Sep 15, 2023
@neonichu neonichu merged commit 1c6ef57 into release/5.9 Sep 16, 2023
@neonichu neonichu deleted the on-demand-plugin-server-path-5.9 branch September 16, 2023 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
swift 5.9 This PR targets the 5.9 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants