Skip to content

Does not work on rust 1.43 #5

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

Closed
aboutqx opened this issue Feb 26, 2020 · 17 comments
Closed

Does not work on rust 1.43 #5

aboutqx opened this issue Feb 26, 2020 · 17 comments

Comments

@aboutqx
Copy link

aboutqx commented Feb 26, 2020

Compiling cfg-if v0.1.10
Compiling rand_core v0.4.2
Compiling rustc-demangle v0.1.16
Compiling rawpointer v0.1.0
Compiling sourcefile v0.1.4
Compiling itoa v0.4.5
Compiling num-traits v0.2.11
Compiling num-complex v0.2.4
Compiling proc-macro2 v1.0.9
Compiling syn v1.0.16
Compiling backtrace-sys v0.1.32
Compiling winapi v0.3.8
error[E0463]: can't find crate for core
|
= note: the wasm32-unknown-unknown target may not be installed
can this be fixed ??

@aboutqx
Copy link
Author

aboutqx commented Feb 26, 2020

btw, cargo install command seems changes. cargo install -f wsam-bindgen-cli --version 0.2.29 works.

@chinedufn
Copy link
Owner

Thanks! 1a3bd0a

@aboutqx
Copy link
Author

aboutqx commented Feb 27, 2020

Would you please share some information about running this on windows?
Just new to rust, can't figure out why building on win fails.

@chinedufn
Copy link
Owner

Oh sorry I thought you had it working.

What error are you seeing?

@chinedufn chinedufn reopened this Feb 27, 2020
@chinedufn
Copy link
Owner

Oh whoops now I see - run this:

rustup target add wasm32-unknown-unknown

Does that work?

@aboutqx
Copy link
Author

aboutqx commented Feb 28, 2020

It helps,the before errors disappear,get some grammar error.

Compiling web-sys v0.3.6
Compiling nalgebra v0.16.12
error[E0502]: cannot borrow *self as immutable because it is also borrowed as mutable
--> C:\Users\Administrator.cargo\registry\src\mirrors.ustc.edu.cn-61ef6e0cd06fb9b8\nalgebra-0.16.12\src\base\cg.rs:291:44
|
291 | self[(j, i)] += shift[j] * self[(D::dim() - 1, i)];
| ---------------------------^^^^-------------------
| | |
| | immutable borrow occurs here
| mutable borrow occurs here
| mutable borrow later used here

error[E0502]: cannot borrow *self as immutable because it is also borrowed as mutable
--> C:\Users\Administrator.cargo\registry\src\mirrors.ustc.edu.cn-61ef6e0cd06fb9b8\nalgebra-0.16.12\src\base\cg.rs:291:44
|
291 | self[(j, i)] += shift[j] * self[(D::dim() - 1, i)];
| ---------------------------^^^^-------------------
| | |
| | immutable borrow occurs here
| mutable borrow occurs here
| mutable borrow later used here

For more information about this error, try rustc --explain E0502.

my rust version is rustc 1.41.0 (5e1a79984 2020-01-27)
It seems that nalgebra package doesn't work.
What about upgrading the nalgebra package version?

@aboutqx
Copy link
Author

aboutqx commented Feb 28, 2020

dimforge/nalgebra#616
The new version fixed this.
How can i get it all upgraded?
blender-armature = "0.2.0" blender-mesh = "0.4.6" still use the old nalgebra.

@chinedufn
Copy link
Owner

chinedufn commented Feb 28, 2020

Want to try adding nalgebra as a patch dependency to the tutorial's `Cargo.toml1? Does that work?

Something like:

[patch.crates-io]
nalgebra = "=0.16.3"

https://doc.rust-lang.org/edition-guide/rust-2018/cargo-and-crates-io/replacing-dependencies-with-patch.html

@aboutqx
Copy link
Author

aboutqx commented Feb 28, 2020

try [patch.crates-io] nalgebra = { path = "C:/Users/Administrator/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/nalgebra-0.19.0" }
Compile completes.
Still get errors.

Compiling webgl-water-tutorial v0.1.0 (D:\Github\webgl-water-tutorial)
error: failed to run custom build command for webgl-water-tutorial v0.1.0 (D:\Github\webgl-water-tutorial)

Caused by:
process didn't exit successfully: D:\Github\webgl-water-tutorial\target\debug\build\webgl-water-tutorial-6f123690d1e023a9\build-script-build (exit code: 101)
--- stdout
cargo:rerun-if-changed=./terrain.blend
cargo:rerun-if-changed=./bird.blend

