Skip to content

Conversation

@jamestut
Copy link
Contributor

Currently, the argument passed to swiftc is hardcoded as -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/. This causes SourceKit-LSP to fail if Xcode is installed in a different path (e.g., beta versions of Xcode). Instead of hardcoding the path, infer it dynamically using xcode-select -p.

The only potential issue this change could introduce is if the user has the Command Line Developer Tools (CLDT) set as the default rather than Xcode. However, I don't think that's problematic because:

  • CLDT also has its own copy of MacOSX.platform.
  • In my experience, Xcode updates xcode-select to its own path when it gets updated.
  • I don't anticipate xcode-select reverting to CLDT, except perhaps if the user installs Homebrew using the installer script after installing Xcode.

@SolaWing
Copy link
Owner

Thank you very much for your contribution, I left a small comment. Overall very good

@SolaWing
Copy link
Owner

LGTM, Thanks for your contribution

@SolaWing SolaWing merged commit 5d1012c into SolaWing:master Jul 15, 2025
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