project-robius / robrix

A Matrix chat client written in pure Rust using the Makepad UI toolkit and the Robius app dev framework
MIT License
67 stars 11 forks source link

Attempting to compile source gives unstable features errors #94

Closed smarizvi110 closed 1 month ago

smarizvi110 commented 1 month ago
error[E0658]: use of unstable library feature 'stdsimd'
  --> /home/$USER/.cargo/registry/src/index.crates.io-6f17d22bba15001f/curve25519-dalek-4.1.3/src/backend/vector/ifma/field.rs:26:5
   |
26 |     _mm256_madd52lo_epu64(z.into(), x.into(), y.into()).into()
   |     ^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #48556 <https://github.com/rust-lang/rust/issues/48556> for more information
   = help: add `#![feature(stdsimd)]` to the crate attributes to enable

error[E0658]: use of unstable library feature 'stdsimd'
  --> /home/$USER/.cargo/registry/src/index.crates.io-6f17d22bba15001f/curve25519-dalek-4.1.3/src/backend/vector/ifma/field.rs:25:9
   |
25 |     use core::arch::x86_64::_mm256_madd52lo_epu64;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #48556 <https://github.com/rust-lang/rust/issues/48556> for more information
   = help: add `#![feature(stdsimd)]` to the crate attributes to enable

error[E0658]: use of unstable library feature 'stdsimd'
  --> /home/$USER/.cargo/registry/src/index.crates.io-6f17d22bba15001f/curve25519-dalek-4.1.3/src/backend/vector/ifma/field.rs:34:5
   |
34 |     _mm256_madd52hi_epu64(z.into(), x.into(), y.into()).into()
   |     ^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #48556 <https://github.com/rust-lang/rust/issues/48556> for more information
   = help: add `#![feature(stdsimd)]` to the crate attributes to enable

error[E0658]: use of unstable library feature 'stdsimd'
  --> /home/$USER/.cargo/registry/src/index.crates.io-6f17d22bba15001f/curve25519-dalek-4.1.3/src/backend/vector/ifma/field.rs:33:9
   |
33 |     use core::arch::x86_64::_mm256_madd52hi_epu64;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #48556 <https://github.com/rust-lang/rust/issues/48556> for more information
   = help: add `#![feature(stdsimd)]` to the crate attributes to enable

error[E0635]: unknown feature `stdarch_x86_avx512`
  --> /home/$USER/.cargo/registry/src/index.crates.io-6f17d22bba15001f/curve25519-dalek-4.1.3/src/lib.rs:19:13
   |
19 |     feature(stdarch_x86_avx512)
   |             ^^^^^^^^^^^^^^^^^^

   Compiling growable-bloom-filter v2.1.0
   Compiling flate2 v1.0.30
   Compiling rusqlite v0.30.0
   Compiling event-listener v5.3.1
   Compiling makepad-live-compiler v0.5.0 (https://github.com/kevinaboos/makepad?branch=rik_with_old_font_stack#149b4c28)
   Compiling tokio-rustls v0.26.0
   Compiling hyper-util v0.1.6
   Compiling matrix-sdk-store-encryption v0.7.0 (https://github.com/matrix-org/matrix-rust-sdk#11d5e568)
   Compiling deadpool-sync v0.1.4
Some errors have detailed explanations: E0635, E0658.
For more information about an error, try `rustc --explain E0635`.
error: could not compile `curve25519-dalek` (lib) due to 5 previous errors
warning: build failed, waiting for other jobs to finish...

Had tried initially by installing the nightly toolchain in my system despite the presence of rust_toolchain.toml which would override what toolchain is used,

$ rustup install nightly
$ rustup default nightly

removing and adding cargo as a component,

$ rustup component remove cargo # Strangely this did not work as cargo was never added as a component initially
$ rustup component add cargo

Updating cargo and building from a clean directory

$ cargo update
$ cargo clean

None of this worked, however. I then disabled the rust-analyzer extension in VScode and it seemed to work. Interestingly, repeating the same steps on another machine, Linux again, did not allow compilation. I'm not sure what the issue is here, perhaps something to do with the extension not using the toolchain that the .toml file lists here or some issue with rustup, but it really does make compiling this project more difficult than it should be...

smarizvi110 commented 1 month ago

Decided to give it another shot on the system where I got it to work after disabling the extension and going through its docs again. Setting the RUSTUP_TOOLCHAIN environment variable for the extension as demonstrated here lets you use rust-analyzer and let's you compile too. Perhaps an attempt to replicate this issue and apparent solution on a fresh system (like WSL or the like) is in order so it may be added to the README?

kevinaboos commented 1 month ago

Sorry I'm not clear what the issue is here -- can you explain what you were trying to do when you encountered the errors shown at the very beginning of this issue?

Robrix doesn't require any special nightly features to build -- you should be able to use the stable toolchain to build it.

smarizvi110 commented 1 month ago

Sorry I'm not clear what the issue is here -- can you explain what you were trying to do when you encountered the errors shown at the very beginning of this issue?

Robrix doesn't require any special nightly features to build -- you should be able to use the stable toolchain to build it.

I was just trying to compile after cloning the repo initially. As for Robrix not needing a special toolchain, I wasn't aware of that actually. The rust_toolchain.toml file made me think that only the specific toolchain mentioned in the file was to be used. Thank you!

kevinaboos commented 1 month ago

The rust_toolchain.toml file made me think that only the specific toolchain mentioned in the file was to be used

oh gosh, I didn't realize that was in there. That file should not be there, that must have accidentally been copied in from another project. Oops!

But in any case, the nightly version accidentally specified in the rust-toolchain.toml file does actually build Robrix correctly, so you wouldn't get those errors above unless you manually forced it to a different rust version.

I've changed the file to specify the stable channel toolchain now. Thanks!

smarizvi110 commented 1 month ago

Awesome! Glad this could get resolved so easily!