prisma / prisma-engines

🚂 Engine components of Prisma ORM
https://www.prisma.io/docs/concepts/components/prisma-engines
Apache License 2.0
1.19k stars 240 forks source link

Need help to Windows 32 bit build #3349

Open dagistan-tuncbilek opened 2 years ago

dagistan-tuncbilek commented 2 years ago

Hi, I need help to build windows 32 bit engine for our application runs sqlite on desktop apps. I dont know Rust at all. Unfortunately, i couldn't install Visual Studio on Windows 10 x86, because it needs 64 bit system, and cargo commands stiops with error. Is there an easy way for me to build? Can i build 32 bit engine on Windows 10 x64 or linux systems? If anyone can help me, i will be grateful.

janpio commented 2 years ago

Why do you need to build this yourself? We usually provide all necessary (and supported) engines directly for our CLI to download and then provide to Prisma Client to use.

dagistan-tuncbilek commented 2 years ago

Thanks for you reply. Unfortunately prisma dont support engines for 32 bit stsytems. Here is another issue, https://github.com/prisma/prisma/issues/6771, says Prisma ships only 64bit binaries. When i try to install npm packages and run prisma commands and i got an error about this issue. Then i tried to build custom binary and failed.

janpio commented 2 years ago

Indeed: https://github.com/prisma/prisma/issues/10860

As we don't support this right now, we also do not know how to achieve this. If you figure it out, please let us know and maybe we can add this to our build matrix ourselves and fix #10860.

aqrln commented 2 years ago

@dagistan-tuncbilek there are multiple things you may try.

Unfortunately, i couldn't install Visual Studio on Windows 10 x86, because it needs 64 bit system, and cargo commands stiops with error.

You don't need the latest Visual Studio, and VS has been 32-bit until very recently. Visual Studio 2017 (the minimum required to build Node.js addons for modern Node.js versions IIRC) should work fine on 32 bit Windows, and Rust supports anything starting from VS 2013. I would suggest trying this first as it seems the easiest option to me.

Alternatively you could use MinGW toolchain (i686-pc-windows-gnu) instead of MSVC. I don't think you would be able to use the library engine unless you recompile Node.js with MinGW due to ABI differences in that case, but binary engine would still work.

Can i build 32 bit engine on Windows 10 x64 or linux systems?

Yes, you could try that too. Cross-compiling from Linux would be more complicated, but on 64-bit Windows theoretically you should be able to just install and run the 32-bit compiler together with the whole toolchain:

rustup install stable-i686-pc-windows-msvc
cargo +stable-i686-pc-windows-msvc build --release