Brendonovich / prisma-client-rust

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

On arch-based linux (endeavourOS), query-engine.tz can't be downloaded #360

Closed brecht-derooms closed 1 year ago

brecht-derooms commented 1 year ago

Problem & context

I did not have this problem before and managed to work successfully with prisma-rust a few months back. Today when I returned to it, running the CLI results in:

cargo prisma generate
Downloading https://binaries.prisma.sh/all_commits/d6e67a83f971b175a593ccc12e15c4a757f93ffe/debian-openssl-3.1.x/query-engine.gz 
to /home/databrecht/.cache/prisma/binaries/cli/4.8.0/d6e67a83f971b175a593ccc12e15c4a757f93ffe/prisma-query-engine-debian-openssl-3.1.x

thread 'main' panicked at 'received code 404 Not Found from 
https://binaries.prisma.sh/all_commits/d6e67a83f971b175a593ccc12e15c4a757f93ffe/debian-openssl-3.1.x/query-engine.gz', /home/databrecht/.cargo/git/checkouts/prisma-client-rust-fa967aa5ad0ec391/f71ad91/cli/src/binaries/mod.rs:145:9

Prisma rust client versions

Regardless whether I use the current version or the version from a few months back (0.6.4). When I start a project from scratch and set it up using the simplest instructions (not a separate lib/crate) it's immediately reproducible. I've seen there are some similar problems reported with the node version but I couldn't figure out what is wrong.

Rust version

tried both 1.70.0 as 1.69.0

Attempted fixes

I tried to specify binaryTargets since it seems that it selects the wrong target based on this list: https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#binarytargets-options

The binary target seems to be ignored by the rust cli though while npx prisma generate would result in:

Error: Unknown binary target debian-openssl-3.1.x in generator client.
Possible binaryTargets: darwin, darwin-arm64, debian-openssl-1.0.x, debian-openssl-1.1.x, debian-openssl-3.0.x, rhel-openssl-1.0.x, rhel-openssl-1.1.x, rhel-openssl-3.0.x, linux-arm64-openssl-1.1.x, linux-arm64-openssl-1.0.x, linux-arm64-openssl-3.0.x, linux-arm-openssl-1.1.x, linux-arm-openssl-1.0.x, linux-arm-openssl-3.0.x, linux-musl, linux-musl-openssl-3.0.x, linux-musl-arm64-openssl-1.1.x, linux-musl-arm64-openssl-3.0.x, linux-nixos, windows, freebsd11, freebsd12, freebsd13, openbsd, netbsd, arm, native

Other context

The node prisma CLI does work.

Linux version: DISTRIB_ID=EndeavourOS DISTRIB_RELEASE="rolling" DISTRIB_DESCRIPTION="EndeavourOS Linux" DISTRIB_CODENAME=rolling NAME=EndeavourOS PRETTY_NAME=EndeavourOS ID=endeavouros ID_LIKE=arch BUILD_ID=2022.08.28 ANSI_COLOR="38;2;23;147;209" HOME_URL='https://endeavouros.com' DOCUMENTATION_URL='https://discovery.endeavouros.com' SUPPORT_URL='https://forum.endeavouros.com' BUG_REPORT_URL='https://forum.endeavouros.com/c/arch-based-related-questions/bug-reports' PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/" LOGO=endeavouros

Cause:

on my machine:

OpenSSL 3.1.1 30 May 2023 (Library: OpenSSL 3.1.1 30 May 2023)

which seems to be how it's determined which version to download based on the source code.

Brendonovich commented 1 year ago

Pretty sure this is fixed by this: https://github.com/Brendonovich/prisma-client-rust/pull/349

brecht-derooms commented 1 year ago

Confirmed, The problem was the tag, 0.6.8 seemed to be the last version to use so that's the one I upgraded to:

prisma-client-rust-cli = { git = "https://github.com/Brendonovich/prisma-client-rust", tag = "0.6.8", default-features = false, features = [ "postgresql" ] }

removing the tag and just using the latest code in the repo fixed it.

alexewsv commented 10 months ago

I've faced this issue, it seems version 0.6.10 is not support openssl >3.1. currently my openssl is 3.2. I solved by downgrade openssl to 3.0, it work