Skip to content
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

feat(binaries): support arm64 CLI & engine binaries #874

Merged
merged 5 commits into from
Jun 18, 2023

Conversation

stillmatic
Copy link
Contributor

No description provided.

@stillmatic stillmatic mentioned this pull request Jun 16, 2023
Copy link
Owner

@steebchen steebchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, let's slightly adapt (or let me know if I just should do the changes)

binaries/platform/platform.go Outdated Show resolved Hide resolved
@steebchen steebchen linked an issue Jun 16, 2023 that may be closed by this pull request
@stillmatic stillmatic marked this pull request as ready for review June 16, 2023 20:07
@stillmatic
Copy link
Contributor Author

go run github.com/steebchen/prisma-client-go generate                                                        git:main*
[prisma-client-go] INFO: 2023/06/16 16:04:48.747529 prisma cli doesn't exist, fetching... (this might take a few minutes)
[prisma-client-go] INFO: 2023/06/16 16:04:53.243590 prisma cli fetched successfully.
panic: could not run [generate]: signal: killed

looks it was able to pull now

@steebchen
Copy link
Owner

cool, does it actually work for you now? as it says killed but the binary should work

@stillmatic
Copy link
Contributor Author

I also need to select the correct Prisma engine actually, such as darwin-arm64 instead of darwin

hmm - where does this logic live? is it the BinaryPlatformName function? not sure what valid values are for this.

@stillmatic
Copy link
Contributor Author

I will add it to this PR if you don't mind

go for it! I've given you collaboration permissions on my fork, in case you need that to push to the repo.

cool, does it actually work for you now? as it says killed but the binary should work

let me try to generate -- I am using this in a monorepo with JS frontend Go backend, there may be other bugs :)

@steebchen
Copy link
Owner

steebchen commented Jun 16, 2023

yes, basically valid values (or rather valid relevant values) are

  • darwin-arm64
  • darwin
  • linux-static-x64
  • linux-static-arm64
  • windows

@steebchen
Copy link
Owner

go for it! I've given you collaboration permissions on my fork, in case you need that to push to the repo.

yeah but might be more easy now if you just add it now actually 😅 let me know if the values above help

@steebchen
Copy link
Owner

great, thx! this should work. let me know if it works when you run a query successfully, it should use the arm64 query engine 🙏

Copy link
Owner

@steebchen steebchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🚀

@steebchen steebchen linked an issue Jun 16, 2023 that may be closed by this pull request
2 tasks
@steebchen steebchen changed the title feat: add arch arg to CLI url feat(binaries): support arm64 CLI & engine binaries Jun 16, 2023
@stillmatic
Copy link
Contributor Author

stillmatic commented Jun 16, 2023

hm, I am still panicking, and no debug info really --

go run github.com/steebchen/prisma-client-go generate --schema ../my_monorepo/packages/db/prisma/schema.prisma   git:main*
panic: could not run [generate --schema ../my_monorepo/packages/db/prisma/schema.prisma]: signal: killed

goroutine 1 [running]:
main.main()
	/Users/hua/code/prisma-client-go/main.go:29 +0x344
exit status 2

I may not be invoking this correctly :)

@steebchen
Copy link
Owner

steebchen commented Jun 16, 2023

can you run this on your machine

curl https://binaries.prisma.sh/all_commits/70a9adfd11f836696eca398396544fe07a8d8edb/darwin-arm64/query-engine.gz -o qe.gz && gunzip qe.gz -f && chmod +x qe

and check if it works

> ./qe --version
query-engine 70a9adfd11f836696eca398396544fe07a8d8edb

@steebchen
Copy link
Owner

Send me your schema.prisma please if it doesn't work. You can also join the discord if you want: https://discord.gg/VBAypbxF

@steebchen steebchen merged commit 62806c8 into steebchen:main Jun 18, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ARM / mac M1 support Support native ARM binaries
2 participants