Skip to content

Use tsc_await rather than await #3037

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
Nov 9, 2020
Merged

Conversation

DougGregor
Copy link
Member

@DougGregor DougGregor commented Nov 9, 2020

This is the follow-on to #3036, adopting the new swift-tools-support-core and using tsc_await in lieu of await.

@DougGregor
Copy link
Member Author

@swift-ci please test

@neonichu
Copy link
Contributor

neonichu commented Nov 9, 2020

This will also need to update the vendored copy of TSC in swift-tools-support-core

@abertelrud
Copy link
Contributor

There are probably some new uses of await in open PRs that will need to be adjusted (I remember seeing them in diffs but I don't recall which PRs). But with the deprecated ones still around, we should be able to land them and fix as follow-on, if nothing else.

@DougGregor
Copy link
Member Author

@swift-ci smoke test

@DougGregor
Copy link
Member Author

This will also need to update the vendored copy of TSC in swift-tools-support-core

Yes, I did it in swiftlang/swift-tools-support-core#164

@abertelrud
Copy link
Contributor

abertelrud commented Nov 9, 2020

The failure is addressed by #3038 which will be merged as soon as tests finish. It was the result of two PRs that each passed independently but failed when both merged.

@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@@ -2320,7 +2320,7 @@ extension Workspace {
// way to get it back out of the resolver which is very
// annoying. Maybe we should make an SPI on the provider for
// this?
let container = try await { containerProvider.getContainer(for: package, skipUpdate: true, completion: $0) } as! RepositoryPackageContainer
let container = try tsc_await { containerProvider.getContainer(for: package, skipUpdate: true, completion: $0) } as! RepositoryPackageContainer
guard let tag = container.getTag(for: version) else {
throw StringError("Internal error: please file a bug at https://bugs.swift.org with this info -- unable to get tag for \(package) \(version); available versions \(container.reversedVersions)")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

@abertelrud @neonichu beyond the scope of this PR, but the fact the code [in the above three files] is blocking on what looks to be I/O seems like its worth a deeper look. at a high-level, "asynchronity" should bubble all the way to the "top" and only the UI/CLI call sites should block or use a dispatch queue to synchronize the "effects" where appropriate. Usage in tests is fine to simplify.

@DougGregor DougGregor merged commit ebc47e1 into swiftlang:main Nov 9, 2020
@DougGregor DougGregor deleted the use-tsc-await branch November 9, 2020 23:01
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.

5 participants