Add AppBundler support for standalone distributions #34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR demonstrates the feasibility of bundling BonitoBook as a standalone installer using AppBundler. I only needed to address relocation issues with BonitoBook itself with hardcoded paths
@__DIR__. I replaced them withpkgdir(@__MODULE__), which makes them relocatable while not requiring them to be instantiated from the compilation cache at runtime, which doesn’t sit well with me.Since BonitoBook itself does not depend on Electron, it made sense to create a submodule,
BonitoBookGUI, that references the parent project using the new[sources]entry withinProject'.toml. I added the dependencies toProject.tomlthat I spotted in the examples, and loaded them intoBonitoBookGUIfor precompilation. That will be unnecessary in the future as I plan to make all project dependencies compile by default, with the option to opt out.The build can be run with Build Release Assets under GitHub actions or locally with:
I tested the GitHub-generated builds for macOS, Linux, and Windows and can report that installation works and that the installed applications are running on all platforms.
The startup time is currently not great, being around 12s on my M1 Pro laptop. I plan to add sysimage generation and replacement as an alternative to the precompilation cache distribution to AppBundler over the next month, which will also address this. Another issue is that examples themselves have a significant startup time. That could be addressed by adding precompilation statements to the
BonitoBookGUIapplication with PrecompileTools or manually.Further improvements, like a custom icon, name, description, or starting Julia with multiple threads, can be implemented with overrides in the
BonitoBook/meta/folder, which take precedence over defaults in theAppBundler/recipes/folder.