Skip to content

[lldb] Fix layering violation between Host & Platform on the Swift fork #10302

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 2 commits into from
Mar 20, 2025

Conversation

JDevlieghere
Copy link

See llvm#132119 for details.

This moves two functions from Platform to Host:

  1. GetCurrentXcodeToolchainDirectory
  2. GetCurrentCommandLineToolsDirectory.

These two functions caused a layering violation in the Swift fork, which
added a dependency from lldbHost to lldbPlatform. As show by this PR,
there's no need for these two functions to live in Platform, and we
already have similar functions in Host.

We have various layering violations but this one is particularly bad,
because lldb-dap started depending on lldbHost. On the Swift fork, this
library was depending on lldbPlatform which pulled in various Swift
files, which libLLDB needs, but lldb-dap itself does not. We were
missing RPATHs to resume them, so in the current nightly, lldb-dap
crashes because the dynamic loader can't find the missing Swift libs.

rdar://146537366
(cherry picked from commit a5b02a8)
@JDevlieghere JDevlieghere requested a review from a team as a code owner March 19, 2025 22:55
@JDevlieghere
Copy link
Author

@swift-ci test

@JDevlieghere JDevlieghere merged commit b5cb04b into stable/20240723 Mar 20, 2025
2 of 3 checks passed
@JDevlieghere JDevlieghere deleted the jdevlieghere/rdar/146537366 branch March 20, 2025 03:48
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