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

Add Mac app release #865

Merged
merged 8 commits into from
Jan 17, 2022
Merged

Add Mac app release #865

merged 8 commits into from
Jan 17, 2022

Conversation

wojtekmach
Copy link
Contributor

Demo:

demo_720p.mov

#!/bin/bash
# Usage:
#
# $ sh .github/scripts/build_mac.sh
Copy link
Contributor Author

@wojtekmach wojtekmach Jan 13, 2022

Choose a reason for hiding this comment

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

Eventually I'd like to run this on CI but there are complexities with setting certificated and GitHub doesn't yet support ARM, so I plan to build the releases myself in the meantime.

@@ -0,0 +1 @@
# AppBuilder
Copy link
Contributor Author

@wojtekmach wojtekmach Jan 13, 2022

Choose a reason for hiding this comment

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

I'd like to eventually extract it out but let's iterate on it as part of the Livebook repo in the meantime.

# $ open ./test/support/notebooks/basic.livemd
set -e

sh app_builder/scripts/bootstrap-mac.sh
Copy link
Contributor Author

@wojtekmach wojtekmach Jan 13, 2022

Choose a reason for hiding this comment

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

Ideally we'd use off the shelf Mac builds hosted by the OTP team (or Hex team, etc) but let's build them ourselves in the meantime.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we keep said script in the same .github folder then? 🤔 Or do we want to provide it long term?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My thinking was it is generic and thus more appropriate for app_builder which we'll eventually extract out but yeah, since it is ideally short lived, Livebook's .github folder is perhaps a better place indeed. Will change it!

lib/livebook/app.ex Outdated Show resolved Hide resolved
# $ sh .github/scripts/build_mac.sh
# $ open _build/app_prod/rel/Livebook.app
# $ open livebook://github.com/livebook-dev/livebook/blob/main/test/support/notebooks/basic.livemd
# $ open ./test/support/notebooks/basic.livemd
Copy link
Contributor

Choose a reason for hiding this comment

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

Those are so cool.

Copy link
Contributor

@josevalim josevalim left a comment

Choose a reason for hiding this comment

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

Awesome stuff! Some comments inline!

Copy link
Member

@jonatanklosko jonatanklosko left a comment

Choose a reason for hiding this comment

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

Amazing job! 🤠

lib/livebook/app.ex Outdated Show resolved Hide resolved
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>

Choose a reason for hiding this comment

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

I see you using this entitlement but not setting the DYLD_LIBRARY_PATH environment variable. How do you ensure the wx and other libraries are found when starting? Or does this assume the user has installed Erlang independently?

Copy link
Contributor Author

@wojtekmach wojtekmach Jan 14, 2022

Choose a reason for hiding this comment

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

both wx & openssl are statically compiled so I believe we don't even need this entitlement for them. I though I'd leave it though in case someone has a notebook that Mix installs a dependency with native code that would take advantage of it.

Choose a reason for hiding this comment

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

The static build is definitely very cool, the way to go. Just the build time and the nifs are troubling. Would be cool to have a repository of pre-built binaries for erlang on different platforms and versions. Having different versions available would also make building the mobile apps easier as they could fetch the correct runtime matching your local erlang version that is used to compile the beam files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, a repository of builds for different targets is sorely needed. :) We need it, elixir-desktop needs it, burrito needs it too! (cc @doawoo @QuinnWilton). I think it would be ideal to have as many official builds as possible. OTP team is keen with moving forward with erlang/otp#5036 so we'd at least have Mac ones (just x86_64 until GitHub adds ARM workers though). I believe they would be keen to have builds for popular Linux distros too. Or maybe there's one Linux build with as many things statically compiled as possible so that it works on all distros. (Or, you know, actually two, one against gcc and one against musl)

lib/livebook/app.ex Outdated Show resolved Hide resolved
@josevalim josevalim merged commit e8c80bf into livebook-dev:main Jan 17, 2022
@josevalim
Copy link
Contributor

💚 💙 💜 💛 ❤️

@wojtekmach wojtekmach deleted the wm-app branch January 17, 2022 16:39
@jonatanklosko
Copy link
Member

200w

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.

4 participants