-
-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running cx_Freeze on prisma python doesn't work across systems (windows tested only) #976
Comments
You can see our attempts at debugging this in https://github.com/Significant-Gravitas/AutoGPT/actions/runs/9969740139/job/27547269902?pr=7406 in this pipeline with the msi artifact available here: |
Repro steps and repo here: https://github.com/ntindle/cx_freeze_prisma_reproduction It is worth pointing out you MUST build in ci (or another PC), as your paths will be valid from the poetry install in the repo once you run cx_freeze. |
Hey @ntindle, thanks for the detailed reproduction steps, it's much appreciated. Unfortunately I won't have time to debug this deeply soon but I suspect you should be able to reproduce this locally by deleting / moving the downloaded binaries to a separate dir before running the app. This should replicate a "fresh install" environment, like any users of your app would have. You can identify where the binaries are by running Please let me know if I can be of any more help. |
Any idea how you would run the prisma py version with the correct python |
using |
That uses the version from cx freeze? |
ah sorry I misunderstood, that shouldn't matter for just determining the location of the binary cache as it's just dependent on the current user. |
So with @marcelotduarte 's help I was able to get the DB "running" but hit
|
@ntindle you will likely have to apply migrations (i.e. creating the database file) before attempting to connect, are you doing that? |
I'm attempting that and it seems to work with Postgres but not SQLite |
👍 I suspect there's some mismatch with where the sqlite db is created. Unfortunately it looks like there currently aren't any debug logs showing the file path. Will fix that. You could try manually specifying the absolute file path programmatically, https://prisma-client-py.readthedocs.io/en/stable/reference/client/#datasource-overriding. |
Bug description
For background, cx_freeze works by freezing all the required files for a Python program into an installable and executable package.
When you run cx_freeze over a Prisma python project, it fails to copy in some files and errors on the following.
You can set the params of prisma python using the following env when freezing to get the files included, and again when loading the binary but this still fails to run.
Settings in the build pipeline
Then rename
query-engine-windows.exe
toprisma-query-engine-windows.exe
inprisma/node_modules/prisma
Error:
How to reproduce
Quite detailed reproduction steps and repo here: ntindle/cx_freeze_prisma_reproduction
Expected behavior
cx_Freezing a Prisma project works easily without configuration and can be run without configuration. Otherwise, with config, it can work on a machine that did not have Prisma installed before
Prisma information
Environment & setup
The text was updated successfully, but these errors were encountered: