Skip to content

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Aug 8, 2024

Motivation:

This is going to be used by sourcekit-lsp to build a graph/dictionary
of all the targets and depths they appear during package loading and
replaces the need for topological sort and buildTriple.

Modifications:

  • Introduces a new depthFirstSearch variant which traverses all of the nodes in the graph.
  • Adds a new method to BuildPlan - traverseModules which goes over the graph, computes destinations and returns modules with their parents and depths they appear at (the method looks though products).

Result:

This make it possible to switch sourcekit-lsp away from using topological sort and relying on buildTriple.

Paired with swiftlang/sourcekit-lsp#1621

@xedin
Copy link
Contributor Author

xedin commented Aug 8, 2024

swiftlang/sourcekit-lsp#1621
@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Aug 8, 2024

swiftlang/sourcekit-lsp#1621
@swift-ci please test macOS platform

1 similar comment
@xedin
Copy link
Contributor Author

xedin commented Aug 9, 2024

swiftlang/sourcekit-lsp#1621
@swift-ci please test macOS platform

@xedin xedin force-pushed the build-plan-traverse-modules branch from ed2e021 to e3b64f9 Compare August 9, 2024 05:03
@xedin
Copy link
Contributor Author

xedin commented Aug 9, 2024

swiftlang/sourcekit-lsp#1621
@swift-ci please test macOS platform

@xedin
Copy link
Contributor Author

xedin commented Aug 9, 2024

swiftlang/sourcekit-lsp#1621
@swift-ci please test Linux platform

@xedin
Copy link
Contributor Author

xedin commented Aug 9, 2024

swiftlang/sourcekit-lsp#1621
@swift-ci please test Windows platform

1 similar comment
@xedin
Copy link
Contributor Author

xedin commented Aug 9, 2024

swiftlang/sourcekit-lsp#1621
@swift-ci please test Windows platform

Copy link
Contributor

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

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

LGTM, only coding style, typo, and test organization nits.

xedin added 2 commits August 9, 2024 11:09
…for all modules

This is going to be used by sourcekit-lsp to build a graph/dictionary
of all the targets and depths they appear during package loading and
replaces the need for topological sort and `buildTriple`.
@xedin xedin force-pushed the build-plan-traverse-modules branch from e3b64f9 to 1b352ac Compare August 9, 2024 18:48
@xedin
Copy link
Contributor Author

xedin commented Aug 9, 2024

swiftlang/sourcekit-lsp#1621
@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Aug 9, 2024

swiftlang/sourcekit-lsp#1621
@swift-ci please test Windows platform

@xedin xedin merged commit 74f06f8 into swiftlang:main Aug 9, 2024
5 checks passed
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