toadslop/rust-fullstack-demo

Pin Rust toolchain version

Opened this issue · 3 comments

Summary

I suspect my Rust toolchain is not up-to-date enough to build this demo.

That could be fixed by pinning the required Rust toolchain.

Details

Trying to build stuff, I get the following error:

$ cargo run --manifest-path ./database/migration/Cargo.toml
    Updating crates.io index
error: failed to select a version for the requirement `sea-orm = "^0.10.1"`
candidate versions found which didn't match: 0.8.0, 0.7.1, 0.7.0, ...
location searched: crates.io index
required by package `database v0.1.0 (C:\Users\mate\prog\rust-fullstack-demo\database)`

These are the versions of the main components in my Rust toolchain:

cargo 1.59.0 (49d8809dc 2022-02-10)
rustc 1.59.0 (9d1b2106e 2022-02-23)

Sorry about that. I added the toolchain.toml file. To test, I tried setting it up on my Windows machine. I got postgres and the app running ok, so I added some additional details to the README file. Give it another try and let me know what happens.

For reference, I wasn't able to reproduce the error your mentioned above. I had never installed Rust on my windows machine before, so a clean install with the latest stable version seems to be enough to run the project.

Try running rustup upgrade to get the latest version.

I must have had a really old toolchain because the toolchain.toml file still didn't work... I think the totally backwards-compatible way is the rust-toolchain file.

(Once I manually ran rustup update and got 1.65.0, things worked fine afterwards.)

The interesting thing about the error you showed is that it seems cargo wasn’t able to get an up to date crate index. Basically it said it couldn’t find the specified version of sea-orm. Maybe rust itself is backward compatible but something in the crates ecosystem changed such that 1.59.0 is no longer able to update the crate index :/