This repository was archived by the owner on Feb 28, 2023. It is now read-only.
WIP: See if CI passes with fixes to futures 0.3 migration#34
Closed
Xanewok wants to merge 8 commits intobernhard-futures-migrationfrom
Closed
WIP: See if CI passes with fixes to futures 0.3 migration#34Xanewok wants to merge 8 commits intobernhard-futures-migrationfrom
Xanewok wants to merge 8 commits intobernhard-futures-migrationfrom
Conversation
Since Tokio 0.2, spawning the `tokio::process::Command` must be done in the Tokio context, so make sure to spawn the compilation root task in the Tokio runtime that's now available in the `SccacheService`. This fixes a hang in the `sccache_cargo` integration test.
It seems entirely synchronous, as it doesn't hit any await points and additionally seems to be trigger-happy with mutex locks in inner calls, so better be safe and prevent the future reader from thinking that this function is async-safe.
The reason for that being not to mix the Tokio runtime and the `futures` executor. While it's reasonable and possible to do so, I believe there's bigger benefit for now to stick to a single executor. It would be great if we could keep the code using 'vanilla' `futures` crate but Tokio support is so baked in (e.g. child process harness) that it seems that it'd require a lot more change for questionable benefit in this case. Doing so may yield another benefit - currently, there seems to be a lot of disk I/O being done on a dedicated, blocking thread pool. It's possible, now that we use a single executor, to use Tokio facilities for async I/O if this proves to be faster when supported properly by the native environment at some point (e.g. with `io_uring` on Linux).
7da341a to
788832b
Compare
3 tasks
Contributor
|
🎉 |
Contributor
|
@Xanewok I'd be happy to merge this and then move onto refactoring the commits into viable chunks |
Contributor
Author
|
Superseded by #33. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #33.
Let's see if CI gods are merciful