linebender / runebender

A font editor written in Rust.
Apache License 2.0
760 stars 36 forks source link

Best way to "package" the binaries to let users run it without installing Rust on their machine? #240

Open belluzj opened 3 years ago

belluzj commented 3 years ago

I'm going to show the UI to a few people at Dalton Maag, and the way we've managed to distribute the binary on Windows is:

With that setup, it's possible to drag-and-drop a UFO onto the shortcut, and it opens in Runebender.

Are there any other things to consider that we didn't see here? Is there interest to automate that MSI thing on the repository here? Or is there maybe a better way using Rust-specific tools or conventions?

alerque commented 3 years ago

Shipping packages for apps using Rust is an underdeveloped part of the ecosystem. For some reason the developers got it in their head that all apps compile to a single binary and left it at that: cargo works great for collecting libraries and compiling the source, but it is terrible as an packager. They also didn't make it easy to place inside of a packaging system, although it can be done.

I'm not familiar with Windows packaging, but what you did sounds very close to what I did to setup Runebender packaging on Arch Linux: runebender-git. During the build() phase I exported a variable that says where the theme files are going to end up (being a distro specific package recipe and not a general purpose installer, I know where that is going to be). Then in the package() phase I placed the binary in the system PATH and the theme files in the shared resources folder I'd tipped the builder off about previously.

For my own Rust projects I typically wrap them in an GNU Autotools based build system. This is more useful for POSIX systems than Windows, but it does make it easy to both build the binary and packages supporting files with an install system that detects proper locations for things, bundles man pages, and so forth. For example this is how fontship is packaged.

I think having an automated CI job that built an MSI installer for Runebender would be great. For now just attaching it as an artifact to the CI runner would be fine, later when releases get tagged they could be attached to the releases.

If interested I could do the same for the *nix end of things so that a more standard ./configure; make; make install from a source package gets the job done.

cmyr commented 3 years ago

This is definitely a current headache, and one of the things I hope to improve 'soon'. In the more immediate term, when this gets closer to ready for initial preview I will hack together something to distribute simple executables.