Publish sfizz_render linux/mac/win binaries to GitHub releases
Closed this issue · 12 comments
Background
I'm working on automating SFZ releases using GitHub workflows:
https://github.com/studiorack/salamander-grand-piano/blob/master/.github/workflows/release.yml
I would like an audio preview to be generated automatically every time the SFZ file is changed. sfizz_render looks like the ideal tool for this job (even though it generates .wav instead of .flac I can work around that!)
I can generate an audio file successfully using the commands:
git clone https://github.com/sfztools/sfizz
cd sfizz
git submodule update --init --recursive
mkdir build
cd build
cmake ..
make
./clients/sfizz_render --sfz ../Salamander\ Grand\ Piano\ V3.sfz --wav ../salamander-grand-piano.wav --midi ../salamander-grand-piano.mid
Problem
There are so many commands just to get sfizz_render built, the process takes time and is resource intensive. It requires downloading and building of sfizz code/dependencies (500MB) just to make the sfizz_render command available to the CI pipeline. This is multiplied by the number of times the pipeline is run, everytime I create a release these commands have to run.
Solution
Prebuild the sfizz_render binaries for Linux, Mac and Windows and publish to GitHub releases. This would allow pipelines to download the binary only (5MB). It would also simplify the pipeline commands for developers to implement:
curl -sS https://github.com/sfztools/sfizz/releases/download/2.0.0/sfizz-render-linux.zip > sfizz-render-linux.zip
unzip sfizz-render-linux.zip
./sfizz-render-linux/sfizz_render --sfz instrument.sfz --wav preview.wav --midi preview.mid
Later, another improvement could be to publish binaries to the respective package managers. Install commands would be more memorable and could be as simple as:
apt install sfizz_render // linux
brew install sfizz_render // mac
choco install sfizz_render // win
For now I can workaround by creating my own builds of the binaries and storing them somewhere else. But I think this would be a useful feature for all!
Thanks!
If I can put my cent on this I think adding another archive to releases it might only confuse people since sfizz_render should be already part of the other packages. The real solution is just what you already doing, by keeping a prebuilt binary somewhere to be downloaded during your CI workflow. If the problem is just to keep it up to date it is not necessary, just do it if a new version has a really useful feature that yours doesn't have.
I was kinda thinking more along the lines of adding it to the OBS builds. Or just adding them to the current archives, since they're already mostly built :)
OBS builds don't have it in already? For the archives do you think to restore the linux static build?
IDK, I'll see all of this. Aren't all builds static by default these days?
Distro packages not for sure, by static I also mean with all major dependencies built in as well. Now I forgot the reason why the linux build was disabled/removed but I barely recall for something related, anyway packagers should take care of it.
Just taking a look into OBS builds, in the Debian package it is included with the manual.
Distro packages not for sure, by static I also mean with all major dependencies built in as well.
For GUI-less things it's doable.
Just taking a look into OBS builds, in the Debian package it is included with the manual.
Right.. @kmturley how about taking and installing one of these?
I do that for libsfizz in there for example. I thought sfizz-render wasn't included.
Sure I could do something like this:
curl -sS http://download.opensuse.org/repositories/home:/sfztools:/sfizz/Debian_11/amd64/sfizz_1.1.1-0_amd64.deb > sfizz-linux.deb
ar -x sfizz-linux.deb
tar --use-compress-program=unzstd -xvf data.tar.zst
./usr/bin/sfizz_render --sfz instrument.sfz --wav preview.wav --midi preview.mid
However that doesn't solve for Mac or Windows?
Why not installing through the PPA as I linked above? Or at least installing the deb package? This is kind of the point of package management. If down the line we add a requirement on a system package for these (and on Fedora this is already the case afair) your way will fail.
I'll see if we can add it to mac/windows packages.
mingw packages have it BTW
They're broken now.
So I've updated the build scripts on #1056 to publish the build artifacts with sfizz_render
; it is actually built on most platforms as a test already. After thinking more about this I think I won't publish additional binaries in the Github releases. Feel free to use #1056 on a fork for this purpose if you wish.
- If
sfizz_render
is needed for CI purposes, the OBS builds provide a satisfactory way to install it painlessly in a machine. This script shows how to integrate the package in a Github CI instance. - Using
sfizz_render
on Mac and Windows represents a really tiny fraction of the users. Even for them, as you said, integration with Homebrew, Chocolatey or WinGet would probably be the smarter way. I will gladly support all packaging efforts, we always strive to do so. However I can't commit to maintain them, so feel free to do so. - Considering your CI needs, maybe publishing a Github action could help all your issues? They have a repo and their own releases associated to them, maybe it'd be a good way forward.
Thanks for looking into it. The self-build approach works for me for now, although it would be great to have an official cross-platform binary source in the future.
I created my own GitHub CI yml based on previous StudioRack workflows:
https://github.com/studiorack/sfizz/blob/feature/studiorack-ci/.github/workflows/release.yml
Run details:
https://github.com/studiorack/sfizz/actions/runs/1636432826
Release which is created:
https://github.com/studiorack/sfizz/releases/tag/v1.1.1
Binaries created:
https://github.com/studiorack/sfizz/releases/download/v1.1.1/sfizz-render-linux.zip
https://github.com/studiorack/sfizz/releases/download/v1.1.1/sfizz-render-mac.zip
https://github.com/studiorack/sfizz/releases/download/v1.1.1/sfizz-render-win.zip
Binary details:
file ./sfizz-render-linux/sfizz_render
ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=2d90127b19f0d0344330699f5fcf94029d81f734, for GNU/Linux 3.2.0, not stripped
file ./sfizz-render-mac/sfizz_render
Mach-O 64-bit executable x86_64
file ./sfizz-render-win/sfizz_render.exe
PE32+ executable (console) x86-64, for MS Windows