-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Add support for ARM architecture for CLI binaries #236
Comments
I ran into this trying to generate the prisma client in the docker container on a M1 macbook. Surprisingly, it does build outside docker on my M1 (not sure how to explain that, but maybe something to do with the darwin target) Workarounds I can think of:
Any other ideas? I do see that vercel has arm targets so I'm not sure what's missing to get this unblocked. Also-- the prisma client go package has a deprecation notice so does it make sense to submit PRs there? |
This doesn't work since the container still relies on the binaries in the current design of the python client |
@tday It builds outside of docker because of Rosetta 2 which enables some cross-compatibility which I also only recently discovered lol steebchen/prisma-client-go#717 (comment)
There is nothing that I'm aware of that is blocking this, the work just needs to be done.
Yes, the Go Client has been deprecated but the binaries will still be updated: https://github.com/prisma/prisma-client-go/tree/main/binaries#community-members A better solution would be to roll our own binaries however I don't want to have to pay for any hosting costs.
Currently, ARM engine binaries are not downloaded, however that is going to be fixed by #233. You could download these binaries using the following script which should work: set -eux
mkdir -p bin
curl https://binaries.prisma.sh/all_commits/34df67547cf5598f5a6cd3eb45f14ee70c3fb86f/darwin-arm64/prisma-fmt.gz -o bin/prisma-fmt
curl https://binaries.prisma.sh/all_commits/34df67547cf5598f5a6cd3eb45f14ee70c3fb86f/darwin-arm64/introspection-engine.gz -o bin/introspection-engine
curl https://binaries.prisma.sh/all_commits/34df67547cf5598f5a6cd3eb45f14ee70c3fb86f/darwin-arm64/migration-engine.gz -o bin/migration-engine
curl https://binaries.prisma.sh/all_commits/34df67547cf5598f5a6cd3eb45f14ee70c3fb86f/darwin-arm64/query-engine.gz -o bin/query-engine
chmod +x bin/prisma-fmt
chmod +x bin/introspection-engine
chmod +x bin/migration-engine
chmod +x bin/query-engine You could then copy these binaries into the docker image and configure Prisma Python to use them by setting env variables:
Also another potential solution is to use the Node CLI through |
I was able to get this working using the --platform flag on M1, actually. I like the npx idea though, that would be less hacky. I may give that a try if I have time to come back to this to clean up. Here's what my dockerfile looks like in case others stumble onto it:
Side note: Thanks so much for being so responsive and helpful. This package has so much potential and it inspires confidence to see how you have structured and maintained it! I'm looking to get a production app running with this to see if it performs well at scale. I hope I can have time to contribute enhancements as I get further along, but right now I'm in prototyping stage for my company. |
Thank you so much! That means a lot to me :)
Your contributions would be more than welcome and that is really exciting! Please let me know how it goes for you and if there are any improvements I could make! Also feel free to join the community discord server if you have any questions / need any additional support :) |
Problem
Currently the CLI binary targets are:
windows
,linux
anddarwin
. We should also build for targets such asnode12-linux-arm64
Suggested solution
We do not currently have control over CLI binary building as this is handled and published by Prisma themselves. We will need to submit a PR in the Prisma Client Go repository.
The list of possible targets can be found here: https://github.com/vercel/pkg#targets.
Additional context
#195 (comment)
This is also more relevant now that we are adding support for ARM engine binaries in #233
The text was updated successfully, but these errors were encountered: