Can't configure compiled Prisma query engine for FreeBSD
Could you help me to resolve the following issue?
I compiled libquery_engine.so on FreeBSD v14, copied it to node_modules/@prisma/engines/libquery_engine.so.node, set variables in my .env file as
PRISMA_QUERY_ENGINE_LIBRARY=/usr/local/www/node_modules/@prisma/engines/libquery_engine.so.node
PRISMA_QUERY_ENGINE_BINARY=/usr/local/www/node_modules/@prisma/engines/libquery_engine.so.node
[ I also tried to rename the file to libquery_engine-freebsd14.so.node ]
and added to the schema the line
binaryTargets = ["native", "freebsd14"]
but when I run npx prisma -v it still tries to download engine from binaries.prisma.sh with failing of course as there is no pre-compiled engine for freebsd14
How to make Prisma commands to use my compiled engine for FreeBSD instead of trying to download it?
9 Replies
Ahoy, knowledge seeker! I'm the Prisma AI Help Bot. Do you want a dev's response that might take a hot second, or an AI answer that's ready before your next coffee sip? Either way, your question is important to us.
Hey ๐
Instead of adding the variables in env file, did you try to export them in your shell and try?
https://github.com/prisma/prisma/issues/3091#issuecomment-1787214960
GitHub
Provide precompiled binaries for FreeBSD ยท Issue #3091 ยท prisma/pri...
Some of Prisma's users are trying to use Prisma on FreeBSD (e.g. #2288). As we do not build binaries for that yet, they have to build them themselves and use environment variables to make this ...
I've removed vars from env file and run
export PRISMA_QUERY_ENGINE_LIBRARY=/usr/local/www/node_modules/@prisma/engines/libquery_engine.so.node
export PRISMA_CLI_QUERY_ENGINE_TYPE="library"
but npx prisma -v command still tries to download .../freebsd14/schema-engine.gz
and PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING=1 npx prisma -v returns the same result
Try exporting all the variables listed here?
https://github.com/prisma/prisma/issues/3091#issuecomment-1787214960
thanks! now I get
root@www2:/usr/local/www # npx prisma -v
Warning Precompiled engine files are not available for freebsd14. Read more about building your own engines at https://pris.ly/d/build-engines
Environment variables loaded from .env
Error: Unable to require(
/root/prisma-engines/target/release/deps/libquery_engine.so
).
The Prisma engines do not seem to be compatible with your system. Please refer to the documentation about Prisma's system requirements: https://pris.ly/d/system-requirements
Details: Invalid or unexpected token
at Jte (/usr/local/www/node_modules/prisma/build/index.js:284:116)
at i7e (/usr/local/www/node_modules/prisma/build/index.js:284:269)
prisma : 5.18.0
@prisma/client : 5.18.0
Computed binaryTarget : freebsd14
Operating System : freebsd
Architecture : x64
Node.js : v22.8.0
Query Engine (Node-API) : E_CANNOT_RESOLVE_VERSION (at ../../../root/prisma-engines/target/release/deps/libquery_engine.so, resolved by PRISMA_QUERY_ENGINE_LIBRARY)
Schema Engine : schema-engine-cli 66ff51574f705989a0e2c8bf6f1659bee5eb9517 (at ../../../root/prisma-engines/target/release/schema-engine, resolved by PRISMA_SCHEMA_ENGINE_BINARY)
Schema Wasm : @prisma/prisma-schema-wasm 5.18.0-25.4c784e32044a8a016d99474bd02a3b6123742169
Default Engines Hash : 4c784e32044a8a016d99474bd02a3b6123742169
Studio : 0.502.0
Preview Features : fullTextIndex, fullTextSearchGitHub
GitHub - prisma/prisma-engines: ๐ Engine components of Prisma ORM
๐ Engine components of Prisma ORM. Contribute to prisma/prisma-engines development by creating an account on GitHub.
System requirements (Reference) | Prisma Documentation
System requirements for running Prisma ORM
For this error:
Error: Unable to require(/root/prisma-engines/target/release/deps/libquery_engine.so)You need to rename libquery_engine.so to libquery_engine.so.node
Thank you so much! Now it works as expected
I am glad to hear that! ๐