[flashrom] Re: One build system to rule them all (Meson)

2020-10-28 Thread Nico Huber
Hi Richard,

let me just say, you worry too much. When I say we can't drop
Make and you say we can't drop Meson, then most likely nobody
will drop either. Also, nobody has mentioned yet dropping one
solution before the other can take over (beside you).

On 28.10.20 14:41, Richard Hughes wrote:
> On Wed, 28 Oct 2020 at 12:20, Nico Huber  wrote:
>> So we didn't need these things before. Why do we need them now?
>
> Meson makes it possible to build fwupd as a subproject of fwupd, on
> any architecture, on any distro, which means we can use libflashrom on
> machines that don't ship a new enough distro version.

That doesn't explain what doesn't work with the Makefile.

> A lot of
> companies care (including Google) about using fwupd for updating

Not sure why you mention Google. Is that supposed to sound important?
If flashrom's history shows anything, it's that even if the biggest
IT companies rely on an open-source tool, it changes nothing for the
project per se.

> system firmware, and without libflashrom being available we'd just
> drop the flashrom plugin in fwupd, and in all honesty just reimplement
> the required bits of flashing to SPI directly.

I guess in the long run, you won't need much flashrom indeed. On
Linux, it's best to do the hardware access in the kernel. Flashrom,
OTOH, is focused to be multiplatform and hence does things in user
space. And Linux kernel SPI drivers are catching up. Of course, I
would be happy to hear that you still want to use (lib)flashrom
even when all the hardware access is done in the kernel. But I also
understand that there's always a trade-off.

> As a project you can do
> as you like, but dropping meson would be a huge step backwards for
> people actually using flashrom in production systems and I'm sure
> would alter the future viability of the project.

I guess you miss how big flashrom already is without the updates fwupd
installs with it. Especially when you account for the thanks the pro-
ject gets: It only comes from users who call flashrom directly. No
fwupd, no big company using it for production.

>
>> In my personal experience, Meson seems harder to maintain.
>
> Seriously?! I think with a statement like that you should qualify it
> with the number of meson build fixes you've had to do so far.

Seriously?! Ripping lines out of context and then complaining about
qualification?

Nico
___
flashrom mailing list -- flashrom@flashrom.org
To unsubscribe send an email to flashrom-le...@flashrom.org


[flashrom] Re: One build system to rule them all (Meson)

2020-10-28 Thread Richard Hughes
On Wed, 28 Oct 2020 at 16:19, Angel Pons  wrote:
> It is very simple: the `-o` command-line option is unusable on the
> distributions which have switched to meson to build flashrom.

You've just said; the bug was fixed upstream already, I'm not sure
what else I could have done other than not make the mistake in the
first place. I'm not going to fight for meson support every time
someone suggests removing it; if there's a consensus to rip out code
to fight "technical debt" please just do it.

Richard
___
flashrom mailing list -- flashrom@flashrom.org
To unsubscribe send an email to flashrom-le...@flashrom.org


[flashrom] Re: One build system to rule them all (Meson)

2020-10-28 Thread Angel Pons
Hi list,

Personally, I would prefer to keep using Make as flashrom's build
system. It is what most (if not all) flashrom developers are used to,
and has stood the test of time pretty well. However, every time meson
has been brought up, I have perceived little interest on behalf of
meson's proponents to ensure it is properly maintained. If meson
advocates beg to differ, then I would request that they substantiate
their stance. Having to deal with externally-imposed technical debt is
not something I desire, and I highly doubt anyone else would.

On Wed, Oct 28, 2020 at 1:41 PM Richard Hughes  wrote:
>
> On Wed, 28 Oct 2020 at 12:20, Nico Huber  wrote:
> > So we didn't need these things before. Why do we need them now?
>
> Meson makes it possible to build fwupd as a subproject of fwupd, on
> any architecture, on any distro, which means we can use libflashrom on
> machines that don't ship a new enough distro version. A lot of
> companies care (including Google) about using fwupd for updating
> system firmware, and without libflashrom being available we'd just
> drop the flashrom plugin in fwupd, and in all honesty just reimplement
> the required bits of flashing to SPI directly.