--- stderr
thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "系统找不到指定的文件。" }', src\libcore\result.rs:1188:5
stack backtrace:
0: backtrace::backtrace::trace_unsynchronized
at C:\Users\VssAdministrator.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.40\src\backtrace\mod.rs:66
1: std::sys_common::backtrace::_print_fmt
at /rustc/5e1a799842ba6ed4a57e91f7ab9435947482f7d8/src\libstd\sys_common\backtrace.rs:84
2: std::sys_common::backtrace::_print::{{impl}}::fmt
at /rustc/5e1a799842ba6ed4a57e91f7ab9435947482f7d8/src\libstd\sys_common\backtrace.rs:61
3: core::fmt::write
at /rustc/5e1a799842ba6ed4a57e91f7ab9435947482f7d8/src\libcore\fmt\mod.rs:1025
4: std::io::Write::write_fmtstd::sys::windows::stdio::Stderr
at /rustc/5e1a799842ba6ed4a57e91f7ab9435947482f7d8/src\libstd\io\mod.rs:1426
5: std::sys_common::backtrace::_print
at /rustc/5e1a799842ba6ed4a57e91f7ab9435947482f7d8/src\libstd\sys_common\backtrace.rs:65
6: std::sys_common::backtrace::print
at /rustc/5e1a799842ba6ed4a57e91f7ab9435947482f7d8/src\libstd\sys_common\backtrace.rs:50
7: std::panicking::default_hook::{{closure}}
at /rustc/5e1a799842ba6ed4a57e91f7ab9435947482f7d8/src\libstd\panicking.rs:193
8: std::panicking::default_hook
at /rustc/5e1a799842ba6ed4a57e91f7ab9435947482f7d8/src\libstd\panicking.rs:210
9: std::panicking::rust_panic_with_hook
at /rustc/5e1a799842ba6ed4a57e91f7ab9435947482f7d8/src\libstd\panicking.rs:471
10: std::panicking::begin_panic_handler
at /rustc/5e1a799842ba6ed4a57e91f7ab9435947482f7d8/src\libstd\panicking.rs:375
11: core::panicking::panic_fmt
at /rustc/5e1a799842ba6ed4a57e91f7ab9435947482f7d8/src\libcore\panicking.rs:84
12: core::result::unwrap_failed
at /rustc/5e1a799842ba6ed4a57e91f7ab9435947482f7d8/src\libcore\result.rs:1188
13: core::result::Result<std::process::Output, std::io::error::Error>::unwrapstd::process::Output,std::io::error::Error
at /rustc/5e1a799842ba6ed4a57e91f7ab9435947482f7d8\src\libcore\result.rs:956
14: build_script_build::main
at .\build.rs:33

While Blender is truely in my path.

@aboutqx
Copy link
Author

aboutqx commented Feb 28, 2020

I try to comment the build.rs main function.
It outputs

error[E0061]: this function takes 1 parameter but 0 parameters were supplied
--> src\app\assets\mod.rs:29:18
|
29 | mesh.combine_vertex_indices();
| ^^^^^^^^^^^^^^^^^^^^^^ expected 1 parameter

error[E0599]: no method named set_groups_per_vertex found for type &mut blender_mesh::BlenderMesh in the current scope
--> src\app\assets\mod.rs:33:22
|
33 | mesh.set_groups_per_vertex(4);
| ^^^^^^^^^^^^^^^^^^^^^ method not found in &mut blender_mesh::BlenderMesh

error[E0308]: mismatched types
--> src\render\mesh\skinned_mesh.rs:126:28
|
126 | joint_indices: vec![0, 1, 2, 3, 4, 5, 6, 7, 8],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected &[u8], found struct std::vec::Vec
|
= note: expected reference &[u8]
found struct std::vec::Vec<{integer}>
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: aborting due to 5 previous errors

Looks like the mesh function from bytes have some problems there.

@chinedufn
Copy link
Owner

Gotcha - you just have to change your Cargo.toml to match the repository since the tutorial was written against older versions https://github.com/chinedufn/webgl-water-tutorial/blob/master/Cargo.toml#L13-L14

@aboutqx
Copy link
Author

aboutqx commented Mar 2, 2020

Still got some other grammer errors. Maybe I need to learn more rust first.

@aboutqx
Copy link
Author

aboutqx commented Mar 2, 2020

error[E0557]: feature has been removed
--> src\lib.rs:18:12
|
18 | #![feature(custom_attribute)]
| ^^^^^^^^^^^^^^^^ feature has been removed
|
= note: removed in favor of #![register_tool] and #![register_attr]

@chinedufn
Copy link
Owner

You can just delete that line

@chinedufn chinedufn changed the title windows build error Does not work on rust 1.43 Mar 2, 2020
@chinedufn
Copy link
Owner

I've updated the instructions and the build script to work again fd1e209 .

If you follow the latest instructions in the README everything should work for you.

Let me know if there's an issue! Thanks for surfacing this!

@aboutqx
Copy link
Author

aboutqx commented Mar 2, 2020

Thanks a lot. It finnally got working.
Be glad to see more tutorials about webgl + rust.

@chinedufn
Copy link
Owner

chinedufn commented Mar 2, 2020

You got it!
I wrote a Rust + WebGL physically based rendering tutorial that I'll be publishing in April - take a peek at the blog around then.

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

No branches or pull requests

2 participants