Skip to content

SourceKit: sever dependency on TSCUtility #686

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
Jan 3, 2023

Conversation

compnerd
Copy link
Member

@compnerd compnerd commented Jan 2, 2023

The dependency on TSCUtility was strictly for identifying the platform of execution. This logic is relatively self-contained and effectively an extension over an enumeration. Replicate this logic with updates for new syntactic improvements. This allows us to partially reduce dependency on swift-tools-support-core. The dependency on TSCBasic is more complicated to remove due to the extensive use of AbsolutePath.

@compnerd
Copy link
Member Author

compnerd commented Jan 2, 2023

@swift-ci please test

compnerd added a commit to compnerd/swift-tools-support-core that referenced this pull request Jan 2, 2023
This marks the `Platform` type as deprecated.  The functionality has
been split up into swift-package-manager and sourcekit-lsp as
appropriate.  There remain no users of this at this point.

swiftlang/sourcekit-lsp#686
swiftlang/swift-package-manager#6011
Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s a shame we need to duplicate the logic but if we want to get rid of the TSC it’s something we just have to do 😢

import XCTest

import enum TSCUtility.Platform
import class TSCBasic.Process
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come we need to import TSCBasic.Process where we didn’t need to import it before?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because TSCUtility dragged it along for us. Something something @_implementationOnly all the things and explicit imports.

@compnerd
Copy link
Member Author

compnerd commented Jan 2, 2023

Yes, except, it seems that this functionality is used only in LSP. The other piece of the interface is in SPM only. As a result we can split it up this way and deprecate it in TSC.

The dependency on `TSCUtility` was strictly for identifying the platform
of execution. This logic is relatively self-contained and effectively an
extension over an enumeration. Replicate this logic with updates for new
syntactic improvements. This allows us to partially reduce dependency on
swift-tools-support-core. The dependency on TSCBasic is more complicated
to remove due to the extensive use of `AbsolutePath`.

Co-authored-by: Alex Hoppen <[email protected]>
@compnerd
Copy link
Member Author

compnerd commented Jan 2, 2023

@swift-ci please test

@compnerd
Copy link
Member Author

compnerd commented Jan 2, 2023

swiftlang/swift-package-manager#6011
swiftlang/swift-tools-support-core#378

Are the other parts of this change that together deprecate TSCUtility.Platform. It really is unfortunate that the symbol has to be public as it is used across multiple modules.

@compnerd
Copy link
Member Author

compnerd commented Jan 3, 2023

@swift-ci please test macOS platform

@compnerd compnerd merged commit f857dbf into swiftlang:main Jan 3, 2023
@compnerd compnerd deleted the utility branch January 3, 2023 17:02
compnerd added a commit to swiftlang/swift-tools-support-core that referenced this pull request Jan 30, 2023
This marks the `Platform` type as deprecated.  The functionality has
been split up into swift-package-manager and sourcekit-lsp as
appropriate.  There remain no users of this at this point.

swiftlang/sourcekit-lsp#686
swiftlang/swift-package-manager#6011
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