-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Build a working distributable macOS application (signed and notarized) #20
Comments
Hi @simonw I've been following along with this as we recently faced a similar problem on an electron project and after seeing your recent update on HN thought some of our learnings might be helpful for you. I've been working on porting our setup into the datasette repo over at nikdvp/datasette.app and saw from #27 that we seem to have converged on pretty similar solutions! I also started with pyinstaller but quickly switched over to bundling a full venv (using conda-pack). Still in flux and not quite ready for a PR yet, but some of https://github.com/nikvdp/datasette might be useful. Some bits that might be of interest:
|
@nikvdp wow that's really useful, thanks! My development version right now actually does the following:
This is all highly experimental but it seems to work - at least on my machine, and with the What I'm now wondering is if the signing of the binaries will survive this - I need to be able to execute |
@nikvdp the reason I'm currently leaning towards this slightly terrifying idea of shipping an entire Python environment (from https://github.com/indygreg/python-build-standalone) and then using it to create a virtual environment is that I really want users of this to be able to install Datasette plugins - see #5 - and I don't think the PyInstaller route will let them do that. Do you have any idea if the combo of |
Hey @simonw, friend of Nik here (thus how I found this issue) but also a fan of datasette. Thought I'd chime in as I've run into these issues in the past as well.
It doesn't help much, but a user can also right click the app and then click "Open" via the context menu. Perhaps slightly less friction than having to go through the settings pane.
In my experience (mostly with Alfred plugins) if the executable is signed (such as Point being, I think plugins will work fine if they are just python code that is run through your binary which the user has already given a security exception to. |
The problem we ran into initially was that although the electron app itself was signed correctly, without the correct entitlement settings (what worked for us was this and this) the signed-ness didn't extend to the bundled interpreter, only to the electron app's own binaries, ymmv I'm not familiar with python-build-standalone, but from the docs I think what what it's doing is pretty similar to what conda-pack does, except that with conda-pack the venv (with datasette already installed into it) is built during CI and baked into the mac .app bundle rather than spun up on the user's machine. Saves a few moving parts, but probably includes files you don't actually need, and the user might need admin permissions to install new packages or modify the venv on mac/win if they installed to
Warp might be helpful here because under the hood it just extracts the bundle into a cache folder it manages in the user's home folder and then execs it. From then on it's basically a normal python venv that just so happens to be installed at eg I don't think conda-pack would be necessary for this either, bundling up a python-build-standalone env into a single executable with warp should be a similar process to doing it for a conda-packed env. |
As of #50 this now works! Every commit gets a built, signed, notarized, zipped |
Turned this all into a TIL: https://til.simonwillison.net/electron/sign-notarize-electron-macos |
Follows #25.
The text was updated successfully, but these errors were encountered: