Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

Cannot compile hello-compute on Windows #186

Closed
jpryne opened this issue Mar 3, 2020 · 9 comments
Closed

Cannot compile hello-compute on Windows #186

jpryne opened this issue Mar 3, 2020 · 9 comments
Labels
bug Something isn't working

Comments

@jpryne
Copy link

jpryne commented Mar 3, 2020

   Compiling wgpu v0.4.0 (C:\Users\jack_\code\WASM\wgpu-rs)
error[E0658]: async fn is unstable
  --> examples\hello-compute\main.rs:4:1
   |
4  | / async fn run() {
5  | |     env_logger::init();
6  | |
7  | |     // For now this just panics if you didn't pass numbers. Could add proper error handling.
...  |
16 | |     println!("Times: {:?}", execute_gpu(numbers).await);
17 | | }
   | |_^
   |
   = note: for more information, see https://github.com/rust-lang/rust/issues/50547

error[E0658]: async/await is unstable
  --> examples\hello-compute\main.rs:16:29
   |
16 |     println!("Times: {:?}", execute_gpu(numbers).await);
   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: for more information, see https://github.com/rust-lang/rust/issues/50547

error[E0658]: async fn is unstable
   --> examples\hello-compute\main.rs:19:1
    |
19  | / async fn execute_gpu(numbers: Vec<u32>) -> Vec<u32> {
20  | |     let slice_size = numbers.len() * std::mem::size_of::<u32>();
21  | |     let size = slice_size as wgpu::BufferAddress;
22  | |
...   |
107 | |     }
108 | | }
    | |_^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/50547

error[E0658]: async/await is unstable
  --> examples\hello-compute\main.rs:99:26
   |
99 |     if let Ok(mapping) = staging_buffer.map_read(0u64, size).await {
   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: for more information, see https://github.com/rust-lang/rust/issues/50547

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0658`.
error: Could not compile `wgpu`.
@grovesNL
Copy link
Collaborator

grovesNL commented Mar 3, 2020

Hi @jpryne, which version of stable Rust are you using? async/await was stabilized in 1.39 (see https://areweasyncyet.rs/). If you have rustup, could you try updating your stable Rust version with rustup update?

@kvark kvark added the bug Something isn't working label Mar 3, 2020
@jpryne
Copy link
Author

jpryne commented Mar 7, 2020

Thank you, grovesNL, for your suggestion. I felt rather foolish, and certain this would solve the issue. Alas, I am still having this problem:
stable-x86_64-pc-windows-msvc updated - rustc 1.41.1 (f3e1a954d 2020-02-24)
nightly-x86_64-pc-windows-msvc updated - rustc 1.43.0-nightly (2890b37b8 2020-03-06)

PS C:\code\WASM\wgpu-rs\examples> cargo run --example hello-compute 1 2 3 4

Compiling wgpu v0.4.0 (C:\code\WASM\wgpu-rs)

error[E0658]: async fn is unstable

@kvark
Copy link
Member

kvark commented Mar 7, 2020

Clearly your build is using a different rustc than what was installed?

@grovesNL
Copy link
Collaborator

grovesNL commented Mar 7, 2020

@jpryne maybe you could try rustup default stable in case your default is set to a specific version

@jpryne
Copy link
Author

jpryne commented Mar 18, 2020

@grovesNL Made sure to set my default rustup to stable, yet am still getting this error.

@grovesNL
Copy link
Collaborator

What happens if you specify the stable toolchain explicitly with cargo +stable run --example hello-compute 1 2 3 4?

@GabrielMajeri
Copy link
Contributor

I've managed to run cargo build --examples successfully on Windows 10 using Rust stable, did not reproduce the issue.

rustc version: rustc 1.42.0 (b8cedc004 2020-03-09)

@jpryne
Copy link
Author

jpryne commented Apr 29, 2020

@grovesNL :

What happens if you specify the stable toolchain explicitly with cargo +stable run --example hello-compute 1 2 3 4?

error: no such subcommand: '+stable'

@GabrielMajeri
I'm sure I'm doing something wrong, but I'm slammed right now. Feel free to close.

@grovesNL
Copy link
Collaborator

@jpryne maybe there is something wrong with your Rust installation and the wrong cargo binary is being used somehow? For example, somebody had a similar problem in rust-lang/rustup#762 (comment)

@kvark kvark closed this as completed Jun 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants