qmk / qmk_toolbox

A Toolbox companion for QMK Firmware
https://qmk.fm/toolbox
MIT License
2.55k stars 504 forks source link

Remove embedded flasher binaries #474

Open fauxpark opened 2 months ago

fauxpark commented 2 months ago

Description

There are several problems with this approach of bundling the flasher binaries with the Toolbox, and I feel it has gotten a little out of hand.

Firstly, it is probably violating some kind of licensing thing to be distributing these binaries, though I'm not 100% sure of that. I don't really like it either way.

The binaries themselves are difficult to maintain: on the macOS side, they need to be slightly modified (!) from the Homebrew bottle tarballs to fix the dylib references (Homebrew itself also does this as the user's install path may not be the default). Obtaining the tarballs from GitHub Packages in the first place is not trivial.

With the advent of Apple Silicon, the flasher binaries (since they are taken from Intel bottles) do not even work on an M1 Mac without Rosetta installed, and manually creating universal binaries is out of the question due to signing issues.

For Windows, the tarballs are much more easily procured from the MSYS2 package DB site, and do not really need any modification, but avrdude in particular seems to need more and more DLLs with every release, which then need to be added to the project. Additionally, the files also need to be extracted from the Toolbox .exe before they can be used. These are never cleaned up from the versioned AppData folders when a new version is installed, nor are they replaced if they already exist.

Therefore, I've decided to remove the binaries from the Toolbox; moving forward it will simply expect them to be available elsewhere. On Windows this is currently hardcoded to the default QMK MSYS install path (C:\QMK_MSYS\mingw64\bin), on macOS it will try the default Homebrew install paths (/usr/local/bin for Intel, /opt/homebrew/bin for ARM). This can be made more intelligent/configurable later.

This way, the Toolbox does not need to keep up with new releases of each flashing tool, and can focus more on being a simplified interface for flashing boards.

Types of Changes

Issues Fixed or Closed by This PR