How exactly does the build system prevent using libflashrom? If this
is due to a limitation of the Makefiles, why not simply fix them? Or
is it that meson is unable to build projects using Makefiles, which
would simply be a deficiency of meson? Still, if flashrom's build
system is somehow unsuitable to use with fwupd, there's nothing that
would preclude deprecating libflashrom usage in favor of a NIH
reimplementation. However, there is only one chance in production
environments: just one mistake can effectively transmute many
computers into highly expensive ornaments.

> As a project you can do
> as you like, but dropping meson would be a huge step backwards for
> people actually using flashrom in production systems and I'm sure
> would alter the future viability of the project.

Fallacious threats as a means to an end might have worked in the past
or in other situations, but can only lead to the caster's own
extinction when used here.

The `-o` command-line option (essential when remotely diagnosing
problems) was unusable on Debian at some point, because of a bug in
the meson files. While the bug has already been addressed upstream,
the broken packages still remain. Plus, since many distributions are
Debian derivatives, they also have the same problem. If meson support
had never been submitted, this problem would have never happened.

I however agree that dropping meson support would alter the future
viability of the project. Without meson, the flashrom project would
have less technical debt to take care of, and the few developers in
charge could spend their time and energy reviewing very useful
features, such as support for flashing ATI/AMD graphics cards; c.f.
https://review.coreboot.org/c/flashrom/+/29078 and follow-ups.

> > In my personal experience, Meson seems harder to maintain.
>
> Seriously?! I think with a statement like that you should qualify it
> with the number of meson build fixes you've had to do so far.

I had to fix meson several times, and also pushed towards having it
build-tested. I agree with Nico that it is harder to maintain,
primarily because no one actively does so. Experience from coreboot
tells me that code with lots of users but next to no maintainers will
eventually need to be scrapped. This makes users sad, but relieves
developers from neglected technical debt's endless well of suffering.
Having heaps of rotting code stall new features and improvements is
excruciatingly noxious to one's rationality.

> > I'm used to Make, and Meson (itself and
> > the integration in flashrom) is young.
>
> Well, it's good enough for hundreds of other much larger and older
> projects, including the likes of wayland, gstreamer, gtk and systemd.
> I guess it comes down to if "what you are used to" v.s. "what is best
> for the project".

A project isn't simply a pile of code. It also comprises the people
around it: the users, the maintainers, the developers... Only
accounting for the objective characteristics of flashrom's codebase is
not enough to decide something as fundamental as the build system for
the project.

> > So how about you bring the Meson
> > build up-to-speed first? and once it's able to produce the same binaries
> > on all platforms decide if it's working out?
>
> What binaries is it missing?

Nico's questions do not suggest in any way that binaries are missing,
but rather that they can be used to compare both build systems. One
way to test meson is to check whether it is reproducible: using the
same configuration options, do both build systems produce the exact
same executable and library binaries? Granted, it is time-consuming to
test all possible combinations of options on all platforms, but at
least some testing to be done. Otherwise, we risk introducing lots of
regressions which no one would then 

[flashrom] Re: One build system to rule them all (Meson)

2020-10-28 Thread Patrick Georgi via flashrom
Hi Richard,

calm down :-)

Nobody's ripping out anything anywhere, and the only proposed code
change is to rip out the Makefile in favor of meson, and it's far
from settled what will happen to that patch.

On Wed, Oct 28, 2020 at 01:41:30PM +, Richard Hughes wrote:
> dropping meson would be a huge step backwards for
> people actually using flashrom in production systems and I'm sure
> would alter the future viability of the project.
I'm not that concerned about the viability of flashrom with regard to
its choice of build systems: Apart from fwupd and potentially a few
distros, I doubt many are even aware that there is meson support in
the flashrom tree. Every support request I've seen for flashrom was
logging make output.

As Luc stated, that particular paragraph has rather bad optics...

> > In my personal experience, Meson seems harder to maintain.
> 
> Seriously?! I think with a statement like that you should qualify it
> with the number of meson build fixes you've had to do so far.
From migrating some ancient code base from GNU make to meson, I
remember that there were a couple of things to get used to, to say
the least. Especially when you're experienced with GNU make it's not
necessarily obvious that moving away from that to anything else is a
smart move given that there's a learning curve for flashrom developers
whereas in keeping the current approach has none.

