PeaceFounder / AppBundler.jl

Bundle your Julia application
MIT License
53 stars 3 forks source link

Fix for non-exported #6

Closed PallHaraldsson closed 8 months ago

PallHaraldsson commented 8 months ago

[skip ci]

PallHaraldsson commented 8 months ago

Feel free to merge as is, but note macOS isn't the most popular, probably your platform, change more?

I will be trying

import Pkg.BinaryPlatforms: Linux  # this rest doesn't seem needed for me: , MacOS, Windows
AppBundler.bundle_app(Linux(:x86_64), "MyApp", "build/MyApp-x64.app")

In case you don't have access to Linux, I'll confirm what works, in case you want the docs, for the only free platform... and maybe it works on WSL2 too. I would understand doing the docs for it, or most popular, Windows... or all?

I.e.:

julia> AppBundler.bundle_app(Linux(:x86_64), ".julia/packages/AppBundler/bFhGI/examples/mousetrap/", "build/MyApp-x64")
[ Info: Rule with origin linux/meta is skipped as not found in default or override path.
  Activating project at `~/.julia/environments/v1.10`
ERROR: IOError: open(".julia/packages/AppBundler/bFhGI/examples/mousetrap/Manifest.toml", 0, 0): no such file or directory (ENOENT)

I will figure this out, and I believe correct to drop .app ending, since only for macOS(?) Maybe it's best to document all after all, since many will want to support many platforms, but only have one, and doesn't even know the file ending differences.

Possibly those should be skipped, and one command could make bundles for all?

[Note, It's at least theoretically possible to make a portable app, one bundle for all these platforms, see Cosmopolitan. But I don't expect you do that, i.e. implement their libc.]

And for Linux, snap seems like a sensible choice, because of Ubuntu. Flatpak would possibly also have been, or both, not asking for that). I'm on Linux Mint, an Ubuntu derivative, though they are against snap, and blocked it. I've previously unblocked/enabled it.

I don't know if you support musl/Alpine, only Julia does and needs to, not you(?). Linux is a mess with so many options e.g. nolibc I recently discovered at kernel.org. Might become a good target later (I think requires Linux 5.1), if not Cosmopolitan:

https://news.ycombinator.com/item?id=34479284

I'll fix, make Manifest, never tried... maybe your examples should include?

https://stackoverflow.com/questions/58996197/when-should-a-julia-project-have-a-manifest-and-project-file

JanisErdmanis commented 8 months ago

I will figure this out, and I believe correct to drop .app ending, since only for macOS(?) Maybe it's best to document all after all, since many will want to support many platforms, but only have one, and doesn't even know the file ending differences.

A dropped suffix for Linux .snap and Windows .zip is interpreted as an option that the result does not need to be compressed, which can be overridden with the compress=true argument. This makes it easier to debug the recipes. It could be added to the documentation. This is explained in the README.

Possibly those should be skipped, and one command could make bundles for all?

Every bundle can have different customisation arguments. It needs to be separate.

I don't know if you support musl/Alpine, only Julia does and needs to, not you(?). Linux is a mess with so many options e.g. nolibc I recently discovered at kernel.org. Might become a good target later (I think requires Linux 5.1), if not Cosmopolitan

I haven't tried to bundle with musl. In principle, it should work with slight changes, but I have no time to try that. But, it does not seem possible to install snap packages on it.

I'll fix, make Manifest, never tried... maybe your examples should include? https://stackoverflow.com/questions/58996197/when-should-a-julia-project-have-a-manifest-and-project-file

The manifest file is exactly what is needed for application bundling, and thus, it is included in every example.

PallHaraldsson commented 8 months ago

FYI the Manifest is in every example except for the Mousetrap one, I happened to try first...

I'll just try another one first, then if I get around to that one again, I may do a PR for it. II did also suggest to register it because it one of your examples...

JanisErdmanis commented 8 months ago

FYI the Manifest is in every example except for the Mousetrap one, I happened to try first...

That's a good catch. Currently, I have no bandwidth for that. Feel free to submit PR if you have time.