bevy icon indicating copy to clipboard operation
bevy copied to clipboard

unresolved import `async_task::Builder`

Open osenberg-x opened this issue 1 year ago • 4 comments

Bevy version

latest

[Optional] Relevant system information

rust version: stable-x86_64-apple-darwin - rustc 1.74.0 os: macos 14.1.2

What you did

run: cargo run --example breakout

What went wrong

error[E0432]: unresolved import async_task::Builder--> /Users/x/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-executor-1.8.0/src/lib.rs:46:18 | 46 | use async_task::{Builder, Runnable}; | ^^^^^^^ noBuilder` in the root | = help: consider importing this struct instead: std::thread::Builder

For more information about this error, try rustc --explain E0432. error: could not compile async-executor (lib) due to previous error warning: build failed, waiting for other jobs to finish...`

osenberg-x avatar Dec 07 '23 12:12 osenberg-x

Manually deleting Cargo.lock solved the issue for me.

Patryk27 avatar Jan 03 '24 16:01 Patryk27

I'm encountering the same problem running cargo run -p ci, but able to build/run breakout just fine. I've tried removing Cargo.lock and target/.

My system is an m3 mac, so there's another difference.

dmlary@m3:~/src/bevy/vendor/bevy> cargo run -p ci
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
     Running `target/debug/ci`
$ cargo fmt --all -- --check
$ cargo clippy --workspace --all-targets --all-features -- -Dwarnings
    Finished dev [unoptimized + debuginfo] target(s) in 0.42s
$ cargo test --target-dir ../../target
   Compiling erased-serde v0.3.25
   Compiling hashbrown v0.14.0
   Compiling serde_json v1.0.94
   Compiling serde_derive v1.0.157
   Compiling thiserror v1.0.40
   Compiling bevy_reflect_derive v0.12.0 (/Users/dmlary/src/bevy/vendor/bevy/crates/bevy_reflect/bevy_reflect_derive)
   Compiling bevy_ecs_macros v0.12.0 (/Users/dmlary/src/bevy/vendor/bevy/crates/bevy_ecs/macros)
   Compiling async-executor v1.8.0
error[E0432]: unresolved import `async_task::Builder`
  --> /Users/dmlary/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-executor-1.8.0/src/lib.rs:46:18
   |
46 | use async_task::{Builder, Runnable};
   |                  ^^^^^^^ no `Builder` in the root
   |
   = help: consider importing this struct instead:
           std::thread::Builder

For more information about this error, try `rustc --explain E0432`.
error: could not compile `async-executor` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...
thread 'main' panicked at tools/ci/src/main.rs:88:18:
Compiler errors of the ECS compile fail tests seem to be different than expected! Check locally and compare rust versions.: command exited with non-zero code `cargo test --target-dir ../../target`: 101
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

dmlary avatar Jan 06 '24 01:01 dmlary

Has this issue been upstreamed to async_executor or async_task?

james7132 avatar Feb 11 '24 23:02 james7132

I'm encountering the same problem running cargo run -p ci, but able to build/run breakout just fine. I've tried removing Cargo.lock and target/.

When running cargo run -p ci, it's running through several projects, some of which are not in the workspace so they don't share the same lock file. Those are the crates/*_compile_fail_tests crates, and you'll need to remove their individual lock files

mockersf avatar Feb 12 '24 15:02 mockersf

Closing this out as this seems like it was a transient issue that was resolvable by just running cargo update in the appropriate places and not something that was actually an issue with Bevy or its dependency tree.

james7132 avatar Mar 23 '24 10:03 james7132