> > I'm used to Make, and Meson (itself and
> > the integration in flashrom) is young.
> 
> Well, it's good enough for hundreds of other much larger and older
> projects, including the likes of wayland, gstreamer, gtk and system.
Without delving too deep in credentialism, of your list only gtk is
older than flashrom which can be traced back to a commit[0] made in
November 2000.

As for larger, they also have a much larger base of paid developers,
which brings us to...

> I guess it comes down to if "what you are used to" v.s. "what is best
> for the project".
The flashrom Makefile encodes _lots_ of knowledge collected over those
20 years and isn't just a bunch of build rules but also contains the
configuration side of things. Getting all that untangled and rewritten
in something else is a huge investment for a project of this size
and there are always risks in rewrites[1].

From that point of view I can understand the hesitation to just throw
out the baby with the bathwater, especially if the main argument
that is presented in favor of meson seems to be "it's new and the
cool kids use it."[2]


Let me try to offer an argument for using meson: The way flashrom
uses GNU make is highly unusual[3] in that it uses make for build
configuration in addition to dependency tracking.

That leads to people either hesitating to change the build system (been
there) or breaking it when they bring up the courage to contribute
(done that). In contrast, meson provides both configuration and
build (although by passing through to backends) but in an intentional
design that is documented in the meson project and a notable developer
usability improvement over other config + build combinations such as
autotools + GNU make.

> your research and found out which distros shipping flashrom are using,
Sorry but that focus on (Linux) "distros" seems somewhat limited:
Flashrom is used in various embedded contexts, on *BSDs, mac OS[4]
for which a driver[5] was specifically developed before that driver
was adopted for coreboot tooling, Windows, Solaris, and I guess it's
also usable on Linux. There are even DOS builds.


Regards,
Patrick

[0] 
https://review.coreboot.org/cgit/coreboot.git/commit/?id=307dc5b19a7cedcab7ec2ba51bb40996411e6e59,
[1] See "Excuse #3" in https://www.jwz.org/gruntle/nomo.html, 
https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/
[2] For some value of cool.
[3] In my opinion flashrom's use of make is even more arcane than
coreboot's, but I might be biased given that I built the latter's
build system. And I know crazy when I see it: I also built
significant parts of the openbios build flow and that one is
based on XSLT...
[4] A report that the Makefile based build fails on mac OS is what
brought me to look into the build system situation in the first
place.
[5] https://www.coreboot.org/DirectHW
-- 
Google Germany GmbH, ABC-Str. 19, 20354 Hamburg
Registergericht und -nummer: Hamburg, HRB 86891, Sitz der Gesellschaft: Hamburg
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado


signature.asc
Description: PGP signature
___
flashrom mailing list -- flashrom@flashrom.org
To unsubscribe send an email to flashrom-le...@flashrom.org


[flashrom] Re: One build system to rule them all (Meson)

2020-10-28 Thread Luc Verhaegen
On Wed, Oct 28, 2020 at 03:10:47PM +0100, Luc Verhaegen wrote:
> On Wed, Oct 28, 2020 at 01:41:30PM +, Richard Hughes wrote:
> > On Wed, 28 Oct 2020 at 12:20, Nico Huber  wrote:
> > > So we didn't need these things before. Why do we need them now?
> > 
> > Meson makes it possible to build fwupd as a subproject of fwupd, on
> > any architecture, on any distro, which means we can use libflashrom on
> > machines that don't ship a new enough distro version. A lot of
> > companies care (including Google) about using fwupd for updating
> > system firmware, and without libflashrom being available we'd just
> > drop the flashrom plugin in fwupd, and in all honesty just reimplement
> > the required bits of flashing to SPI directly. As a project you can do
> > as you like, but dropping meson would be a huge step backwards for
> > people actually using flashrom in production systems and I'm sure
> > would alter the future viability of the project.
> 
> Sounds like you are making an fwupd problem into a flashrom problem.

And "ADOPT THIS OR ELSE" is never a good look.

Luc Verhaegen.
___
flashrom mailing list -- flashrom@flashrom.org
To unsubscribe send an email to flashrom-le...@flashrom.org


[flashrom] Re: One build system to rule them all (Meson)

