Skip to content

[swift-stdlib-tool] Add support for back deployed concurrency #39996

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

Conversation

keith
Copy link
Member

@keith keith commented Nov 1, 2021

This tool was mostly already compatible with copying
libswift_Concurrency.dylib based on whether or not the executables it
was scanning linked it. The only thing missing was that it can now end
up copying from different source directories, the older swift-5.0
directory, and the new swift-5.5 directory.

This change allows users to pass --source-libraries multiple times
(or picks a default with both) in order to have it scan both directories
for any libraries the app links. The biggest part of this change is
instead of storing just the library name throughout this logic we now
store the actual discovered path, so that we don't have to loop through
all potential source directories each time we need to find the library,
only the first time.

https://forums.swift.org/t/swift-concurrency-back-deployment/51908/36

This tool was mostly already compatible with copying
`libswift_Concurrency.dylib` based on whether or not the executables it
was scanning linked it. The only thing missing was that it can now end
up copying from different source directories, the older `swift-5.0`
directory, and the new `swift-5.5` directory.

This change allows users to pass `--source-libraries` multiple times
(or picks a default with both) in order to have it scan both directories
for any libraries the app links. The biggest part of this change is
instead of storing just the library name throughout this logic we now
store the actual discovered path, so that we don't have to loop through
all potential source directories each time we need to find the library,
only the first time.
@keith
Copy link
Member Author

keith commented Nov 1, 2021

Unlike Xcode's internal implementation of this I didn't put this behind another flag (depending on if folks are using the default --source-libraries or not) because I didn't see a huge reason to do that. I'd be curious if I'm missing some case though

@keith
Copy link
Member Author

keith commented Nov 1, 2021

FYI @DougGregor @allevato

@DougGregor
Copy link
Member

@swift-ci please test

Copy link
Member

@allevato allevato left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this, Keith!

@DougGregor
Copy link
Member

@swift-ci please smoke test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

This all looks good to me.

@keith
Copy link
Member Author

keith commented Nov 2, 2021

thanks! once this lands I'll submit a cherry pick for 5.5

@CodaFi
Copy link
Contributor

CodaFi commented Nov 3, 2021

@CodaFi CodaFi merged commit 2f2fc23 into swiftlang:main Nov 3, 2021
@keith keith deleted the ks/swift-stdlib-tool-add-support-for-back-deployed-concurrency branch November 3, 2021 18:06
@keith
Copy link
Member Author

keith commented Nov 3, 2021

Thanks all!

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.

4 participants