FyroxEngine / Fyrox

3D and 2D game engine written in Rust
https://fyrox.rs
MIT License
7.65k stars 345 forks source link

Cannot build with nightly rustc #316

Closed NCrashed closed 2 years ago

NCrashed commented 2 years ago

Hi, I struggle to build examples cargo run --example simple.

Platform: nightly-x86_64-unknown-linux-gnu Version: rustc 1.62.0-nightly (52ca603da 2022-04-12) Commit: 2f85940753bf5a084ffc24f6c500e823885b1841

error[E0428]: the name `filter_by_rust_version` is defined multiple times
   --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/strum_macros-0.24.0/src/macros/from_repr.rs:121:9
    |
116 |         fn filter_by_rust_version(_: TokenStream) -> TokenStream {
    |         -------------------------------------------------------- previous definition of the value `filter_by_rust_version` here
...
121 |         fn filter_by_rust_version(s: TokenStream) -> TokenStream {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `filter_by_rust_version` redefined here
    |
    = note: `filter_by_rust_version` must be defined only once in the value namespace of this block

error[E0428]: the name `try_from_str` is defined multiple times
   --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/strum_macros-0.24.0/src/macros/strings/from_string.rs:127:1
    |
116 | / fn try_from_str(
117 | |     _name: &proc_macro2::Ident,
118 | |     _impl_generics: &syn::ImplGenerics,
119 | |     _ty_generics: &syn::TypeGenerics,
...   |
123 | |     Default::default()
124 | | }
    | |_- previous definition of the value `try_from_str` here
...
127 | / fn try_from_str(
128 | |     name: &proc_macro2::Ident,
129 | |     impl_generics: &syn::ImplGenerics,
130 | |     ty_generics: &syn::TypeGenerics,
...   |
142 | |     }
143 | | }
    | |_^ `try_from_str` redefined here
    |
    = note: `try_from_str` must be defined only once in the value namespace of this module

error: /home/user/dev/Fyrox/target/debug/deps/librustversion-e67a322b869b9b50.so: undefined symbol: __tsan_init
   --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/strum_macros-0.24.0/src/macros/from_repr.rs:115:11
    |
115 |         #[rustversion::before(1.46)]
    |           ^^^^^^^^^^^

error: cannot determine resolution for the attribute macro `rustversion::before`
   --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/strum_macros-0.24.0/src/macros/from_repr.rs:115:11
    |
115 |         #[rustversion::before(1.46)]
    |           ^^^^^^^^^^^^^^^^^^^
    |
    = note: import resolution is stuck, try simplifying macro imports

error: /home/user/dev/Fyrox/target/debug/deps/librustversion-e67a322b869b9b50.so: undefined symbol: __tsan_init
   --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/strum_macros-0.24.0/src/macros/from_repr.rs:120:11
    |
120 |         #[rustversion::since(1.46)]
    |           ^^^^^^^^^^^

error: cannot determine resolution for the attribute macro `rustversion::since`
   --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/strum_macros-0.24.0/src/macros/from_repr.rs:120:11
    |
120 |         #[rustversion::since(1.46)]
    |           ^^^^^^^^^^^^^^^^^^
    |
    = note: import resolution is stuck, try simplifying macro imports

error: /home/user/dev/Fyrox/target/debug/deps/librustversion-e67a322b869b9b50.so: undefined symbol: __tsan_init
   --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/strum_macros-0.24.0/src/macros/strings/from_string.rs:115:3
    |
115 | #[rustversion::before(1.34)]
    |   ^^^^^^^^^^^

error: cannot determine resolution for the attribute macro `rustversion::before`
   --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/strum_macros-0.24.0/src/macros/strings/from_string.rs:115:3
    |
115 | #[rustversion::before(1.34)]
    |   ^^^^^^^^^^^^^^^^^^^
    |
    = note: import resolution is stuck, try simplifying macro imports

error: /home/user/dev/Fyrox/target/debug/deps/librustversion-e67a322b869b9b50.so: undefined symbol: __tsan_init
   --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/strum_macros-0.24.0/src/macros/strings/from_string.rs:126:3
    |
126 | #[rustversion::since(1.34)]
    |   ^^^^^^^^^^^

error: cannot determine resolution for the attribute macro `rustversion::since`
   --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/strum_macros-0.24.0/src/macros/strings/from_string.rs:126:3
    |
126 | #[rustversion::since(1.34)]
    |   ^^^^^^^^^^^^^^^^^^
    |
    = note: import resolution is stuck, try simplifying macro imports

For more information about this error, try `rustc --explain E0428`.
error: could not compile `strum_macros` due to 10 previous errors
mrDIMAS commented 2 years ago

Hi, is it compiles with stable Rust? Fyrox is not guaranteed to be built on nightly, everything is made to work on stable.

NCrashed commented 2 years ago

Stable:

$ cargo build
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `rustc - --crate-name ___ --print=file-names -Z sanitizer=thread --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit status: 1)
  --- stderr
  error: the option `Z` is only accepted on the nightly compiler

Version:

$ rustup default stable
info: using existing install for 'stable-x86_64-unknown-linux-gnu'
info: default toolchain set to 'stable-x86_64-unknown-linux-gnu'

  stable-x86_64-unknown-linux-gnu unchanged - rustc 1.60.0 (7737e0b5c 2022-04-04)
thomas992 commented 2 years ago

You did something to speed up your build time I think link link2

So the rust compiler is being passed "-Zunstable-options -Zemit-artifact-notifications" by something. That something is not the build system.

64kramsystem commented 2 years ago

Strange. I use nightly, and the project compiles fine. I've also built the examples in the cheat book with nightly - all good as well.

64kramsystem commented 2 years ago

It may be worth testing first if the dependency builds correctly:

cargo install cargo-download
cargo download strum=0.24 | tar xvz
cd strum-0.24.0
cargo build

so that Fyrox itself can be ruled out.

mrDIMAS commented 2 years ago

The engine is not being tested on nightly compiler, only with stable. Any issues with nightly builds happens because of instability of the compiler.