Conversation
|
If you are adding a new tool to mise, note the following:
|
7412bc4 to
c48a2d1
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fully converts the CLI and backend implementations from synchronous to asynchronous execution under Tokio, replacing blocking patterns and Rayon. Key updates include:
- Changing all
run, cache, and backend methods toasync fnand usingasync_traitfor theBackendtrait. - Introducing
cache_asyncand a newget_or_try_init_asyncinCacheManagerfor asynchronous caching. - Refactoring Ubi installation logic into an async free function and updating many backends to use
.await.
Reviewed Changes
Copilot reviewed 156 out of 156 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/cli/alias/*.rs | Converted alias commands’ run to async fn and awaited config fetches |
| src/cache.rs | Added cache_async: OnceCell and get_or_try_init_async |
| src/backend/mod.rs | Annotated Backend trait with async_trait, made core methods async |
| src/backend/vfox.rs | Converted VfoxBackend methods to async/await |
| src/backend/ubi.rs | Extracted Ubi install into async helper (install), removed blocking runtime use |
| src/backend/external_plugin_cache.rs | Made external plugin cache methods async |
| Cargo.toml | Added async-trait and expanded Tokio features |
Comments suppressed due to low confidence (3)
src/backend/vfox.rs:48
- VfoxBackend does not implement
Clone, so callingself.clone()will not compile. Consider capturing anArc<Self>in the async context or derivingCloneforVfoxBackendand ensuring correct ownership.
let this = self.clone();
src/backend/ubi.rs:340
- Calling
block_oninside an async function can deadlock the Tokio runtime. Instead, awaitubi.install_binary().awaitdirectly without usingblock_on.
rt.block_on(async {
src/backend/external_plugin_cache.rs:21
- The signature references
Futurebutstd::future::Futureis not imported. Adduse std::future::Future;or fully qualify the type to avoid compilation errors.
pub async fn list_bin_paths<F, Fut>(
5cedad3 to
1de6385
Compare
e2e/perf/test_many_tasks
|
b46c28f to
89c6f40
Compare
6730661 to
e2d464b
Compare
jdx
pushed a commit
that referenced
this pull request
May 26, 2025
### 🐛 Bug Fixes - output was silenced on task fail with keep-order by [@artemisart](https://github.com/artemisart) in [#5175](#5175) - avoid mapfile to run e2e tests on macOS (bash 3.2) by [@artemisart](https://github.com/artemisart) in [#5170](#5170) - flaky keep-order e2e test by [@artemisart](https://github.com/artemisart) in [#5178](#5178) - watch mise.lock for changes by [@jdx](https://github.com/jdx) in [#5184](#5184) - remote task dependency does not work by [@roele](https://github.com/roele) in [#5183](#5183) - rayon -> tokio by [@jdx](https://github.com/jdx) in [#5172](#5172) - cache results from version host by [@jdx](https://github.com/jdx) in [#5187](#5187) - cache results from version host for aqua packages by [@jdx](https://github.com/jdx) in [#5188](#5188) ### 📚 Documentation - standardize subcommand format to 'u|use' for consistency by [@LuckyWindsck](https://github.com/LuckyWindsck) in [#5167](#5167) - clarify how to enable ideomatic version file reading for ruby by [@amkisko](https://github.com/amkisko) in [#5163](#5163) ### 🧪 Testing - added perf test by [@jdx](https://github.com/jdx) in [#5179](#5179) - skip benchmark errors for now by [@jdx](https://github.com/jdx) in [#5186](#5186) ### Chore - fix clippy issue in xonsh by [@jdx](https://github.com/jdx) in [#5180](#5180) - improve shfmt linter by [@jdx](https://github.com/jdx) in [#5181](#5181) - cargo up by [@jdx](https://github.com/jdx) in [3ece604](3ece604) - fix hyperfine step summary by [@jdx](https://github.com/jdx) in [36ab4a1](36ab4a1) - adjust perf thresholds by [@jdx](https://github.com/jdx) in [4113a3b](4113a3b) ### New Contributors - @amkisko made their first contribution in [#5163](#5163) - @LuckyWindsck made their first contribution in [#5167](#5167)
stanhu
added a commit
to stanhu/mise
that referenced
this pull request
Jun 4, 2025
With the switch from Rayon (parallel processing) to Tokio (async) in jdx#5172, `mise exec` no longer correctly resolves tool versions if `.tool-versions` contains an unknown entry. This occurred because a single failure would cause a hard faliure in the `resolve()` method in `src/toolset/mod.rs`. Fix this by separating successful and unsuccessful results and only failing if nothing was resolved. Relates to jdx#5282
stanhu
added a commit
to stanhu/mise
that referenced
this pull request
Jun 5, 2025
With the switch from Rayon (parallel processing) to Tokio (async) in jdx#5172, `mise exec` no longer correctly resolves tool versions if `.tool-versions` contains an unknown entry. This occurred because a single failure would cause a hard faliure in the `resolve()` method in `src/toolset/mod.rs`. Fix this by separating successful and unsuccessful results and only failing if nothing was resolved. Relates to jdx#5282
stanhu
added a commit
to stanhu/mise
that referenced
this pull request
Jun 5, 2025
With the switch from Rayon (parallel processing) to Tokio (async) in jdx#5172, `mise exec` no longer correctly resolves tool versions if `.tool-versions` contains an unknown entry. This occurred because a single failure would cause a hard faliure in the `resolve()` method in `src/toolset/mod.rs`. Fix this by separating successful and unsuccessful results and only failing if nothing was resolved. Relates to jdx#5282
stanhu
added a commit
to stanhu/mise
that referenced
this pull request
Jun 5, 2025
With the switch from Rayon (parallel processing) to Tokio (async) in jdx#5172, `mise exec` no longer correctly resolves tool versions if `.tool-versions` contains an unknown entry. This occurred because a single failure would cause a hard faliure in the `resolve()` method in `src/toolset/mod.rs`. Fix this by separating successful and unsuccessful results and only failing if nothing was resolved. Relates to jdx#5282
stanhu
added a commit
to stanhu/mise
that referenced
this pull request
Jun 5, 2025
With the switch from Rayon (parallel processing) to Tokio (async) in jdx#5172, `mise exec` no longer correctly resolves tool versions if `.tool-versions` contains an unknown entry. This occurred because a single failure would cause a hard faliure in the `resolve()` method in `src/toolset/mod.rs`. Fix this by separating successful and unsuccessful results and only failing if nothing was resolved. Relates to jdx#5282
stanhu
added a commit
to stanhu/mise
that referenced
this pull request
Jun 5, 2025
With the switch from Rayon (parallel processing) to Tokio (async) in jdx#5172, `mise exec` no longer correctly resolves tool versions if `.tool-versions` contains an unknown entry. This occurred because a single failure would cause a hard faliure in the `resolve()` method in `src/toolset/mod.rs`. Fix this by separating successful and unsuccessful results and only failing if nothing was resolved. Relates to jdx#5282
stanhu
added a commit
to stanhu/mise
that referenced
this pull request
Jun 5, 2025
With the switch from Rayon (parallel processing) to Tokio (async) in jdx#5172, `mise exec` no longer correctly resolves tool versions if `.tool-versions` contains an unknown entry. This occurred because a single failure would cause a hard faliure in the `resolve()` method in `src/toolset/mod.rs`. Fix this by separating successful and unsuccessful results and only failing if nothing was resolved. Relates to jdx#5282
stanhu
added a commit
to stanhu/mise
that referenced
this pull request
Jun 5, 2025
With the switch from Rayon (parallel processing) to Tokio (async) in jdx#5172, `mise exec` no longer correctly resolves tool versions if `.tool-versions` contains an unknown entry. This occurred because a single failure would cause a hard faliure in the `resolve()` method in `src/toolset/mod.rs`. Fix this by setting successful tool resolutions while returning the errors, which can be ignored by the caller. Relates to jdx#5282
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The deadlock issue reported by many people but the cause seems related to using rayon for parallelism. This PR switches to using async rust with tokio which should resolve it.
This is obviously a massive PR so don't be surprised if there is a bug in some untested code path.
Fixes #5149
Fixes #5144
Fixes #4302
Fixes #4127