2020-10-28 Thread Luc Verhaegen
On Wed, Oct 28, 2020 at 01:41:30PM +, Richard Hughes wrote:
> On Wed, 28 Oct 2020 at 12:20, Nico Huber  wrote:
> > So we didn't need these things before. Why do we need them now?
> 
> Meson makes it possible to build fwupd as a subproject of fwupd, on
> any architecture, on any distro, which means we can use libflashrom on
> machines that don't ship a new enough distro version. A lot of
> companies care (including Google) about using fwupd for updating
> system firmware, and without libflashrom being available we'd just
> drop the flashrom plugin in fwupd, and in all honesty just reimplement
> the required bits of flashing to SPI directly. As a project you can do
> as you like, but dropping meson would be a huge step backwards for
> people actually using flashrom in production systems and I'm sure
> would alter the future viability of the project.

Sounds like you are making an fwupd problem into a flashrom problem.

Luc Verhaegen.
___
flashrom mailing list -- flashrom@flashrom.org
To unsubscribe send an email to flashrom-le...@flashrom.org


[flashrom] Re: One build system to rule them all (Meson)

2020-10-28 Thread Nico Huber
Hi Patrick,

On 28.10.20 11:09, Patrick Georgi via flashrom wrote:
> I just pushed https://review.coreboot.org/c/flashrom/+/46875 for
> review which replaces the make based build process with a call to
> use meson instead. The rationale is that the project is too small to
> warrant having two build systems.

thanks for the heads-up. IMHO, if we lack resources, we should drop
Meson instead, it seems there's a lot to do still and with the same
amount of effort, we could maintain Make for some years.

> There are likely reasons left to use make (e.g. build configurations
> not yet supported by meson), so please consider this mainly an
> opportunity to discuss where flashrom's build process is headed,
> a warning that make _may_ be on the way out and a call to action
> to improve the meson build system to the point where it covers all
> build configurations.

TL;DR We're currently able to build for libpayload, DOS, Windows
(natively, because there are native libraries involved for at least
one programmer) and MacOS. Please don't break that.

I have to admit, I'm strongly biased towards Make here. Not because
I don't like Meson, more because for flashrom it adds something with-
out stating why. There were some vague requirements mentioned when
Richard originally proposed Meson, and that the Makefile would have
to be hacked otherwise, but nothing specific.

Meson, AFAIUI, is not a replacement for Make. It's more an alternative
to the likes of GNU autotools and CMake, that don't build a program,
but generate Makefiles. Meson doesn't produce Makefiles, instead it
has a backend for Ninja which does Make's job then, AIUI.

So we didn't need these things before. Why do we need them now? (I
don't want to imply that we don't need it, really just want to have
the question answered. Sometimes things end in chaos when a solution
is provided before a problem was stated.)

In my personal experience, Meson seems harder to maintain. But that's
mostly because of two things: I'm used to Make, and Meson (itself and
the integration in flashrom) is young. So how about you bring the Meson
build up-to-speed first? and once it's able to produce the same binaries
on all platforms decide if it's working out?

Nico
___
flashrom mailing list -- flashrom@flashrom.org
To unsubscribe send an email to flashrom-le...@flashrom.org


[flashrom] One build system to rule them all

2020-10-28 Thread Patrick Georgi via flashrom
Hi everybody,

I just pushed https://review.coreboot.org/c/flashrom/+/46875 for
review which replaces the make based build process with a call to
use meson instead. The rationale is that the project is too small to
warrant having two build systems.

There are likely reasons left to use make (e.g. build configurations
not yet supported by meson), so please consider this mainly an
opportunity to discuss where flashrom's build process is headed,
a warning that make _may_ be on the way out and a call to action
to improve the meson build system to the point where it covers all
build configurations.


Comments, thoughts, counter proposals, patches welcome!
Patrick
-- 
Google Germany GmbH, ABC-Str. 19, 20354 Hamburg
Registergericht und -nummer: Hamburg, HRB 86891, Sitz der Gesellschaft: Hamburg
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado


signature.asc
Description: PGP signature
___
flashrom mailing list -- flashrom@flashrom.org
To unsubscribe send an email to flashrom-le...@flashrom.org