For providers like AWS Lambda, GCP Cloud Functions, Netlify functions the bundling happens locally and the payload is deployed to the provider.
The binary workflow spec mentions a target parameter to mitigate this but in current state of our workflow, download step is at yarn or npm install which is never executed when deploying to these platforms.
We might need a way to build for a remote target or solve this by configuration.
Would it make sense for the binary download to happen lazily at the generation step?
That seems to solve this problem as the user would be able to simply run prisma2 generate after changing the target setting to get the correct binary.
Just to summarize my understanding of this suggestion:
prisma2 generate downloads a binary for local machine's platform and a binary for target specified in Prisma project config file, then Photon can somehow dynamically resolve the correct binary, on deploy we upload both binaries?
This might work.
Follow up questions:
This has been released in preview-3 https://github.com/prisma/prisma2/blob/master/docs/core/generators/photonjs.md#specifying-the-right-platform-for-photon-js
Most helpful comment
Would it make sense for the binary download to happen lazily at the generation step?
That seems to solve this problem as the user would be able to simply run
prisma2 generateafter changing the target setting to get the correct binary.