Brendonovich / prisma-client-rust

Type-safe database access for Rust
https://prisma.brendonovich.dev
Apache License 2.0
1.76k stars 104 forks source link

Can't execute the installation #254

Closed FelipeSharkao closed 1 year ago

FelipeSharkao commented 1 year ago

Recently, I'm not able to use the package, due to an error in the installation. To reproduce it, I tried the following commands:

$ cargo new prisma-test --lib
$ cd prisma-test
$ cargo add prisma-client-rust --git https://github.com/Brendonovich/prisma-client-rust --tag 0.6.4 --no-default-features -F mongodb
$ cargo add prisma-client-rust-cli --git https://github.com/Brendonovich/prisma-client-rust --tag 0.6.4 --no-default-features -F mongodb
$ cargo add serde
$ cargo b

But cargo b outputted:

    Updating git repository `https://github.com/Brendonovich/prisma-client-rust`
    Updating crates.io index
    Updating git repository `https://github.com/Brendonovich/prisma-engines`
error: no matching package found
searched package name: `dml`
perhaps you meant:      psl
location searched: https://github.com/Brendonovich/prisma-engines?rev=6bad339fc5b8bbc77e028eeae2038cf2ade2e6be
required by package `prisma-client-rust v0.6.4 (https://github.com/Brendonovich/prisma-client-rust?tag=0.6.4#1d1cedde)`
    ... which satisfies git dependency `prisma-client-rust` of package `prisma-test v0.1.0 (/home/felipe/Downloads/prisma-test)`

The Cargo.toml that cargo generated is:

[package]
name = "prisma-test"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
prisma-client-rust = { git = "https://github.com/Brendonovich/prisma-client-rust", tag = "0.6.4", version = "0.6.4", default-features = false, features = ["mongodb"] }
prisma-client-rust-cli = { git = "https://github.com/Brendonovich/prisma-client-rust", tag = "0.6.4", version = "0.6.4", default-features = false, features = ["mongodb"] }
serde = "1.0.152"

This is happening consistently. Figuring that this could be a problem with my cargo, I tried cleaning the folders git and registry in the ~/.cargo, but it didn't help. I didn't see any information about this, so I believe it's an issue with my setup. Any information on this would be helpful.

Brendonovich commented 1 year ago

Hmm, the only weird thing I can see is version = 0.6.4. PCR isn't on crates.io, so that field shouldn't be specified.

FelipeSharkao commented 1 year ago

I tried removing it, just to make sure. With the following Cargo.toml:

[package]
name = "prisma-test"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
prisma-client-rust = { git = "https://github.com/Brendonovich/prisma-client-rust", tag = "0.6.4", default-features = false, features = ["mongodb"] }
prisma-client-rust-cli = { git = "https://github.com/Brendonovich/prisma-client-rust", tag = "0.6.4", default-features = false, features = ["mongodb"] }
serde = "1.0.152"

cargo b yields the same results:

$ cargo b
    Updating git repository `https://github.com/Brendonovich/prisma-client-rust`
    Updating crates.io index
    Updating git repository `https://github.com/Brendonovich/prisma-engines`
error: no matching package found
searched package name: `dml`
perhaps you meant:      psl
location searched: https://github.com/Brendonovich/prisma-engines?rev=6bad339fc5b8bbc77e028eeae2038cf2ade2e6be
required by package `prisma-client-rust v0.6.4 (https://github.com/Brendonovich/prisma-client-rust?tag=0.6.4#1d1cedde)`
    ... which satisfies git dependency `prisma-client-rust` of package `prisma-test v0.1.0 (/home/felipe/Downloads/prisma-test)
Brendonovich commented 1 year ago

Hmm, can you provide some more details - OS, Rust version etc?

FelipeSharkao commented 1 year ago

It's an Ubuntu 20.04 (technically Zorin, but usually it doesn't matters), Rust 1.62.0

$ uname -a
Linux Felipe-Lenovo 5.15.0-58-generic #64~20.04.1-Ubuntu SMP Fri Jan 6 16:42:31 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
$ cargo --version
cargo 1.62.0 (a748cf5a3 2022-06-08)
$ rustc --version
rustc 1.62.0 (a8314ef7d 2022-06-27)

I tried updating it to 1.67.1 (with rustup) and it worked. Is there a version restriction?

Brendonovich commented 1 year ago

I guess there is, will have to document it. I think 1.64/5 should work too.

FelipeSharkao commented 1 year ago

I think this can be close then, my problem is already solved, thank you