On Mon, 3 Oct 2022 at 11:25, Alex Bennée <alex.ben...@linaro.org> wrote: > > > Peter Maydell <peter.mayd...@linaro.org> writes: > > > On Mon, 3 Oct 2022 at 10:09, Alex Bennée <alex.ben...@linaro.org> wrote: > >> > >> > >> Thomas Huth <th...@redhat.com> writes: > >> > >> > On 29/09/2022 04.32, Jason Wang wrote: > >> >> On Thu, Sep 29, 2022 at 1:06 AM Philippe Mathieu-Daudé > >> >> <f4...@amsat.org> wrote: > >> >>> Jason, Marc-André, could we improve the buildsys check or display > >> >>> a more helpful information from the code instead? > >> >> It looks to me we need to improve the build. > >> > > >> > I'm not sure there is anything to improve in the build system - > >> > configure/meson.build are just doing what they should: Pick the > >> > default value for "slirp" if the user did not explicitly specify > >> > "--enable-slirp". > >> > >> Shouldn't it be the other way round and fail to configure unless the > >> user explicitly calls --disable-slirp? > > > > Our standard pattern for configure options is: > > --enable-foo : check for foo; if it can't be enabled, fail configure > > --disable-foo : don't even check for foo, and don't build it in > > no option given : check for foo, decide whether to build in support if > > it's present > > Don't we make a distinction between libs that are truly optional and > those you probably need.
Yes. If something is truly mandatory then configure will always fail. This is true for zlib and glib, for instance... > It seems missing working networking is one of > those things we should be telling the user about unless explicitly > disabled. It is after all how we worked before, we would silently > checkout libslirp and build it for you. ...but building without libslirp is perfectly reasonable for some configurations, eg where you know you're going to be using QEMU in a TAP network config, and you don't want to have libslirp in your binary so you don't have to think about whether you need to act on security advisories relating to it. "no slirp" isn't like "no zlib", where you can't build a QEMU at all. I think it's more like gtk support, where we will happily configure without gtk/sdl/etc and only build in the VNC frontend -- that's a working configuration in some sense, but for the inexperienced user a QEMU which doesn't produce a GUI window is almost certainly not what they wanted. So we could: * say that we will opt for consistency, and have the slirp detection behave like every other optional library * say that slirp is a special case purely because we used to ship it as a submodule and so users are used to it being present * say that slirp is a special case because it's "optional but only experts will want to disable it", and think about what other configure options (like GUI support) we might want to move into this category I don't think there's an obvious right answer here... thanks -- PMM