Hi everyone! I just created tdiff, a cli app for comparing JSON/YAML files.
I would love to read your suggestions regarding organization, idiomatic crystal, general advise, etc. Also I’m scratching my head around how to properly create portable binaries for OSX and Windows, if at all possible, or at the very least a proper installation script for those platforms.
Anyway, thanks in advance for the time, and I’m excited to be part of this great community for such a cool language.
Easiest way for Linux would be to provide a static binary, and maybe a Snap package for it. A more robust way would be to, of course, is the provide the package via each OS’s package manager. However , I don’t really have any experience with this, but I imagine it could get painful versus Snap/static binary.
Mac would require building from source, or ideally use Homebrew.
Windows isn’t really supported ATM, so will just have to wait on that.
Thanks! a snap package would certainly be more robust. For this project, I created the binary with shards build --production --release --static --no-debug but I’m not sure if I should be aware of any potential issue with that running the binary in some random linux machine.
I guess a homebrew package would make a lot of sense. I’ve never tried it but it shouldn’t be that hard.
I setup a GH action that will build/upload a static binary into the release assets when a release is created. AFAIK this binary should run on any AMD64 architecture UNIX based OS. Probably wont need the --link-flags option, as thats for libxml2.
Homebrew is the most painful of the three. Currently I’m handling this by just manually building/uploading the bottle. I suppose I could setup some job within GH actions to automate this, but :shrug:. Ideally, the package would be in homebrew core, which handles bottling for you.
The first link was super helpful is figuring out how to setup the bottle. The second is my cheatsheet so I remember what to do in order to update the bottled version.
I’d love to see some sort of how-to blog[s] for generating self-contained binaries for various platforms; or as part of the official docs. It would probably be great [critical?] for promoting Crystal v 1.0!