Skip to content

Compute path to swift-plugin-server on demand #6899

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 15, 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.

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.
@neonichu neonichu self-assigned this Sep 14, 2023
@neonichu
Copy link
Contributor Author

@swift-ci please test

@neonichu neonichu merged commit de8e6e8 into main Sep 15, 2023
@neonichu neonichu deleted the on-demand-plugin-server-path branch September 15, 2023 16:33
@tomerd
Copy link
Contributor

tomerd commented Sep 15, 2023

should we cherry pick this to 5.9 as well?

@neonichu
Copy link
Contributor Author

#6907

MaxDesiatov pushed a commit that referenced this pull request Sep 28, 2023
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.
MaxDesiatov pushed a commit that referenced this pull request Sep 28, 2023
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.
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.

2 participants