leptos-rs / cargo-leptos

Build tool for Leptos (Rust)
MIT License
314 stars 87 forks source link

Issue with `ahash` library v0.7.7 (unknown feature `stdsimd`) #250

Open vikingSec opened 3 months ago

vikingSec commented 3 months ago

Hello!

I'm trying to learn Leptos (as in, I've never built a thing with it, so bear with me) and while trying to install cargo-leptos (and trunk) I ran into this error involving the installation of ahash v0.7.7:

error[E0635]: unknown feature `stdsimd`
  --> /Users/medwards/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ahash-0.7.7/src/lib.rs:33:42
   |
33 | #![cfg_attr(feature = "stdsimd", feature(stdsimd))]
   |                                          ^^^^^^^

   Compiling socket2 v0.5.5
For more information about this error, try `rustc --explain E0635`.
error: could not compile `ahash` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-leptos v0.2.7`, intermediate artifacts can be found at `/var/folders/9f/w50rg2wj193fh6jv5rt0lk1r0000gn/T/cargo-installXUxpU2`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

There's already an open issue on the aHash repo, but honestly I don't understand the problem well enough to know if this is an aHash problem or a cargo-leptos problem. My assumption was that it's something that cargo-leptos can fix since it looks like it depends on v0.7.7 of aHash and the most recent version of aHash is v0.8.7

Bayernatoor commented 3 months ago

Ran into the same issue. I am running rust nightly atm. Switching to stable allowed me to install cargo-leptos but switching back to nightly and running cargo leptos watch starts compiling but eventually results in the same error with ahash.

Phosphorus-M commented 3 months ago

This command works for me

cargo update ahash@0.8
Bayernatoor commented 3 months ago

This command works for me

cargo update ahash@0.8

Problem seems to be with the ahash version being used by cargo-leptos and not the local version of cargo. I still get the error and it's coming from cargo-leptos, ahash likely needs a bump.

benwis commented 3 months ago

If you’d like to pr a bump for that and test it, I’d be happy to merge it in

On Tue, Feb 13, 2024, at 4:03 PM, Bayer wrote:

This command works for me

cargo update ***@***.*** Problem seems to be with the ahash version being used by cargo-leptos and not the local version of cargo. I still get the error and it's coming from cargo-leptos, ahash likely needs a bump.

— Reply to this email directly, view it on GitHub https://github.com/leptos-rs/cargo-leptos/issues/250#issuecomment-1942877552, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVBTCJ3NIOK7BNEIIYNJLLYTP5LXAVCNFSM6AAAAABC42M522VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBSHA3TONJVGI. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Bayernatoor commented 3 months ago

Yep sounds good, just forked the repo and will see if I can get it working.

gitmalong commented 3 months ago

Workaround cargo install cargo-leptos --version 0.2.6

Chief-Detektor commented 2 months ago

Once the repo has been checked out one can run cargo update and ahash is updated to 0.7.8 which builds under nightly.

benwis commented 2 months ago

Once the repo has been checked out one can run cargo update and ahash is updated to 0.7.8 which builds under nightly.

So the repo is up to date for this? If so I can release a new patch version

Chief-Detektor commented 2 months ago

So the repo is up to date for this? If so I can release a new patch version

I would assume this is the case. All I did to make it compile with the latest nightly was to checkout the default branch and after it failed building I ran cargo update and then it built. You can test it locally to verify.