Am 22.03.22 um 07:01 schrieb David Hendricks:
On Mon, Mar 21, 2022 at 4:48 PM Thomas Heijligen firstname.lastname@example.org wrote:
Beside from the documentation, the meson file currently only works for Linux and was never announced as official way to build flashrom.
The original reason for adding Meson was to support fwupd, a very important use case which AFAIK is only intended to work with internal programmers for in-system flashing in Linux.
Mission creep was not the intention, though Meson has evidently gained popularity for other use cases. Notably, according to a comment in CB:61198 https://review.coreboot.org/c/flashrom/+/61198 Chromium now uses Meson for all builds too. ChromeOS and fwupd are probably the biggest users of flashrom when it comes to use of internal programmers. Also, as mentioned earlier in the thread there are many distributions using Meson for packaging.
It will be good to understand why they are going this route and if it's better for the project in the long run. Personally I am more familiar with Make, but even I can see that our Makefile is one that only a flashrom developer could love.
AFAIR there were three arguments for meson: - Building dynamic libflashrom was nontrivial for the old makefile (static libflashrom was always there) - Meson is newer and easier on the eyes - Meson build integrates nicely with other packages built by meson
Last time I checked, the following features were missing from the Meson build script in flashrom: - Complete crossbuild support - Native support for most non-Linux platforms - Support for quite a few programmers - Anyone who checks that the binaries built by Meson and Makefile are identical (admittedly that's not the fault of the code but a lack of time/motivation)
There are even open bugs in Debian about Meson built flashrom: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=955387 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=976639
As a side note, we never used autotools even though one of the Debian flashrom uploaders thinks so.
Our Makefile was not nice (I should know since I wrote most of the ancient code). Nobody has shown up willing to add all the features of Makefile to Meson and even if someone would be willing, we'd need testers for all the features, which also didn't happen in the almost 3 years since Meson support was contributed. I think Meson was a good idea, but it failed to get traction beyond "we need it for dynamic libflashrom".
Side note: The now-defunct coreboot v3 also was a nice idea, but it failed to gain the necessary developer mindshare due to missing support for the use cases of most of the active coreboot developers. I was quite sad because I really liked coreboot v3. While some good parts of it were eventually adopted in coreboot v2/v4, quite a lot of development effort was mostly useful for the learning experience. This feels similar.
AFAICS adding dynamic libflashrom support to Makefile would make the Meson support a true subset and then we could switch back to using Makefile for all cases. The current Makefile is a lot more readable than the state 3 years ago, so arguably Meson did help.