Skip to content
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

Use only the debug settings from the most-downstream Swift target #3073

Conversation

brentleyjones
Copy link
Contributor

@brentleyjones brentleyjones commented Aug 14, 2024

This prevents settings which are specific to a particular Swift module compilation, such as clang module maps in a mixed-language library, from getting accumulated with the public settings. Before this change using mixed_language_library would result in module redefinition errors in lldb.

I’m not sure if this has a chance of not setting some flags that would need to be set. In local testing everything worked, but as with all things lldb, wider user testing is needed. Ideally long term we can use serialized debug info instead (and/or explicit modules).

Note: For this to work the best, the single dep of a top-level target needs to be a swift_library or mixed_language_target. This change might result in lldb regressions for custom setups that don't meet that requirement.

This prevents settings which are specific to a particular Swift module compilation, such as clang module maps in a mixed-language library, from getting accumulated with the public settings. Before this change using `mixed_language_library` would result in module redefinition errors in lldb.

I’m not sure if this has a chance of not setting some flags that would need to be set. In local testing everything worked, but as with all things lldb, wider user testing is needed. Ideally long term we can use serialized debug info instead (and/or explicit modules).

Signed-off-by: Brentley Jones <[email protected]>
@brentleyjones brentleyjones requested a review from a team as a code owner August 14, 2024 15:10
Copy link
Contributor

@thiagohmcruz thiagohmcruz left a comment

Choose a reason for hiding this comment

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

Some Qs mostly so I understand the changes better. Would it help at all to run tests on a repo not using the mixed library stuff? Let me know and I can run some tests in this SHA.

@brentleyjones
Copy link
Contributor Author

Found an issue with the current way this is done, but have a plan to fix it. Going to work on that before merging.

Signed-off-by: Brentley Jones <[email protected]>
@brentleyjones
Copy link
Contributor Author

Added a note instead since a proper fix is too hard/inefficent.

@brentleyjones brentleyjones merged commit 4d750eb into main Aug 20, 2024
17 checks passed
@brentleyjones brentleyjones deleted the bj/use-only-the-debug-settings-from-the-most-downstream-swift-target branch August 20, 2024 18:15
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